HOWTO use NMAP for Network Sweeping

A simple NMAP network sweeping command is nmap -sn 10.11.1.200-254, this is to check hosts between 192.168.1.100 to 192.168.1.200

You can also use option -oG greppable format to produce the out to a file. For example run nmap -sn 10.11.1.200-254 -oG ping-sweep-nmap where ping-sweep-nmap is the name of the file. You can read the output file using cat ping-sweep-nmap.

root@kali:~# cat ping-sweep-nmap
# Nmap 6.47 scan initiated Thu Jul 21 09:40:57 2016 as: nmap -sn -oG ping-sweep-nmap 10.11.1.200-254
Host: 10.11.1.202 () Status: Up
Host: 10.11.1.209 () Status: Up
Host: 10.11.1.214 () Status: Up
Host: 10.11.1.217 () Status: Up
Host: 10.11.1.218 () Status: Up
Host: 10.11.1.219 () Status: Up
Host: 10.11.1.220 () Status: Up
Host: 10.11.1.221 () Status: Up
Host: 10.11.1.223 () Status: Up
Host: 10.11.1.226 () Status: Up
Host: 10.11.1.227 () Status: Up
Host: 10.11.1.229 () Status: Up
Host: 10.11.1.230 () Status: Up
Host: 10.11.1.234 () Status: Up
Host: 10.11.1.237 () Status: Up
Host: 10.11.1.238 () Status: Up
Host: 10.11.1.247 () Status: Up
Host: 10.11.1.251 () Status: Up
Host: 10.11.1.252 () Status: Up
# Nmap done at Thu Jul 21 09:41:23 2016 — 55 IP addresses (19 hosts up) scanned in 26.84 seconds

Then you can start cleaning your result.

root@kali:~# grep Up ping-sweep-nmap
Host: 10.11.1.202 () Status: Up
Host: 10.11.1.209 () Status: Up
Host: 10.11.1.214 () Status: Up
Host: 10.11.1.217 () Status: Up
Host: 10.11.1.218 () Status: Up
Host: 10.11.1.219 () Status: Up
Host: 10.11.1.220 () Status: Up
Host: 10.11.1.221 () Status: Up
Host: 10.11.1.223 () Status: Up
Host: 10.11.1.226 () Status: Up
Host: 10.11.1.227 () Status: Up
Host: 10.11.1.229 () Status: Up
Host: 10.11.1.230 () Status: Up
Host: 10.11.1.234 () Status: Up
Host: 10.11.1.237 () Status: Up
Host: 10.11.1.238 () Status: Up
Host: 10.11.1.247 () Status: Up
Host: 10.11.1.251 () Status: Up
Host: 10.11.1.252 () Status: Up

Follow up with the parameter cut -d” ” -f2

root@kali:~# grep Up ping-sweep-nmap |cut -d” ” -f2
10.11.1.202
10.11.1.209
10.11.1.214
10.11.1.217
10.11.1.218
10.11.1.219
10.11.1.220
10.11.1.221
10.11.1.223
10.11.1.226
10.11.1.227
10.11.1.229
10.11.1.230
10.11.1.234
10.11.1.237
10.11.1.238
10.11.1.247
10.11.1.251
10.11.1.252

now that’s easy.

Now let’s sweep for specific port number with greppable format and save it to web-sweep.txt file

root@kali:~# nmap -p 80 10.11.1.200-254 -oG web-sweep.txt

Read the result, root@kali:~# cat web-sweep.txt

Now, let’s run nmap connect scan using the 20 top ports and save it on a file for review.

root@kali:~# nmap -sT –top-ports 20 10.11.1.200-254 -oG top-port-sweep.txt

 

Please continue reading other HOWTO articles.

 

EM @QUE.COM

Founder, QUE.COM Game Studios. | Founder, Yehey.com a Shout for Joy! | MAJ.COM Management of Assets and Joint Venture | More at KING.NET Ideas to Life | Network of Innovation | Send your Tip to my Bitcoin/Ethereum or other crypto currency.

Leave a Reply