🛠️
Ghoul's Den
WebsiteGhoulsec-Vault
  • Ghoul's Den
  • Index of Tools
  • Index of Links
  • Top Ports
  • Initial Environment Deployment
    • Python3 & Pip Installation
    • Docker 🛳
    • Setting up AWS CLI
    • Msfconsole
    • Netplan configuration & Cloudinit
    • Wordlist Generation - CEWL
    • Apache2 Server
  • Information Gathering & Recon Tools
    • GHDB : Google Hacking Database
    • Sherlock : Social Media Footprinting
    • Nslookup
    • Dig (Domain Information Groper)
    • Recon-ng
    • HTTrack & Web Data Extractor
    • Email Tracker Pro
    • Shodan
    • ARIN Website Registry
  • Network Scanning Enumaration & Vulnerability Detection Tools
    • NMAP & SuperENUM
    • Nmap
      • Target Specification
      • Host Discovery
      • Port Scanning Techniques
      • Port Specification & Scan Order
      • Service Version Detection
      • OS Detection
      • Nmap Scripting Engine
      • Timing & Performance
      • FW / IDS / IPS Evasion
      • Miscellaneous Options
    • Colasoft Packet Builder & Megaping
    • Global Network Inventory
    • LDAP Enumeration > Active Directory Explorer
    • NetBIOS Enumerator
    • SMBEagle
    • RPC Scan
    • Nikto - Web Application Scanner
    • Enum4Linux
  • File Sharing Enumeration
  • Cloud Computing
    • AAD Internals
    • AWS CLI & S3
    • Trivy Scanner
    • S3 Scanner
    • LazyS3
  • Cryptography & stegnography
    • Veracrypt
    • Cryptanalysis Tools
    • Whitespace Cryptography - Snow
    • Creating a Self signed certificate in IIS
    • Steghide & Stegcracker
    • snow
  • Wireless Attacks
    • Aircrack-ng
  • Mobile Attacks
    • PhoneSploit-Pro
    • AndroRAT
    • ADB
  • SQL Injection Vulnerability
    • SQLMap
    • DSSS
  • IOT & OT Hacking
  • Social Engineering
  • Honeypot & IDS
    • Cowrie Honeypot
  • Sniffing & DDos
    • Sniffing
      • Capturing Remote packets using Wireshark
      • Detecting Sniffing using Nmap
    • Denial of Service (Dos & DDos)
      • DDos Protection using DDos Guardian
  • Malware Attacks
  • Password Cracking & Windows exploitation tools
    • Hydra
    • John
    • Hashcat
    • CrackMapExec
    • Impacket
    • Powerview
    • BitsAdmin
    • Rubeus (Kerberoasting) & Winpeas
    • AD-DC Querying
    • mstsc - RDP
  • System hacking & buffer overflow
    • Responder
    • Reverse Shell Generator
    • Clearing Traces
  • Session Hijacking
    • Caido
    • Bettercap
  • Web Servers & Applications
  • Linux Fundamentals
    • Find Command
    • Grep Command
Powered by GitBook
On this page
  1. Network Scanning Enumaration & Vulnerability Detection Tools
  2. Nmap

Target Specification

1. -iL (Input from list)

This option allows you to scan targets listed in a file. The file can contain IPs, hostnames, CIDR ranges, or octet ranges.

Example:

nmap -iL target_list.txt

Where target_list.txt contains:

192.168.1.1
example.com
10.0.0.0/24

2. -iR (Choose random targets)

Randomly generates a specified number of IP addresses to scan.

Example:

nmap -iR 1000 -p 80

This command scans 1000 randomly chosen IPs on port 80.

3. --exclude [,[,...]] (Exclude hosts/networks)

Excludes certain hosts or networks from the scan.

Example:

nmap -p 80 192.168.1.0/24 --exclude 192.168.1.1,192.168.1.50

This command will scan the entire 192.168.1.0/24 network except for 192.168.1.1 and 192.168.1.50.

4. --excludefile <exclude_file> (Exclude list from file)

Similar to --exclude, but the excluded targets come from a file.

Example:

nmap -p 80 192.168.1.0/24 --excludefile exclude_list.txt

Where exclude_list.txt contains:

192.168.1.1
192.168.1.50

5. -n (No DNS resolution)

Disables reverse DNS resolution during the scan.

Example:

nmap -n 192.168.1.0/24

This scans the 192.168.1.0/24 network without attempting DNS resolution.

6. -R (DNS resolution for all targets)

Forces Nmap to perform reverse DNS resolution on all targets, even if they aren't active.

Example:

nmap -R 192.168.1.1 192.168.2.0/24

This command resolves the hostnames of all targets, even if they are down.

7. --resolve-all (Scan each resolved address)

Scans all resolved addresses when a hostname resolves to multiple IPs.

Example:

nmap --resolve-all example.com

This scans all IPs associated with example.com.

8. --unique (Scan each address only once)

Ensures that each IP address is scanned only once, even if it appears multiple times in the target list.

Example:

nmap --unique 192.168.1.1 192.168.1.1 192.168.2.0/24

This ensures that 192.168.1.1 is scanned only once, despite being listed twice.

9. --system-dns (Use system DNS resolver)

Forces Nmap to use the system's DNS resolver rather than Nmap's parallel resolver.

Example:

nmap --system-dns 192.168.1.1

This forces the system's DNS resolver to resolve the target instead of Nmap's default.

10. --dns-servers [,[,...]] (Servers to use for reverse DNS queries)

Specifies custom DNS servers for reverse DNS queries.

Example:

nmap --dns-servers 8.8.8.8,8.8.4.4 192.168.1.1

This uses Google’s DNS servers (8.8.8.8 and 8.8.4.4) for reverse DNS resolution.

These examples demonstrate how to fine-tune Nmap's target selection and DNS options for different scanning needs, from basic network sweeps to customized DNS lookups and exclusions.

PreviousNmapNextHost Discovery

Last updated 3 months ago