The different Nmap Commands
Avinash Kumar
Cyber Security Analyst | SC-200 | Under Top 100 in TCS HackQuest Season 8
Nmap, short for Network Mapper, is a powerful open-source network scanning tool used for network discovery and security auditing. It offers various commands and options to perform a wide range of network scanning tasks. Here are some key Nmap commands:
1. Basic Scan: nmap <target> scans a target host to identify open ports and services.
2. Port Range: Use -p followed by a range or comma-separated list of ports to scan specific ports, e.g., nmap -p 80,443 <target>.
3. Scan All Ports: To scan all 65,535 ports, use -p-, like nmap -p- <target>.
4. Aggressive Scan: -A enables aggressive scanning, including OS detection, version detection, script scanning, and traceroute.
5. UDP Scan: -sU performs UDP port scanning, suitable for services like DNS and SNMP.
6. Operating System Detection: -O attempts to identify the target's operating system.
7. Scripting Engine: --script runs Nmap scripts for various tasks, like vulnerability detection or service enumeration.
8. Ping Scan: -sn performs a host discovery scan without port scanning.
9. Timing Options: --timing allows you to control scan timing, from paranoid to insane.
10. Output Formats: -oN, -oX, -oG, and others specify output formats like normal, XML, and grepable.
11. Firewall Evasion: --flood and --mtu can be used for firewall evasion techniques.
12. Scan Network Range: You can scan entire network ranges like 192.168.1.0/24 as targets.
13. Scan Targets from a File: -iL lets you read a list of targets from a file.
14. Exclude Targets: --exclude allows you to exclude specific hosts from a scan.
15. Verbose Output: -v or -vv increases verbosity for more detailed output.
16. Interactive Mode: -i launches Nmap in interactive mode for on-the-fly commands.
Nmap's flexibility and extensive feature set make it an invaluable tool for network administrators, security professionals, and ethical hackers to assess and secure networks. Understanding these commands and options is essential for effective network scanning and security assessment.