nmap on Ubuntu

Installing nmap on Ubuntu

In order to install nmap on Ubuntu, we will be using these commands at terminal:

$ sudo apt-get install nmap

Simple Scanning With nmap on Ubuntu

In terminal of your choosing, type(you should use your own ip address or ip address of network you wish to scan):

$ sudo nmap -sn 10.0.0.0/24

Whatever ip address you have must be followed by ‘/24’. It also helps to change last number to ‘0’. That will give us first possible ip address on that network. Using ‘/24’ informs our computer to scan from ip address ‘10.0.0.0’ until it reaches and scans ‘10.0.0.255’.

Diving Deeper Scanning With nmap on Ubuntu

If we remove our ‘-sn’ option, we can use nmap to scan ports on all of those devices we found above.

Type:

$ sudo nmap 10.0.0.0/24

Aggressively Scanning With nmap On Ubuntu

$ sudo nmap -A -T4 10.0.0.254

In this line of code, ‘-A’ option acts as an aggressive scan. This runs nmap’s operating system detection, version detection, script scanning, and traceroute detection.

There is a timing template set by ‘-T’ flag. From 0 to 5, we can chose to run nmap in one of these timing modes. Each timing mode is interestingly named:

  • (0) Paranoid
  • (1) Sneaky
  • (2) Polite
  • (3) Normal
  • (4) Agressive
  • (5) Insane

Source