Tuesday, February 17, 2015

Scanning open ports in linux using nmap

nmap - Network exploration tool and security / port scanner

Syntax:
nmap [options] target

Scan all the open ports
$ nmap localhost       use: -F for fast scan, -p [port number] for particular port
Output:
Not shown: 993 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http
111/tcp  open  rpcbind
631/tcp  open  ipp
3306/tcp open  mysql

Scan remote ip/host

$ nmap google.com

Starting Nmap 5.51 ( http://nmap.org ) at 2015-02-17 15:35 IST
Nmap scan report for google.com (74.125.236.36)
Host is up (0.00095s latency).
Other addresses for google.com (not scanned): 74.125.236.41 74.125.236.39 74.125.236.34 74.125.236.32 74.125.236.46 74.125.236.37 74.125.236.40 74.125.236.33 74.125.236.38 74.125.236.35
rDNS record for 74.125.236.36: maa03s04-in-f4.1e100.net
Not shown: 942 closed ports, 56 filtered ports
PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https

Scan only TCP (T) or UDP (U) or Other(O) open ports

nmap -sT localhost


No comments:

Post a Comment

CSS tricks

Mixed paint in background: background: linear-gradient(to right, #b6e358, #38b143) Grid view: display: grid; grid-template-columns: a...