hades
hades copied to clipboard
Add scan subnet functionality
This feature contains the following changes:
- Adds the capability to scan a given subnet
- Updates README.md and added a section describing how to perform a subnet scan.
iex> Hades.new_command()
...> |> Hades.add_argument(Hades.Arguments.ScanTechniques.arg_sP())
...> |> Hades.add_target("192.168.120.42/24")
...> |> Hades.scan()
02:28:50.664 [info] NMAP Output: "Starting Nmap 7.80 ( https://nmap.org ) at 2020-03-02 02:28 W. Central Africa Standard Time\r\n"
02:29:09.001 [info] NMAP Output: "Nmap scan report for 192.168.100.1\r\n"
02:29:09.001 [info] NMAP Output: "Host is up (0.00s latency).\r\nMAC Address: F8:75:88:9D:F9:B5 (Huawei Technologies)\r\n"
02:29:09.001 [info] NMAP Output: "Nmap scan report for 192.168.100.2\r\n"
02:29:09.001 [info] NMAP Output: "Host is up (0.047s latency).\r\nMAC Address: 78:31:C1:D0:87:8E (Apple)\r\n"
02:29:24.300 [info] NMAP Output: "Nmap scan report for 192.168.100.3\r\n"
02:29:24.300 [info] NMAP Output: "Host is up.\r\n"
02:29:26.568 [info] NMAP Output: "Nmap done: 256 IP addresses (3 hosts up) scanned in 36.03 seconds\r\n"
02:29:26.584 [info] Port exit: :exit_status: 0
02:29:26.584 [info] DOWN message from port: #Port<0.83>
%{
hosts: [
%{hostname: "", ip: "192.168.100.1F8:75:88:9D:F9:B5", ports: []},
%{hostname: "", ip: "192.168.100.278:31:C1:D0:87:8E", ports: []},
%{hostname: "", ip: "192.168.100.3", ports: []}
],
time: %{
elapsed: 36.03,
endstr: "Mon Mar 02 02:29:26 2020",
unix: 1583112566
}
@fklement I chose to use the same add_target/1 function to do the subnet scan. It would be intuitive for most nmap users to just add the "/24", "16" subnet at the end eg (add_target("192.168.100.1/24") instead of having add_target(ip, "/24").
Hey, any merge timeline on this?
Hey, any merge timeline on this?
I have not had the time to work on the suggestions requested by @fklement but my fork does have a working implementation.