The Network Mapper — NMAP
The following article was written for college purposes.
This tool will help you discover hosts and services on a computer network by sending packets and analyzing the responses. Nmap is not only used for hackers but also by network administrators for tasks such as network inventory or monitoring host or service uptime.
This are some examples how to use this powerful tool:
Host discovery
You can easily map a network and discover how many and which machines are up.
nmap -sP <network>
Port scanning
If you are trying to find which ports are open in a machine, you just have to use the following comand:
nmap -sT <IP_ADDRESS>
Specific port scan
In case you want to check if a certain port is open:
nmap -p <PORT> <IP_ADDRESS>
I checek if the SSH port (22) was opened:
OS detection
You can also find which operating system the machine is running on:
sudo nmap -O <IP_ADDRESS>
This one had to be done with root privileges!
Stealth mode
In case you have to go under the rader and don’t raise any suspicion:
nmap -sS <NETWORK>
This also takes longer.
Network Inventory
If you want to create an inventory for your network, or if you are footprinting a network this will do the trick:
nmap -sS -O -T3 -oA invent <NETWORK>
(You can had or remove what you want to see, just use nmap -h to show every command).
Interfaces and Routes
This command will show you which interfaces and routes the host is working with:
nmap --iflist <IP_ADDRESS>
More information
In case you want to gather more information to a certain machine use the following command:
nmap -v <IP_ADDRESS>