Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2018-10-20 19:30 UTC
## Trial 1
Nmap done: 8440 IP addresses (4486 hosts up) scanned in 446.64 seconds
$ grep Ports.*/tcp/ NODE_SCAN_RESULTS.data -c
4486
$ grep Ports.*/open/tcp/ NODE_SCAN_RESULTS.data -c
944
$ grep Ports.*/closed/tcp/ NODE_SCAN_RESULTS.data -c
2208
$ grep Ports.*/filtered/tcp/ NODE_SCAN_RESULTS.data -c
1334
In [1]: 4486 == 944 + 2208 + 1334
Out[1]: True
In [2]: 944 / 4486
Out[2]: 0.2104324565314311
## Trial 2
nmap only thought about half of the nodes were up, which is plausible
but maybe nmap's online detection is preventing it from looking at some
nodes with open ports. Add -Pn (treat all hosts as online) to nmap
parameters and try again.
Nmap done: 8440 IP addresses (8440 hosts up) scanned in 177.69 seconds
$ grep Ports.*/tcp/ NODE_SCAN_RESULTS.data -c
8440
$ grep Ports.*/open/tcp/ NODE_SCAN_RESULTS.data -c
1121
$ grep Ports.*/closed/tcp/ NODE_SCAN_RESULTS.data -c
2333
$ grep Ports.*/filtered/tcp/ NODE_SCAN_RESULTS.data -c
4986
In [1]: 8440 == 1121 + 2333 + 4986
Out[1]: True
In [2]: 1121 / 8440
Out[2]: 0.13281990521327014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.