robertdavidgraham / masscan

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

masscan already got --exclude, but then want it again when resuming #110

Open safinaskar opened 9 years ago

safinaskar commented 9 years ago

Steps to reproduce:

10:/tmp/masscan# bin/masscan 0.0.0.0/0 -p 80 --excludefile data/exclude.conf -oX /dev/null
<...>
^Cwaiting several seconds to exit...
saving resume file to: paused.conf
10:/tmp/masscan# bin/masscan --resume paused.conf
FAIL: range too big, need confirmation
 [hint] to prevent acccidents, at least one --exclude must be specified
 [hint] use "--exclude 255.255.255.255" as a simple confirmation

I. e. masscan already got --exclude, but then want it again when resuming.

Also, there is another bug (but I'm not sure whatever this is a really bug):

10:/tmp/masscan# bin/masscan 0.0.0.0/0 -p 80 --excludefile data/exclude.conf
<...>
^Cwaiting several seconds to exit...                                            
saving resume file to: paused.conf                                    
10:/tmp/masscan# bin/masscan --resume paused.conf 
FAIL: unknown output-format: unknown(0)
  hint: 'binary', 'xml', 'grepable', ...

I. e. masscan can output to stdout at default mode, but cannot do this when resuming. If you don't want to support stdout when resuming, then, i think, you should print more clean error message, i. e. "output to stdout is not supported when --resume is specified"

brandonpoc commented 7 years ago

I have found the same problem - I have to add the --excludefile option when resuming because masscan reports that the number of excludes is too large and, to be sure, the excludefile option should be included again. Perhaps a flag should be added to the resume file when excludefile is used so that it doesn't force you to specify the excludefile option again during resuming?

mizogomo commented 6 years ago

can help me masscan 0.0.0.0/0 -p0-65535 FAIL: range too big, need confirmation [hint] to prevent acccidents, at least one --exclude must be specified [hint] use "--exclude 255.255.255.255" as a simple confirmation

mzpqnxow commented 6 years ago

There are quite a few one-offs like this where specific settings don’t get dumped to paused.conf, I’ve fixed a few in the past. This will require a patch to the section that dumps the parameters to paused.conf. I don’t have time to help with this right now but it’s not a difficult patch now that you have a hint.