Nmap has a scan feature called list scan that will output the IPs to be tested. All you need to do is supply it with a range/file-with-ranges and it will output the IPs, one in a line. The output may be a little ugly so i created a quick function to parse out just the IPs
expandrange() { if [[ -z $1 ]]; then echo 'Expands the subnets/ranges provided in the first argument to output in the second argument (file)' echo 'Usage: expandrange range.cidr.txt range.long.txt' else nmap -sL -n -iL $1 | grep 'Nmap scan' | cut -d ' ' -f 5 > $2 fi; }
No comments:
Post a Comment