Linux Tools – NMAP Introduction (Network Mapping)

Nmap allows you to map your network from the Linux Command Line. You can determine IP Addresses, Mac Addresses, Open Ports, and even Operating Systems. This information can be outputted to a human readbale text file, or an XML file for parsing by custom scripts.

  • Make sure to run nmap as either Root or with Sudo to capture Mac address.
  • If you are going to trigger Nmap with a CronJob point to a shell script instead of just an nmap command.
  • Nmap requires extermination to make sure the results you get are what you expect.
  • Nmap scans can take a long time to complete so using Verbose mode is advisable to verify nmap is running as you expect.

Additional Information

Install Nmap

sudo apt-get install nmap

Scan a Specific IP Address

sudo nmap 192.168.1.1

Scan a Network

sudo nmap 192.168.1.0/24

Output Results to a Text File

sudo nmap 192.168.1.0/24 -oN /home/username/nmapResults.txt

Aggressively Scan (Try to Find OS), Only Scan 100 Most Common Ports, Verbose Mode to Update Terminal with Current Progress

sudo nmap -A -F -v 192.168.1.0/24

Some Common Options

  • -A – Aggressively scan to find Operating System and additional information about host
  • -F – Speeds up scan by only scanning most common TCP ports
  • -v – Outputs current status to terminal
  • -oN – Writes results to a human readable text file
  • -oX – write results to a parsable XML file

Be the first to comment

Leave a Reply