robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.
GNU Affero General Public License v3.0
23.55k stars 3.08k forks source link

Scan results are inconsistent #380

Open EwaldvanGeffen opened 6 years ago

EwaldvanGeffen commented 6 years ago
[root@net-scan` bin]# ./masscan 31.193.181.25 -p 0-65535 --rate 500000 -oG output

Starting masscan 1.0.6 (http://bit.ly/14GZzcT) at 2018-10-19 13:20:51 GMT
 -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [65536 ports/host]
[root@net-scan bin]# cat output
# Masscan 1.0.6 scan initiated Fri Oct 19 13:20:51 2018
# Ports scanned: TCP(65536;0-65535) UDP(0;) SCTP(0;) PROTOCOLS(0;)
Host: 31.193.181.25 ()  Ports: 3306/open/tcp//mysql//
Host: 31.193.181.25 ()  Ports: 80/open/tcp//http//
Host: 31.193.181.25 ()  Ports: 9999/open/tcp//distinct//
# Masscan done at Fri Oct 19 13:21:03 2018
[root@net-scan bin]# ./masscan 31.193.181.25 -p 0-65535 --rate 100000 -oG output

Starting masscan 1.0.6 (http://bit.ly/14GZzcT) at 2018-10-19 13:21:10 GMT
 -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [65536 ports/host]
[root@net-scan bin]# cat output
# Masscan 1.0.6 scan initiated Fri Oct 19 13:21:10 2018
# Ports scanned: TCP(65536;0-65535) UDP(0;) SCTP(0;) PROTOCOLS(0;)
Host: 31.193.181.25 ()  Ports: 443/open/tcp//https//
Host: 31.193.181.25 ()  Ports: 9999/open/tcp//distinct//
Host: 31.193.181.25 ()  Ports: 80/open/tcp//http//
Host: 31.193.181.25 ()  Ports: 3306/open/tcp//mysql//
# Masscan done at Fri Oct 19 13:21:23 2018

Actual pps around 60k.

penyaringan commented 5 years ago

My co-worker found a work around for this. Use --retries=2.

Your --rate is also unusually high which will definitely give poor results if the box you're scanning from can't handle it. I tune masscan on new machines by starting with a low rate (1000) and incrementally increase until I see it give incorrect results.

Rokin05 commented 5 years ago

I have similar issues : masscan -pxx -iL xxxxx --rate=xxxxx --randomize-hosts

target : ~1M hosts / network upload speed 1mb, dl 20mb+

--rate=15000 found : 21 hosts --rate=5000 found : 121 hosts --rate=1000 found : 633 hosts