Ping a subnet:
nmap -n -sP 172.16.0.0/16 -oG - | cut -d' ' -f2,4 | cut -d' ' -f1 | grep ^[0-9] >> 172.16.txt
From a target list:
nmap -n -sP -iL HQWorkstations.txt -oG - | cut -d' ' -f2,4 | cut -d' ' -f1 | grep ^[0-9] >> HQWork.txt
For a specific port or ports:
nmap -p445 -Pn 192.168.1.1/24 -oG - | grep 445/open | cut -d' ' -f2 >> smb.txt
Get a number of live systems when using -Pn
cat FileName.gnmap | grep "Status: Up" | cut -d' ' -f2 | wc -l
Hello, what is the optimal format should be the target list in the file HQWorkstations.txt, could give an example?
ReplyDeleteUpdate:
ReplyDeletenmap -sL 192.168.1.1/28 -oG - | cut -d " " -f2 | grep ^[0-9]