Network - Nmap to (discover|scan) the open port / service

> NetWork

1 - About

Nmap ("Network Mapper") is a free and open source (license) utility for network exploration or security auditing that permits to query open port

Advertising

3 - Management

3.1 - Installation

  • Linux
apt-get install nmap
  • Windows. Download the msi package

3.2 - scan a computer to see the open port ?

nmap -v -A scanme.nmap.org

3.3 - scan a network ?

From ZenMap, choose the scan that you want perform and change the value of <target> by for instance for a 255.255.255.0 subnetmask 192.168.1.1/24 and click on the scan button.

3.4 - define the port

You define the port with the p verbose.

For example, the argument -p U:53,111,137,T:21-25,80,139,8080 would scan:

  • UDP ports 53, 111,and 137,
  • the TCP ports 21 to 25 and the listed one 80, 139, 8080

Example with the port:

  • http 80,
  • https 443,
  • oracle listener 1521
  • and Obiee Presentation Service 9704
nmap -Pn -p T:80,443,1521,9704 sz0057.app.gen.local

where:

  • Pn threat the machine as up (in case of no ping is possible)
  • p defines the port

Output:

Starting Nmap 5.51 ( http://nmap.org ) at 2011-12-16 10:36 W. Europe Standard Time
Nmap scan report for obiee.gerardnico.local
Host is up (0.074s latency).
PORT     STATE    SERVICE
80/tcp   closed   http
443/tcp  filtered https
1521/tcp closed   oracle
9704/tcp open     unknown
MAC Address: 00:FF:93:3A:10:89 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 15.07 seconds
Advertising

4 - Documentation / Reference