it aims to addresses Issue #677 -- see details below
it adds a new CLI option --echo-cidr to output IP addresses at CIDR format (X.Y.Z.T/M) instead of range format (X1.Y1.Z1.T1-X2.Y2.Z2.T2) -- see details below
These two things are in one PR because they modify the same parts of the code - two different PR would lead to merge conflicts.
If I am not mistaken, there is currently no option in masscan to output the list of IP ranges to be scanned:
ordered by numerical order of the first IP of each range
only using CIDR notations (<first ip>/<mask>).
Indeed, the option -sL outputs a list of IP addresses (not ranges) in a random order, and --echo outputs masscan configuration, including ranges but also other options, and in a non-consistent format.
This PR adds the option --echo-cidr that outputs the the ordered list of CIDR ranges.
For instance, with the following list of IP addresses to scan:
This PR does 2 things:
--echo-cidr
to output IP addresses at CIDR format (X.Y.Z.T/M
) instead of range format (X1.Y1.Z1.T1-X2.Y2.Z2.T2
) -- see details belowThese two things are in one PR because they modify the same parts of the code - two different PR would lead to merge conflicts.
Address Issue #677
Add
--echo-cidr
CLI optionIf I am not mistaken, there is currently no option in masscan to output the list of IP ranges to be scanned:
<first ip>/<mask>
).Indeed, the option
-sL
outputs a list of IP addresses (not ranges) in a random order, and--echo
outputs masscan configuration, including ranges but also other options, and in a non-consistent format.This PR adds the option
--echo-cidr
that outputs the the ordered list of CIDR ranges. For instance, with the following list of IP addresses to scan:masscan -iL ips.txt --echo-cidr
masscan -iL ips.txt -sL | head -n 10
masscan -iL ips.txt --echo
TARGET SELECTION (IP, PORTS, EXCLUDES)
ports = range = 10.0.0.0-10.0.1.15 range = 192.168.0.0/30 range = 192.168.1.2/31