Techniques for identifying active systems.
Perform a basic host discovery scan across a subnet and extract live hosts:
nmap -sn $RHOST/24 -oG - | awk '/Up$/{print $2}' > output.scan
-sn disables port scanning and performs host discovery onlyoutput.scan/24 for 256 hosts, /16 for 65,536 hosts)Scan specific IP range:
nmap -sn 192.168.1.1-254 -oG - | awk '/Up$/{print $2}' > output.scan
When ICMP is blocked, use TCP SYN or ACK probes against common ports to identify live hosts:
nmap -sn -PS22,80,443 $RHOST/24
nmap -sn -PA80,443 $RHOST/24
-PS TCP SYN probe-PA TCP ACK probeUDP-based host discovery:
nmap -sn -PU53,161 $RHOST/24
-PU UDP probeUse different ICMP message types when standard ping is blocked:
nmap -sn -PP $RHOST/24 # ICMP timestamp request
nmap -sn -PM $RHOST/24 # ICMP address mask request
Fast parallel ping tool for host discovery:
fping -a -g $RHOST/24 2>/dev/null
-a show only alive hosts-g generate target list from network rangeScan from file:
fping -a < hosts.txt
Advanced packet crafting tool for custom probes:
hping3 -1 $RHOST # ICMP ping
hping3 -S -p 80 $RHOST # TCP SYN to port 80
hping3 -2 -p 161 $RHOST # UDP to port 161
-1 ICMP mode-S SYN flag-2 UDP modeUltra-fast host discovery and port scanning:
masscan $RHOST/24 -p0 --rate=1000
-p0 ping scan (host discovery only)--rate packets per second (adjust based on network)Passive and active ARP-based host discovery. Useful when ICMP is blocked, but requires being on the same L2 segment:
sudo netdiscover -i eth0
Active scan:
sudo netdiscover -r $RHOST/24 -i eth0
Passive scan (stealth):
sudo netdiscover -p -i eth0
Change
eth0with your network interface usingifconfigorip addr
Actively enumerate hosts on the local network using ARP requests and bypass ICMP restrictions:
arp-scan -l
Scan specific network:
arp-scan $RHOST/24
Interface selection:
arp-scan -I eth0 -l
nmap -6 -sn $RHOSTv6/64
-6 enable IPv6 scanning/64 for subnets)ping6 -c 3 $RHOSTv6
Passive discovery techniques listen to network traffic without sending probes:
Monitor network traffic for host activity:
sudo tcpdump -i eth0 -n 'arp or icmp'
Tools like p0f can identify hosts and OS from passive traffic analysis:
sudo p0f -i eth0