DEV Community

Cover image for Nmap Cheatsheet for Hackers
Rocky Sah
Rocky Sah

Posted on

3

Nmap Cheatsheet for Hackers

๐ŸŽฅ Nmap Basics for Hackers: Watch the video

Nmap (Network Mapper) is one of the most powerful tools for network scanning and reconnaissance. Whether you are a penetration tester, bug bounty hunter, or cybersecurity enthusiast, mastering Nmap can give you an edge in discovering vulnerabilities and mapping network infrastructures.

๐Ÿ”น Basic Scanning Commands

  1. Scan a single IP
   nmap 192.168.1.1
Enter fullscreen mode Exit fullscreen mode
  1. Scan a range of IPs
   nmap 192.168.1.1-100
Enter fullscreen mode Exit fullscreen mode
  1. Scan an entire subnet
   nmap 192.168.1.0/24
Enter fullscreen mode Exit fullscreen mode
  1. Scan a specific port
   nmap -p 22 192.168.1.1
Enter fullscreen mode Exit fullscreen mode
  1. Scan multiple ports
   nmap -p 22,80,443 192.168.1.1
Enter fullscreen mode Exit fullscreen mode
  1. Scan all 65535 ports
   nmap -p- 192.168.1.1
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Host Discovery

  1. Ping Scan (Discover live hosts without scanning ports)
   nmap -sn 192.168.1.0/24
Enter fullscreen mode Exit fullscreen mode
  1. Disable host discovery (Scan only specified targets)
   nmap -Pn 192.168.1.1
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Advanced Scanning Techniques

  1. Service and version detection
   nmap -sV 192.168.1.1
Enter fullscreen mode Exit fullscreen mode
  1. Operating system detection

    nmap -O 192.168.1.1
    
  2. Aggressive scan (OS detection, version detection, script scanning, and traceroute)

    nmap -A 192.168.1.1
    
  3. Scan a target behind a firewall

    nmap -sS 192.168.1.1
    

๐Ÿ”น Script Scanning

  1. Use default scripts

    nmap -sC 192.168.1.1
    
  2. Use specific scripts (e.g., to detect vulnerabilities)

    nmap --script=vuln 192.168.1.1
    
  3. Run multiple scripts

    nmap --script=ftp*,http* 192.168.1.1
    

๐Ÿ”น Performance Optimization

  1. Increase speed (Use higher timing templates)

    nmap -T4 192.168.1.1
    
  2. Maximum speed (Be cautious, may be detected by IDS/IPS)

    nmap -T5 192.168.1.1
    

๐Ÿ”น Firewall Evasion & Stealth Scanning

  1. Fragment packets (Bypass simple packet filters)

    nmap -f 192.168.1.1
    
  2. Decoy scan (Make it appear as if multiple hosts are scanning)

    nmap -D RND:10 192.168.1.1
    
  3. Spoof source IP

    nmap -S 192.168.100.100 192.168.1.1
    
  4. Use custom packets

    nmap --data-length 50 192.168.1.1
    

๐Ÿ”น Output and Reporting

  1. Save scan results to a text file

    nmap -oN scan_results.txt 192.168.1.1
    
  2. Save results in XML format

    nmap -oX scan_results.xml 192.168.1.1
    
  3. Save results in all formats

    nmap -oA scan_results 192.168.1.1
    

๐Ÿ”น Conclusion

Nmap is an essential tool for cybersecurity professionals. Whether you are conducting penetration testing, vulnerability assessments, or ethical hacking, understanding Nmapโ€™s powerful features will enhance your reconnaissance skills.

๐Ÿ“Œ Watch the Nmap Basics for Hackers video to get a practical walkthrough and start using Nmap effectively!

๐Ÿš€ Happy Hacking! ๐Ÿ”ฅ

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay