647 words
3 minutes
Network Scanning and Enumeration Techniques

Network scanning and enumeration form the foundation of any penetration test or security assessment. Done well, they reveal the real attack surface, reduce guessing, and guide the next steps. Done poorly, they create noise, miss critical services, or cause outages.

Why Scanning Matters#

Before you can exploit anything, you need to know what is actually there. Scanning reveals:

  • Live hosts and open ports
  • Service banners and versions
  • Network topology and segmentation
  • Hidden services and misconfigurations
  • Potential attack paths

Recon Workflow (Professional Flow)#

  1. Scope and rules of engagement
  2. Host discovery (identify live targets)
  3. Port discovery (open TCP and UDP)
  4. Service detection (versions, banners, protocols)
  5. Targeted enumeration (protocol-specific checks)
  6. Validation (confirm findings with secondary tools)
  7. Documentation (clean notes, evidence, and risk)

Essential Tools#

1. Nmap - The Gold Standard#

Basic scan:

Terminal window
nmap -sCV target.com

Full port scan:

Terminal window
nmap -p- --min-rate 1000 -T4 target.com

UDP scan (top ports):

Terminal window
nmap -sU --top-ports 100 target.com

Stealth scan (SYN):

Terminal window
nmap -sS -T2 target.com

Service detection:

Terminal window
nmap -sV --version-intensity 7 target.com

2. Masscan - High-Speed Discovery#

Use for initial port discovery when large ranges are in scope:

Terminal window
masscan 10.0.0.0/8 -p1-65535 --rate 10000 -oG masscan.gnmap

Then verify results with Nmap.

3. Rustscan - Fast Port Discovery + Nmap#

Terminal window
rustscan -a target.com -- -sV -sC

4. Netcat and Socat#

Quick banner grabbing:

Terminal window
nc -nv target.com 80

Port Scanning Techniques#

SYN Scan (Half-Open)#

Terminal window
nmap -sS target.com

Fast and stealthy. Sends SYN packets and analyzes responses.

Connect Scan#

Terminal window
nmap -sT target.com

More reliable on networks that block raw packets.

UDP Scan#

Terminal window
nmap -sU target.com

Slower but essential for UDP services (DNS, SNMP, TFTP, QUIC).

NULL, FIN, XMAS Scans#

Terminal window
nmap -sN target.com # NULL scan
nmap -sF target.com # FIN scan
nmap -sX target.com # XMAS scan

Bypass some legacy firewalls that only monitor SYN packets.

Host Discovery (Ping Sweeps)#

Terminal window
nmap -sn 192.168.1.0/24
nmap -Pn target.com # skip ping if ICMP blocked

Use multiple probes if ICMP is blocked:

Terminal window
nmap -PE -PP -PM -PS22,80,443 -PA80,443 10.10.10.0/24

Service Enumeration (High-Value Ports)#

HTTP / HTTPS (80, 443, 8080, 8443)#

Terminal window
whatweb target.com
nikto -h target.com
gobuster dir -u http://target.com -w wordlist.txt

Check titles, frameworks, and hidden endpoints.

SSH (22)#

Terminal window
nmap -p22 --script ssh2-enum-algos target.com
nmap --script ssh-auth-methods target.com

SMB (445)#

Terminal window
nmap --script smb-enum-* -p445 target.com
enum4linux -a target.com
smbclient -L target.com -U guest%

DNS (53)#

Terminal window
dig A target.com
nslookup target.com
dnsenum target.com

FTP (21)#

Terminal window
nmap -p21 --script ftp-anon,ftp-syst target.com

SMTP (25, 587)#

Terminal window
nmap -p25,587 --script smtp-enum-users target.com

SNMP (161)#

Terminal window
nmap -sU -p161 --script snmp-info target.com
snmpwalk -v2c -c public target.com

RDP (3389)#

Terminal window
nmap -p3389 --script rdp-enum-encryption target.com

Advanced Techniques#

Operating System Detection#

Terminal window
nmap -O target.com

NSE Scripts (Targeted Checks)#

Terminal window
nmap --script vuln target.com
nmap --script default,safe -sV target.com

Firewall Evasion#

Terminal window
nmap -f target.com # fragment packets
nmap -D RND:10 target.com # decoy scan
nmap --source-port 53 target.com # source port spoofing

Timing and Performance#

Terminal window
nmap -T5 target.com # fastest
nmap -T0 target.com # slowest

Practical Tips#

1. Always Confirm Host is Up#

Terminal window
nmap -sn 192.168.1.0/24
nmap -Pn target.com

2. Save Results for Reporting#

Terminal window
nmap -oA scan_results target.com
nmap -oX results.xml target.com
nmap -oG results.gnmap target.com

3. Scan Specific Ranges#

Terminal window
nmap -p80 target.com
nmap --top-ports 100 target.com
nmap -p1-1000,3000-4000 target.com

Real-World Scenarios#

Scenario 1: Web Application Assessment#

Terminal window
nmap -p80,443,8080,8443 -sV target.com
whatweb target.com
gobuster dir -u http://target.com -w wordlist.txt

Scenario 2: Internal Network Mapping#

Terminal window
nmap -sn 192.168.1.0/24
nmap -p- -sV -sC 192.168.1.100

Scenario 3: Firewall Testing#

Terminal window
nmap -f -D RND:5 -sS target.com
nmap -Pn -sV --script firewall-bypass target.com

Common Mistakes#

  • Scanning too aggressively and causing outages
  • Ignoring UDP services
  • Skipping version detection
  • Trusting a single tool output
  • Not documenting evidence and timestamps

Countermeasures and Defense#

Network Level#

  • Firewalls with least exposure
  • IDS/IPS to detect scan patterns
  • Segmentation of critical systems

Host Level#

  • Local firewall rules
  • Disable unused services
  • Patch vulnerable services

Monitoring#

Terminal window
# Detect scanning attempts
tcpdump -n -nn -s 0 -X -i eth0 port 80
# Monitor half-open connections
netstat -ant | grep SYN_RECV

Automated Reconnaissance#

Multi-Tool Script (Baseline)#

#!/bin/bash
TARGET=$1
# Nmap scan
nmap -sCV -oA ${TARGET}_nmap $TARGET
# Web enumeration
nikto -h $TARGET -output ${TARGET}_nikto.txt
# Directory brute force
gobuster dir -u http://$TARGET -w /usr/share/wordlists/dirb/common.txt -o ${TARGET}_dirs.txt
# DNS enumeration
dig +short ANY $TARGET > ${TARGET}_dns.txt

Clean Reporting Notes#

Always record:

  • Timestamp and scan scope
  • Command used and parameters
  • IPs, ports, services, versions
  • Screenshots or logs as evidence

Summary#

Effective network scanning combines the right tools, techniques, and interpretation skills. Always remember:

  • Get permission before scanning
  • Start with discovery, then deepen
  • Validate findings with multiple tools
  • Document everything clearly

Simple Advice

Start slow with basic scans, then increase depth based on findings. Never skip service version detection, it often unlocks the next step.

X : http://x.com/cat0x01
github : http://github.com/cat0x01