Nmap
Nmap
map is short for Network Mapper. It is an open source security tool for network
exploration, security scanning and auditing. However, nmap command comes with lots of options that can
make the utility more robust and difficult to follow for new users.
Introduction:
The purpose of this post is to introduce a user to the nmap command line tool to scan a host and/or
network, so to find out the possible vulnerable points in the hosts. You will also learn how to use Nmap for
offensive and defensive purposes.
+-------- +
|server2 |
+-------- +
2014-Ag-8684
Where,
wks01 is your computer either running Linux/OS X or Unix like operating system. It is
used for scanning your local network. The nmap command must be installed on this
computer.
server1 can be powered by Linux / Unix / MS-Windows operating systems. This is an
unpatched server. Feel free to install a few services such as a web-server, file server and so
on.
server2 can be powered by Linux / Unix / MS-Windows operating systems. This is a fully
patched server with
firewall [2]. Again, feel free to install few services such as a web-server, file
server and so on. All three systems are connected via switch.
How do I install nmap?
Downoad from File hippo.com.
Instal it and check thfirst look thats looks like this:
2014-Ag-8684
To Check the active ports:
Sample Output
Topology
2014-Ag-8684
Topology View
For 192.168.1.*
2014-Ag-8684
For 192.168.1.1/24
#3:
2014-Ag-8684
Read list of hosts/networks from a file (IPv4)
The -iL option allows you to read the list of target systems using a text file. This is useful to scan a large number
of hosts/networks. Create a text file as follows:
cat > /tmp/test.txt
Sample outputs:
server1.cyberciti.biz
192.168.1.0/24
192.168.1.1/24
10.1.2.3 localhost
The syntax is:
nmap -iL /tmp/test.txt
2014-Ag-8684
#6: Find out if a host/network is protected by a firewall
nmap -sA 192.168.1.101
2014-Ag-8684
#9: Scan a network and find out which servers and devices are up and running
This is known as host discovery or ping scan
nmap -sP 192.168.1.0/24
Sample outputs
STATE SERVICE
2014-Ag-8684
2014-Ag-8684
2014-Ag-8684
#16: Scan a host using TCP ACK (PA) and TCP Syn (PS) ping
nmap -PS 192.168.1.100
Sample Output:
Starting Nmap 6.47 ( http://nmap.org ) at 2015-07-01 16:28 Pakistan Standard Time
Nmap scan report for 192.168.1.100
Host is up (0.022s latency).
Not shown: 996 filtered ports
PORT
STATE SERVICE
2014-Ag-8684
Host is up (0.031s latency).
Not shown: 996 filtered ports
PORT
STATE SERVICE
open icmp
2014-Ag-8684