Network Discovery and Host Enumeration
Table of Contents
- Network Discovery Overview
- Network Discovery Techniques
- Host Discovery Workflow
- Masscan Deep Dive
- fping Deep Dive
- Nmap Host Discovery Flags
- Dealing with Firewalls
- ARP Scanning on Local Networks
- Discovery in OSCP Lab Environment
- Documenting Discovered Hosts
- OSCP Exam Tips
- Attack Chain Position
1. Network Discovery Overview
What is Network Discovery?
Network Discovery (also called Host Discovery or Ping Sweeping) is the process of identifying which hosts are alive and reachable on a target network. It is the first step in any penetration test and forms the foundation for all subsequent scanning and enumeration activities.
Why Network Discovery Matters
┌─────────────────────────────────────────────────────────────┐
│ Why Network Discovery is Critical │
├─────────────────────────────────────────────────────────────┤
│ │
│ • Saves Time: Don't waste time scanning dead hosts │
│ • Maps Attack Surface: Know what you're up against │
│ • Identifies Targets: Find the machines to exploit │
│ • Network Topology: Understand the network layout │
│ • Firewall Detection: Discover filtering behaviors │
│ • Report Requirements: OSCP reports need evidence │
│ │
└─────────────────────────────────────────────────────────────┘
Discovery vs. Scanning
| Aspect | Discovery | Scanning |
|---|---|---|
| Goal | Find live hosts | Find open ports/services |
| Scope | Entire subnet/network | Individual hosts |
| Speed | Fast (seconds per host) | Slower (minutes per host) |
| Tools | ping, fping, arp-scan, nmap -sn | nmap, masscan, rustscan |
| Output | List of live IPs | List of open ports/services |
| Order | First | Second |
2. Network Discovery Techniques
2.1 ICMP Ping (Echo Request)
The most common and straightforward discovery method. Sends ICMP Echo Request packets and waits for Echo Reply.
How It Works
Scanner Target
│ │
│─── [ICMP Echo Request] ───────▶│ Type 8, Code 0
│ │
│◀─── [ICMP Echo Reply] ─────────│ Type 0, Code 0
│ │
Result: Host is UP │
Scanner Target
│ │
│─── [ICMP Echo Request] ───────▶│ Type 8, Code 0
│ │
│ (No Response) │ Host down OR ICMP blocked
│ │
Result: Host is DOWN or FILTERED│
Commands
# Single host ping
ping -c 1 192.168.1.100
# Nmap ICMP discovery
nmap -PE 192.168.1.0/24
# fping entire subnet
fping -g 192.168.1.0/24 2>/dev/null
# ping sweep with bash
for ip in 192.168.1.{1..254}; do ping -c 1 -W 1 $ip && echo "$ip is up"; done
Pros and Cons
| Pros | Cons |
|---|---|
| Simple and fast | Often blocked by firewalls |
| Works across subnets | Some hosts don’t respond to ICMP |
| Standard method | Can be detected by IDS/IPS |
2.2 ARP Scan
Address Resolution Protocol (ARP) is used to map IP addresses to MAC addresses on local networks only.
How It Works
Scanner Target
│ │
│─── [ARP Who has 192.168.1.100?]─▶│ ARP Request (broadcast)
│ │
│◀─── [I am 192.168.1.100] ──────│ ARP Reply (unicast)
│ [MAC: aa:bb:cc:dd:ee:ff] │
│ │
Result: Host is UP + MAC known │
Commands
# arp-scan tool
arp-scan --localnet
arp-scan --interface=eth0 192.168.1.0/24
arp-scan --localnet --resolve
# Nmap ARP discovery
nmap -PR 192.168.1.0/24
# Using ip neigh (Linux)
arping -c 1 -I eth0 192.168.1.100
Pros and Cons
| Pros | Cons |
|---|---|
| Cannot be blocked by IP firewalls | Local network only (Layer 2) |
| Very reliable | Requires layer 2 access |
| Returns MAC address | Won’t work across routers |
| Fast |
2.3 TCP SYN Probe
Sends a TCP SYN packet to a specific port. If the host responds with SYN-ACK (open) or RST (closed), the host is alive.
How It Works
Scanner Target
│ │
│─── [SYN] port 80 ─────────────▶│
│ │
│◀─── [SYN-ACK] or [RST] ────────│ Any response = host is UP
│ │
Result: Host is UP │
Commands
# Nmap TCP SYN discovery on port 80
nmap -PS80 192.168.1.0/24
# Multiple ports
nmap -PS22,80,443,8080 192.168.1.0/24
# All common ports
nmap -PS 192.168.1.0/24
Pros and Cons
| Pros | Cons |
|---|---|
| Works across subnets | May be blocked by firewalls |
| Can target specific ports | Slightly slower than ICMP |
| Often works when ICMP is blocked | Requires knowing which ports to probe |
2.4 TCP ACK Probe
Sends a TCP ACK packet. Any RST response indicates the host is alive and the port is unfiltered.
How It Works
Scanner Target
│ │
│─── [ACK] port 80 ─────────────▶│ Pretend connection exists
│ │
│◀─── [RST] ─────────────────────│ RST = host is UP, port unfiltered
│ │
Result: Host is UP │
Commands
# Nmap TCP ACK discovery
nmap -PA80 192.168.1.0/24
# Multiple ports
nmap -PA22,80,443 192.168.1.0/24
Pros and Cons
| Pros | Cons |
|---|---|
| Bypasses some firewalls | Cannot distinguish open vs closed |
| Works against stateless firewalls | Only tells filtered vs unfiltered |
| Good for firewall mapping |
2.5 UDP Probe
Sends UDP packets to specific ports. ICMP Port Unreachable responses indicate the host is alive.
How It Works
Scanner Target
│ │
│─── [UDP] port 161 ────────────▶│ SNMP probe
│ │
│◀─── [ICMP Port Unreachable] ───│ Host is UP, port closed
│ │
Result: Host is UP │
Commands
# Nmap UDP discovery on port 161 (SNMP)
nmap -PU161 192.168.1.0/24
# Multiple UDP ports
nmap -PU53,161,162 192.168.1.0/24
Pros and Cons
| Pros | Cons |
|---|---|
| Works when TCP is blocked | Very slow |
| Good for UDP-centric networks | Unreliable (ICMP may be rate-limited) |
| Often overlooked by defenders |
2.6 ICMP Timestamp
Sends ICMP Timestamp Request packets. A Timestamp Reply indicates the host is alive.
How It Works
Scanner Target
│ │
│─── [ICMP Timestamp Request] ──▶│ Type 13, Code 0
│ │
│◀─── [ICMP Timestamp Reply] ────│ Type 14, Code 0
│ │
Result: Host is UP │
Commands
# Nmap ICMP timestamp discovery
nmap -PP 192.168.1.0/24
2.7 ICMP Netmask
Sends ICMP Netmask Request packets. A Netmask Reply indicates the host is alive.
How It Works
Scanner Target
│ │
│─── [ICMP Netmask Request] ────▶│ Type 17, Code 0
│ │
│◀─── [ICMP Netmask Reply] ──────│ Type 18, Code 0
│ │
Result: Host is UP │
Commands
# Nmap ICMP netmask discovery
nmap -PM 192.168.1.0/24
Discovery Techniques Comparison Table
| Technique | Protocol | Cross-Subnet | Firewall-Bypass | Speed | Reliability | OSCP Priority |
|---|---|---|---|---|---|---|
| ICMP Ping | ICMP | Yes | Low | Fast | Medium | High |
| ARP Scan | ARP | No | High | Fast | Very High | High (local) |
| TCP SYN | TCP | Yes | Medium | Medium | High | High |
| TCP ACK | TCP | Yes | Medium | Medium | Medium | Medium |
| UDP Probe | UDP | Yes | Medium | Slow | Low | Medium |
| ICMP Timestamp | ICMP | Yes | Low | Fast | Low | Low |
| ICMP Netmask | ICMP | Yes | Low | Fast | Very Low | Low |
3. Host Discovery Workflow
Recommended Discovery Process
flowchart TD
A[Start: Target Subnet Identified] --> B{Local Network?}
B -->|Yes| C[ARP Scan First<br/>arp-scan / nmap -PR]
B -->|No| D[ICMP Ping Sweep<br/>nmap -PE / fping]
C --> E{Hosts Found?}
D --> E
E -->|Yes| F[Proceed to Port Scanning]
E -->|No| G{Try TCP SYN Probe<br/>nmap -PS22,80,443}
G --> H{Hosts Found?}
H -->|Yes| F
H -->|No| I{Try TCP ACK Probe<br/>nmap -PA22,80,443}
I --> J{Hosts Found?}
J -->|Yes| F
J -->|No| K{Try UDP Probe<br/>nmap -PU161,53}
K --> L{Hosts Found?}
L -->|Yes| F
L -->|No| M[Skip Discovery<br/>nmap -Pn (assume all up)]
M --> F
style A fill:#e3f2fd
style F fill:#c8e6c9
style M fill:#fff9c4
Step-by-Step Discovery Process
# Step 1: ARP scan (if on local network)
arp-scan --localnet --resolve
# Step 2: ICMP ping sweep
nmap -sn -PE 192.168.1.0/24 -oN discovery_icmp.txt
# Step 3: If no results, try TCP SYN
nmap -sn -PS22,80,443,8080 192.168.1.0/24 -oN discovery_tcp_syn.txt
# Step 4: If still no results, try TCP ACK
nmap -sn -PA22,80,443 192.168.1.0/24 -oN discovery_tcp_ack.txt
# Step 5: If still no results, skip discovery
nmap -Pn -sS --top-ports 1000 192.168.1.0/24 -oN discovery_skipped.txt
4. Masscan Deep Dive
What is Masscan?
Masscan is the world’s fastest internet port scanner. It can scan the entire internet in under 6 minutes, sending up to 10 million packets per second. Unlike Nmap, Masscan is asynchronous — it doesn’t wait for responses before sending the next packet.
Masscan vs. Nmap
| Feature | Masscan | Nmap |
|---|---|---|
| Speed | Extremely fast (10M pps) | Moderate |
| Scanning Method | Asynchronous | Synchronous |
| Port Scanning | Excellent | Excellent |
| Service Detection | Limited (-sV basic) | Comprehensive |
| OS Detection | No | Yes |
| NSE Scripts | No | Yes |
| UDP Scanning | Yes | Yes |
| Best For | Wide port scans, large networks | Detailed enumeration |
| Accuracy | May have false positives | Very accurate |
Installation
# Kali Linux (pre-installed)
masscan --version
# Ubuntu/Debian
sudo apt install masscan
# From source
git clone https://github.com/robertdavidgraham/masscan.git
cd masscan
sudo make
Masscan Commands
# Basic scan of common ports
masscan 192.168.1.100 -p 1-1000
# Scan all ports on a single host
masscan 192.168.1.100 -p 1-65535
# Scan all ports on a subnet
masscan 192.168.1.0/24 -p 1-65535
# Scan specific ports
masscan 192.168.1.100 -p 22,80,443,3306,8080,3389
# Rate control (packets per second)
masscan 192.168.1.0/24 -p 1-65535 --rate 1000
# High rate scan
masscan 192.168.1.0/24 -p 1-65535 --rate 100000
# Output to file
masscan 192.168.1.100 -p 1-65535 -oL masscan_results.txt
# Output in grepable format
masscan 192.168.1.100 -p 1-65535 -oG masscan_results.gnmap
# Exclude specific hosts
masscan 192.168.1.0/24 -p 1-65535 --exclude 192.168.1.1
# UDP scan
masscan 192.168.1.100 -p U:53,161,162 --rate 1000
# Service version detection (basic)
masscan 192.168.1.100 -p 80,443 --banners
# Custom source port
masscan 192.168.1.100 -p 1-65535 --source-port 53
Piping Masscan Results to Nmap
This is the most powerful combination — use Masscan for speed, then Nmap for detail.
# Method 1: Pipe Masscan output to Nmap
masscan 192.168.1.0/24 -p 1-65535 --rate 10000 | grep -oP '\d+\.\d+\.\d+\.\d+' | sort -u | xargs -I {} nmap -sV -T4 -p- {}
# Method 2: Save Masscan results, then scan with Nmap
masscan 192.168.1.100 -p 1-65535 -oL masscan_open.txt
# Extract open ports from Masscan output
cat masscan_open.txt | awk '{print $4}' | tr -d '/' | tr '\n' ',' | sed 's/,$//'
# Use the ports in Nmap
nmap -sV -sS -p 22,80,443,3306,8080 192.168.1.100
# Method 3: One-liner with nmap's --port-ratio
masscan 192.168.1.100 -p 1-65535 --rate 50000 -oL quick_scan.txt
nmap -sV -O -iL <(awk '{print $4}' quick_scan.txt | grep -oP '\d+\.\d+\.\d+\.\d+') -T4
# Method 4: Using masscan's open port list with nmap
masscan -iL targets.txt -p1-65535 --rate 10000 -oL masscan_output.txt
nmap -sV -Pn -iL targets.txt -p <PORTS_FROM_MASSCAN> -oN detailed_scan.txt
Masscan Rate Control
# Conservative rate (good for OSCP lab)
masscan 192.168.1.0/24 -p 1-65535 --rate 1000
# Moderate rate
masscan 192.168.1.0/24 -p 1-65535 --rate 10000
# Aggressive rate
masscan 192.168.1.0/24 -p 1-65535 --rate 100000
# Maximum rate (local network)
masscan 192.168.1.0/24 -p 1-65535 --rate 1000000
Masscan Output Format
Starting masscan 1.3.2 (http://bit.ly/1tsGCMg) at 2026-09-01 10:00:00 GMT
-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 256 hosts [65535 ports/host]
discovered open port 80/tcp on 192.168.1.100
discovered open port 22/tcp on 192.168.1.100
discovered open port 443/tcp on 192.168.1.100
discovered open port 3306/tcp on 192.168.1.100
discovered open port 8080/tcp on 192.168.1.100
5. fping Deep Dive
What is fping?
fping is a program to send ICMP echo probes to network hosts, similar to ping. Unlike ping, fping is designed to be scriptable and can probe multiple hosts simultaneously. It is the engine behind Nmap’s ping scan.
Installation
# Kali Linux (pre-installed)
fping --version
# Ubuntu/Debian
sudo apt install fping
fping Commands
# Ping a single host
fping 192.168.1.100
# Ping multiple hosts
fping 192.168.1.100 192.168.1.101 192.168.1.102
# Ping an entire subnet
fping -g 192.168.1.0/24
# Ping with count and interval
fping -c 3 -i 100 192.168.1.100
# Quiet mode (only show reachable hosts)
fping -q -g 192.168.1.0/24
# Very quiet (only unreachable hosts)
fping -q -u -g 192.168.1.0/24
# Set timeout
fping -t 1000 -g 192.168.1.0/24
# Retry failed hosts
fping -r 3 -g 192.168.1.0/24
# Output to file
fping -g 192.168.1.0/24 > alive_hosts.txt 2>/dev/null
# Read targets from file
fping -f targets.txt
# Average round-trip time
fping -a -g 192.168.1.0/24
# Unreachable hosts only
fping -u -g 192.168.1.0/24
fping Options Reference
| Option | Description | Example |
|---|---|---|
-a |
Show reachable hosts | fping -a -g 192.168.1.0/24 |
-u |
Show unreachable hosts | fping -u -g 192.168.1.0/24 |
-g |
Generate target list (subnet) | fping -g 192.168.1.0/24 |
-c count |
Count of probes to send | fping -c 3 192.168.1.100 |
-i interval |
Interval between probes (ms) | fping -i 100 -g 192.168.1.0/24 |
-p period |
Period between probe rounds (ms) | fping -p 500 192.168.1.100 |
-r retries |
Retry count for unreachable | fping -r 3 -g 192.168.1.0/24 |
-t timeout |
Individual host timeout (ms) | fping -t 2000 -g 192.168.1.0/24 |
-q |
Quiet mode | fping -q -g 192.168.1.0/24 |
-f file |
Read targets from file | fping -f targets.txt |
-D |
Show timestamp in output | fping -D -g 192.168.1.0/24 |
-S src |
Source address | fping -S 192.168.1.1 -g 192.168.1.0/24 |
-C count |
Comma-separated output | fping -C 5 -g 192.168.1.0/24 |
-l |
Loop mode (continuous) | fping -l 192.168.1.100 |
Subnet Scanning with fping
# /24 subnet
fping -g 192.168.1.0/24
# /24 subnet, show only alive hosts
fping -a -g 192.168.1.0/24
# /24 subnet, quiet mode
fping -q -a -g 192.168.1.0/24
# /16 subnet (large — use with caution)
fping -g 192.168.0.0/16
# /24 subnet with retries
fping -r 2 -g 192.168.1.0/24
# /24 subnet with custom interval
fping -i 50 -g 192.168.1.0/24
File-Based Scanning
# Create a target list
echo -e "192.168.1.100\n192.168.1.101\n192.168.1.102" > targets.txt
# Scan from file
fping -f targets.txt
# Scan from file, show only alive
fping -a -f targets.txt
# Scan from file, save results
fping -a -f targets.txt > alive_hosts.txt
fping vs. ping Comparison
| Feature | fping | ping |
|---|---|---|
| Multiple hosts | Yes | No |
| Subnet scanning | Yes (-g) | No |
| File input | Yes (-f) | No |
| Scriptable | Yes | Limited |
| Speed | Very fast | Slow (sequential) |
| Output formats | Multiple | Standard |
| Best for | Network sweeps | Single host testing |
6. Nmap Host Discovery Flags
Deep Dive into Discovery Flags
-sn (Ping Scan)
Performs discovery only, no port scanning
# Default discovery (ICMP + TCP + ARP)
nmap -sn 192.168.1.0/24
# Equivalent to:
nmap -sn --system-dns -R 192.168.1.0/24
-PS (TCP SYN Discovery)
# SYN probe on port 80
nmap -PS80 192.168.1.0/24
# SYN probe on multiple ports
nmap -PS22,80,443,8080,3389 192.168.1.0/24
# SYN probe on all ports (comprehensive)
nmap -PS 192.168.1.0/24
-PA (TCP ACK Discovery)
# ACK probe on port 80
nmap -PA80 192.168.1.0/24
# ACK probe on multiple ports
nmap -PA22,80,443 192.168.1.0/24
-PU (UDP Discovery)
# UDP probe on port 161 (SNMP)
nmap -PU161 192.168.1.0/24
# UDP probe on multiple ports
nmap -PU53,161,162,137,138 192.168.1.0/24
-PE (ICMP Echo Discovery)
# ICMP echo request
nmap -PE 192.168.1.0/24
-PP (ICMP Timestamp Discovery)
# ICMP timestamp request
nmap -PP 192.168.1.0/24
-PM (ICMP Netmask Discovery)
# ICMP netmask request
nmap -PM 192.168.1.0/24
-PO (IP Protocol Discovery)
# IP protocol probe (ICMP, IGMP, TCP, UDP)
nmap -PO 192.168.1.0/24
# Specific protocols
nmap -PO1,2,6,17 192.168.1.0/24
-PR (ARP Discovery)
# ARP discovery (local network only)
nmap -PR 192.168.1.0/24
Combining Discovery Techniques
# Combine ICMP echo + TCP SYN + UDP
nmap -PE -PS22,80 -PU53 192.168.1.0/24
# Combine all ICMP types
nmap -PE -PP -PM 192.168.1.0/24
# Maximum discovery (all methods)
nmap -PE -PP -PM -PS22,80,443 -PA22,80,443 -PU53,161 -PO 192.168.1.0/24
# Local network with ARP
nmap -PR -PE 192.168.1.0/24
–send-ip and -n Flags
–send-ip (Send Packets as IP Packets)
Bypasses ARP resolution and sends packets directly as IP packets. Useful when ARP is not working or when scanning across subnets.
# Send as IP packets (no ARP)
nmap --send-ip 192.168.1.0/24
# Combine with other options
nmap --send-ip -sS -T4 --top-ports 1000 192.168.1.0/24
-n (Never Resolve DNS)
Skips DNS resolution for faster scanning.
# No DNS resolution
nmap -n 192.168.1.0/24
# Combine with scan
nmap -n -sS -T4 --top-ports 1000 192.168.1.0/24
# Force DNS resolution (opposite)
nmap -R 192.168.1.0/24
Discovery Flags Summary Table
| Flag | Protocol | Type | Cross-Subnet | Best For |
|---|---|---|---|---|
-sn |
Multiple | Discovery only | Yes | Quick host list |
-PS |
TCP SYN | Port probe | Yes | When ICMP blocked |
-PA |
TCP ACK | Port probe | Yes | Firewall mapping |
-PU |
UDP | Port probe | Yes | UDP-centric networks |
-PE |
ICMP Echo | Echo request | Yes | Default discovery |
-PP |
ICMP Timestamp | Timestamp | Yes | Alternative to echo |
-PM |
ICMP Netmask | Netmask | Yes | Alternative to echo |
-PO |
IP Protocol | Protocol probe | Yes | Protocol discovery |
-PR |
ARP | ARP request | No | Local network |
-Pn |
N/A | Skip discovery | Yes | When all else fails |
--send-ip |
IP | Bypass ARP | Yes | No ARP environment |
-n |
N/A | No DNS | Yes | Faster scanning |
7. Dealing with Firewalls During Discovery
Firewall Behavior During Discovery
┌─────────────────────────────────────────────────────────────┐
│ Firewall Response Types │
├─────────────────────────────────────────────────────────────┤
│ │
│ DROP (Silent): Packet is silently discarded │
│ → No response → Host appears DOWN │
│ │
│ REJECT (Active): Packet is rejected with error │
│ → ICMP unreachable → Host appears UP (port closed) │
│ │
│ STATEFUL: Tracks connection state │
│ → Only allows expected responses │
│ │
│ STATELESS: No connection tracking │
│ → Easier to bypass with flag manipulation │
│ │
└─────────────────────────────────────────────────────────────┘
Strategies for Firewall Evasion During Discovery
Strategy 1: Multiple Probe Types
# Try different probe types to find what gets through
nmap -PE 192.168.1.0/24 # ICMP echo
nmap -PS22,80,443 192.168.1.0/24 # TCP SYN
nmap -PA22,80,443 192.168.1.0/24 # TCP ACK
nmap -PU53,161 192.168.1.0/24 # UDP
Strategy 2: Skip Discovery Entirely
# Assume all hosts are up and scan anyway
nmap -Pn -sS --top-ports 1000 192.168.1.0/24
# This is often the best approach on OSCP
nmap -Pn -sS -T4 -p- 192.168.1.100
Strategy 3: Fragmented Packets
# Fragment packets to bypass simple firewalls
nmap -f -PE 192.168.1.0/24
# Custom MTU
nmap -f --mtu 8 -PE 192.168.1.0/24
Strategy 4: Decoy Scans
# Use decoys to confuse the firewall
nmap -D RND:10 -PE 192.168.1.0/24
Strategy 5: Timing Adjustment
# Slow down to avoid rate limiting
nmap -T2 -PE 192.168.1.0/24
nmap -T1 -PE 192.168.1.0/24
Firewall Detection with ACK Scan
# ACK scan to determine firewall behavior
nmap -sA 192.168.1.100
# If all ports show FILTERED → stateful firewall
# If all ports show UNFILTERED → no firewall or stateless
# If mixed → selective firewall rules
8. ARP Scanning on Local Networks
Why ARP Scanning is Powerful
ARP operates at Layer 2 (Data Link Layer) and cannot be blocked by IP-based firewalls. It is the most reliable discovery method on local networks.
ARP Scan Commands
# Scan entire local network
arp-scan --localnet
# Scan with hostname resolution
arp-scan --localnet --resolve
# Scan specific subnet
arp-scan --interface=eth0 192.168.1.0/24
# Quiet output (just MAC and IP)
arp-scan --localnet --quiet
# Output to file
arp-scan --localnet -oF arp_results.txt
# Ignore ARP cache
arp-scan --localnet --unresolved
# Custom retry and wait
arp-scan --localnet --retry=2 --wait=500
Interpreting ARP Scan Output
Beginning scan at 2026-09-01 10:00:00 UTC
ARP probing 254 hosts on 192.168.1.0/24 ...
192.168.1.1 aa:bb:cc:dd:ee:01 (null)
192.168.1.100 aa:bb:cc:dd:ee:64 (null)
192.168.1.101 aa:bb:cc:dd:ee:65 (null)
192.168.1.200 aa:bb:cc:dd:ee:c8 (null)
4 hosts completed in 2.1 seconds
254 packets received
0 packets lost (0.00% packet loss, 0.00% speculatively lost)
MAC Address Vendor Lookup
# Use macchanger to look up vendor
macchanger -p eth0
# Use arp-scan with vendor info
arp-scan --localnet --resolve --hardware
# Online MAC lookup
# Visit: https://www.wireshark.org/tools/oui-lookup.html
Common MAC Address OUI Patterns
| OUI Prefix | Vendor | Significance |
|---|---|---|
00:0c:29 |
VMware | Virtual machine |
08:00:27 |
VirtualBox | Virtual machine |
00:50:56 |
VMware | Virtual machine |
52:54:00 |
QEMU/KVM | Virtual machine |
00:1c:14 |
QEMU | Virtual machine |
OSCP Tip: If you see VMware/VirtualBox MAC addresses, you’re on a virtualized network — common in OSCP labs.
9. Discovery in OSCP Lab Environment
OSCP Lab Network Characteristics
┌─────────────────────────────────────────────────────────────┐
│ OSCP Lab Network Characteristics │
├─────────────────────────────────────────────────────────────┤
│ │
│ • You are assigned a specific IP address │
│ • Target machines are on the same subnet │
│ • ICMP may or may not be blocked │
│ • Some machines may have aggressive firewall rules │
│ • Network is typically a /24 subnet │
│ • You should ONLY scan your assigned range │
│ • Scanning outside your range can get you banned │
│ │
└─────────────────────────────────────────────────────────────┘
OSCP Discovery Workflow
# Step 1: Note your assigned IP and target range
# Example: Your IP: 192.168.1.50, Target: 192.168.1.100
# Step 2: ARP scan (you're on the same subnet)
arp-scan --localnet --resolve
# Step 3: Nmap ping scan on target
nmap -sn 192.168.1.100
# Step 4: If no response, skip discovery
nmap -Pn -sS -T4 --top-ports 1000 192.168.1.100
# Step 5: Full enumeration
nmap -Pn -sS -sV -O -T4 -p- 192.168.1.100
OSCP-Specific Discovery Commands
# The OSCP discovery one-liner
nmap -Pn -sS -T4 --top-ports 1000 -oN oscp_discovery.txt <TARGET_IP>
# If you have a range of targets
nmap -Pn -sS -T4 --top-ports 1000 -oN oscp_discovery.txt 192.168.1.100-200
# Quick check if target is alive
nmap -sn -PE -PS22,80,443 <TARGET_IP>
# When everything is blocked
nmap -Pn -sT -T4 --top-ports 1000 <TARGET_IP>
10. Documenting Discovered Hosts
Why Documentation Matters
For the OSCP exam, you must document your enumeration process. Your report needs evidence of thorough discovery.
Documentation Template
## Network Discovery
### Target Information
- Target IP: 192.168.1.100
- Subnet: 192.168.1.0/24
- My IP: 192.168.1.50
### Discovery Commands Used
1. ARP Scan: `arp-scan --localnet`
2. ICMP Ping: `nmap -sn 192.168.1.100`
3. TCP SYN Probe: `nmap -PS22,80,443 192.168.1.100`
### Results
- Host 192.168.1.100: UP (responded to ARP and ICMP)
- MAC Address: aa:bb:cc:dd:ee:64
- Vendor: VMware (virtual machine)
### Evidence
[Attach nmap output screenshots]
[Attach arp-scan output]
Automated Documentation Script
#!/bin/bash
# oscp_discovery_doc.sh
TARGET=$1
OUTPUT="discovery_report_$(date +%Y%m%d_%H%M%S).txt"
echo "=== Network Discovery Report ===" > $OUTPUT
echo "Target: $TARGET" >> $OUTPUT
echo "Date: $(date)" >> $OUTPUT
echo "" >> $OUTPUT
echo "--- ARP Scan ---" >> $OUTPUT
arp-scan --localnet --resolve >> $OUTPUT 2>&1
echo "" >> $OUTPUT
echo "--- Nmap Ping Scan ---" >> $OUTPUT
nmap -sn $TARGET >> $OUTPUT 2>&1
echo "" >> $OUTPUT
echo "--- Nmap TCP SYN Discovery ---" >> $OUTPUT
nmap -PS22,80,443 $TARGET >> $OUTPUT 2>&1
echo "" >> $OUTPUT
echo "Report saved to: $OUTPUT"
11. OSCP Exam Tips
Critical Discovery Tips
┌─────────────────────────────────────────────────────────────────┐
│ OSCP Network Discovery Exam Tips │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. ALWAYS start with ARP scan — you're on the same subnet │
│ and it's the most reliable method │
│ │
│ 2. If ARP doesn't work, use -Pn (skip discovery) — don't │
│ waste time trying to discover a host you already know exists│
│ │
│ 3. On OSCP, you're given specific target IPs — you don't │
│ need to scan the entire subnet for hosts │
│ │
│ 4. Use -Pn liberally — many OSCP machines block ICMP │
│ and discovery probes, but -Pn lets you scan anyway │
│ │
│ 5. Document your discovery process — your report needs │
│ evidence of thorough enumeration │
│ │
│ 6. Don't scan outside your assigned range — this can result │
│ in a ban from the lab │
│ │
│ 7. Masscan is great for quick all-port scans, but always │
│ follow up with Nmap for service details │
│ │
│ 8. fping is faster than nmap -sn for large subnets │
│ │
│ 9. Combine discovery methods if one fails — don't give up │
│ after ICMP is blocked │
│ │
│ 10. Save all output with timestamps — needed for your report │
│ │
└─────────────────────────────────────────────────────────────────┘
Time-Saving Discovery Commands
# Fastest discovery (when you know the IP)
nmap -Pn -sS -T4 --top-ports 1000 <TARGET_IP>
# Quick all-port scan with Masscan
masscan <TARGET_IP> -p 1-65535 --rate 10000
# Follow up with Nmap on open ports
nmap -sV -Pn -p <PORTS> <TARGET_IP>
# Complete discovery + scan
nmap -Pn -sS -sV -O -T4 -p- --script=safe -oA full_enum <TARGET_IP>
12. Attack Chain Position
Where Discovery Fits in the Attack Chain
flowchart LR
A[Reconnaissance<br/>Passive] --> B[Network Discovery<br/>Host Finding]
B --> C[Port Scanning<br/>Service Finding]
C --> D[Enumeration<br/>Service Details]
D --> E[Vulnerability<br/>Analysis]
E --> F[Exploitation<br/>Gaining Access]
F --> G[Post-Exploitation<br/>Privilege Escalation]
style B fill:#4CAF50, color:white
Discovery Tools in the Attack Chain
| Phase | Tool | Purpose |
|---|---|---|
| Discovery | arp-scan | Find live hosts on local network |
| Discovery | fping | Fast ping sweep of subnets |
| Discovery | Nmap -sn | Host discovery with multiple methods |
| Discovery | Masscan | Rapid port discovery across many hosts |
| Scanning | Nmap -sS | Detailed port scanning |
| Enumeration | Nmap -sV | Service version detection |
| Enumeration | Nmap NSE | Advanced service enumeration |
Discovery as a Continuous Process
Discovery is not a one-time activity. Throughout the engagement:
Initial Discovery → Port Scanning → Find New Subnet → Discovery Again
↓ ↓ ↓
Live hosts Open ports New targets
↓ ↓ ↓
Port scan Exploit Repeat cycle
Quick Reference Card
Most Used Discovery Commands for OSCP
# 1. ARP scan (local network)
arp-scan --localnet --resolve
# 2. Nmap ping scan
nmap -sn 192.168.1.0/24
# 3. Skip discovery (most reliable on OSCP)
nmap -Pn -sS -T4 --top-ports 1000 <TARGET_IP>
# 4. Masscan all ports
masscan <TARGET_IP> -p 1-65535 --rate 10000
# 5. fping subnet
fping -a -g 192.168.1.0/24
# 6. TCP SYN discovery (when ICMP blocked)
nmap -PS22,80,443 192.168.1.0/24
Discovery Method Decision Tree
Can you ARP? → Yes → Use arp-scan
↓ No
ICMP working? → Yes → Use nmap -PE / fping
↓ No
TCP reachable? → Yes → Use nmap -PS22,80,443
↓ No
Skip discovery → Use nmap -Pn
Master network discovery to build a solid foundation for your OSCP engagements. Every successful exploit starts with knowing what you’re attacking.