Nmap (Network Mapper) is a security scanner used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. Depending on the type of scan the process can take from a few seconds to a few minutes.
nmap -p PORT IP/Hostname
nmap -P0 -T4 -sV -p- IP/Hostname
nmap -v IP/Hostname
nmap 10.0.0.1-20
nmap -sA IP/Hostname
nmap -PN IP/Hostname
[hyperion] (~) >>> nmap --reason -P0 -p 22 x.x.x.x
Starting Nmap 5.51 ( http://nmap.org ) at 2013-11-28 13:52 CST
Nmap scan report for x.x.x.x-static.reverse.softlayer.com (x.x.x.x)
Host is up, received user-set.
PORT STATE SERVICE REASON
22/tcp filtered ssh no-response
Nmap done: 1 IP address (1 host up) scanned in 2.10 seconds
### Perform an Agressive scan
The -A flag performs
[river] (~) >>> nmap -A 192.168.1.81
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 08:48 CDT
Nmap scan report for saturn (192.168.1.81)
Host is up (0.0033s latency).
Not shown: 996 closed ports
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.9 ((Unix))
| http-methods: Potentially risky methods: TRACE
|_See http://nmap.org/nsedoc/scripts/http-methods.html
|_http-title: Launchbot – Your Personal Startpage Script
139/tcp open netbios-ssn Samba smbd 3.X (workgroup: SATURN)
445/tcp open netbios-ssn Samba smbd 3.X (workgroup: SATURN)
3306/tcp open mysql?
| mysql-info: MySQL Error detected!
| Error Code was: 1130
---keys omitted here---
Network Distance: 1 hop
Host script results:
|_nbstat: NetBIOS name: SATURN, NetBIOS user: <unknown>, NetBIOS MAC: <unknown>
| smb-os-discovery:
| OS: Unix (Samba 4.1.6)
| Computer name: saturn
| NetBIOS computer name: SATURN
| Domain name: ctrlz.us
| FQDN: saturn.ctrlz.us
|_ System time: 2014-04-21T13:41:04+00:00
| smb-security-mode:
| Account that was used for smb scripts: guest
| User-level authentication
| SMB Security: Challenge/response passwords supported
|_ Message signing disabled (dangerous, but default)
|_smbv2-enabled: Server supports SMBv2 protocol
TRACEROUTE
HOP RTT ADDRESS
1 3.30 ms saturn (192.168.1.81)
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 31.39 seconds