robertdavidgraham / masscan

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

Can masscan be more intelligent #249

Open BingoZ opened 7 years ago

BingoZ commented 7 years ago

masscan --ports 51-55 --nmap-payloads payload.pcap x.x.x.x

I find masscan will by default use TCP scan and not send udp payload supplied in payload.pcap while scanning udp port 53 if 'U:53' is not set, but in fact people who set --nmap-payloads payload.pcap would not want to see masscan send TCP packet to ports which are defined in payload file.

It can be very useful if masscan can automaticly check if the target port is in payload file, and then determine whether TCP or UDP scan should be used, especially if you want to make masscan send UDP payload to some UDP ports, eg: 53, 123, while scanning a large range of ports like --ports 7-65535 .

berney commented 7 years ago

I disagree, you may want to scan both TCP/53 and UDP/53 for example.

I think masscan should do what it was told to do, not what you want it to do. E.g. if you say scan ports 51-55 it should scan TCP ports 51-55 and not magically scan TCP ports 51-52 and 54-55 plus UDP 53. This is the Do What I Say vs Do What I Mean, and I'm on the Say side in this case.

Use something like: masscan --ports 51-55,U:53 --nmap-payloads nmap-payloads x.x.x.x.