Nmap, also known as Network Mapper, is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks but it can work against single hosts. Nmap uses raw IP packets to determine the hosts available on the network, their services along with details, operating systems used by hosts, the type of firewall used, and other information.
To scan specific ports using Nmap, the `-p` option is used followed by the port number. For example, to scan port 80, the most common port for HTTP, you would use the command `nmap -p 80 [target]`, where ‘[target]’ is the system you are scanning. If you want to scan multiple specific ports, you can separate the port numbers with a comma: `nmap -p 80,443 [target]`.
If you want to scan a range of ports, you can specify the range with a hyphen. For example, `nmap p 1-100 [target]` will scan ports 1 through 100 on the target system. To scan all 65535 ports, you can use the `-p-` option like so: `nmap -p [target]`. By default, Nmap only scans the most commonly used 1,000 ports.
Nmap has many advanced features and options. For more advanced scans, you can use the `-s` option followed by the scan type. For example, `-sS` conducts a SYN scan, which is a stealthy scan that doesn’t complete the TCP handshake, making it less likely to be detected by firewalls or intrusion detection systems.
Nmap also allows scripts using the scripting engine, that are useful for detecting more specific information about the target’s vulnerabilities, behaviors, or to discover more beyond what the standard scan can explore.
Remember to only use Nmap to scan networks you have permission to scan. Unauthorized port scanning can be illegal.
For more detailed information and advanced usage, you can consult the official Nmap documentation, available at nmap.org/book/man.html. Please note, the manual page is comprehensive and it describes all Nmap options and their use cases in detail.
Various official Nmap books including ‘Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning’ are available, which offer deeper insight into using Nmap effectively for network analysis and security auditing.
Sources:
1. “Nmap Man Page”. Nmap.Org. https://nmap.org/book/man.html.
2. Lyon, Gordon Fyodor. “Nmap Network Scanning: The Official Nmap Project Guide To Network Discovery And Security Scanning”. Nmap.Org. https://nmap.org/book/.
3. “Nmap Port Scanning”. Guru99. https://www.guru99.com/nmap-tutorial.html.
4. “Scanning The Internet With Nmap”. Nmap.Org. https://nmap.org/book/idlescan.html.