Active Reconnaissance

beginner30 minWriteup

Directly interacting with targets to gather information

Learning Objectives

  • Perform DNS enumeration
  • Conduct network sweeps
  • Identify live hosts
  • Gather service banners

If

is watching someone from across the street, active reconnaissance is walking up and knocking on their door. You're directly interacting with target systems - and they can see you coming.

Active recon generates logs, can trigger security alerts, and leaves your IP address in their records. But it also reveals information you can't get passively: live hosts, open ports, running services, and version numbers.

Authorization Required

Active reconnaissance without authorization is illegal in most jurisdictions. Always have written permission before scanning any systems you don't own. Even "harmless" pings can be considered unauthorized access.

Host Discovery

Before scanning ports, you need to know which hosts are actually alive. Think of it like checking which houses on a street have lights on before deciding which doors to knock.

ICMP Ping Sweeps

bash
1606070;"># Basic ping sweep with fping
2fping -a -g 192.168.1.0/24 2>/dev/null
3 
4606070;"># Nmap ping sweep
5nmap -sn 192.168.1.0/24
6 
7606070;"># Specific ICMP types
8nmap -PE 192.168.1.0/24 606070;"># Echo request
9nmap -PP 192.168.1.0/24 606070;"># Timestamp
10nmap -PM 192.168.1.0/24 606070;"># Address mask

ICMP Often Blocked

Many firewalls block ICMP. A host not responding to ping doesn't mean it's down - it might just be silently ignoring you. Use multiple discovery techniques.

TCP/UDP Discovery

bash
1606070;"># TCP SYN discovery (common ports)
2nmap -PS22,80,443,445 192.168.1.0/24
3 
4606070;"># TCP ACK discovery (can bypass some firewalls)
5nmap -PA80,443 192.168.1.0/24
6 
7606070;"># UDP discovery
8nmap -PU53,161 192.168.1.0/24
9 
10606070;"># Combined techniques
11nmap -PE -PS22,80,443 -PA80,443 -PU53 192.168.1.0/24

ARP Discovery (Local Network)

bash
1606070;"># ARP scan - fastest for local networks
2arp-scan -l
3arp-scan 192.168.1.0/24
4 
5606070;"># Nmap ARP ping
6nmap -PR 192.168.1.0/24
7 
8606070;"># Netdiscover (passive and active)
9netdiscover -i eth0 -r 192.168.1.0/24

ARP Never Lies

On local networks, ARP discovery is king. Devices MUST respond to ARP requests to communicate on the network - there's no firewall rule that can block it without breaking connectivity.

DNS Enumeration

DNS is chatty by design. With the right queries, it'll tell you about mail servers, subdomains, and sometimes the entire zone.

Zone Transfers

A zone transfer (AXFR) is a DNS feature that lets secondary servers copy the entire zone database. Misconfigured servers allow anyone to request this.

bash
1606070;"># Attempt zone transfer
2dig axfr @ns1.example.com example.com
3 
4606070;"># Using host
5host -t axfr example.com ns1.example.com
6 
7606070;"># Using nmap
8nmap --script dns-zone-transfer -p 53 ns1.example.com

DNS Brute Forcing

bash
1606070;"># Using dnsenum
2dnsenum example.com
3 
4606070;"># Using fierce
5fierce --domain example.com
6 
7606070;"># Using gobuster
8gobuster dns -d example.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
9 
10606070;"># Using dnsrecon
11dnsrecon -d example.com -t brt -D /path/to/wordlist.txt

Reverse DNS Sweeps

bash
1606070;"># PTR record sweep
2dnsrecon -r 192.168.1.0/24
3 
4606070;"># Using nmap
5nmap -sL 192.168.1.0/24 | grep 606070;">#a5d6ff;">"("
6 
7606070;"># Manual reverse lookup
8for ip in $(seq 1 254); do
9 host 192.168.1.$ip | grep -v 606070;">#a5d6ff;">"not found"
10done

Services often announce themselves with banners - like a store putting their name on the window. Banners reveal software names, versions, and sometimes even OS information.

bash
1606070;"># Netcat banner grab
2nc -nv 192.168.1.10 22
3nc -nv 192.168.1.10 21
4nc -nv 192.168.1.10 25
5 
6606070;"># Telnet for HTTP
7telnet 192.168.1.10 80
8GET / HTTP/1.0
9Host: 192.168.1.10
10 
11606070;"># Nmap service detection
12nmap -sV 192.168.1.10
13 
14606070;"># Grab specific service banners
15nmap --script banner 192.168.1.10

Manual vs Automated

While Nmap automates banner grabbing, manual netcat connections let you interact with services and sometimes extract more information through conversation.

OS Fingerprinting

Different operating systems implement TCP/IP slightly differently. By analyzing response packets, we can often determine the exact OS version.

bash
1606070;"># Nmap OS detection
2nmap -O 192.168.1.10
3nmap -O --osscan-guess 192.168.1.10
4 
5606070;"># Using TTL values
6606070;"># Linux: 64
7606070;"># Windows: 128
8606070;"># Cisco: 255
9ping -c 1 192.168.1.10 | grep ttl
10 
11606070;"># p0f passive fingerprinting
12p0f -i eth0

Fingerprinting Needs Ports

OS detection requires at least one open and one closed port for accurate results. Run a port scan first.

SMB & NetBIOS

Windows networks leak information through SMB and NetBIOS like a gossipy neighbor. Usernames, shares, groups - it's all there for the asking.

bash
1606070;"># NBTscan for NetBIOS info
2nbtscan 192.168.1.0/24
3 
4606070;"># Enum4linux - comprehensive SMB enumeration
5enum4linux -a 192.168.1.10
6 
7606070;"># SMBclient to list shares
8smbclient -L 606070;">//192.168.1.10 -N
9 
10606070;"># Crackmapexec
11crackmapexec smb 192.168.1.0/24
12 
13606070;"># rpcclient null session
14rpcclient -U 606070;">#a5d6ff;">"" -N 192.168.1.10
15> enumdomusers
16> enumdomgroups

SNMP Enumeration

SNMP (Simple Network Management Protocol) was designed for monitoring but often reveals far too much: running processes, installed software, network interfaces, and even credentials.

bash
1606070;"># SNMP walk with common community strings
2snmpwalk -v2c -c public 192.168.1.10
3snmpwalk -v2c -c private 192.168.1.10
4 
5606070;"># Using onesixtyone for community string bruteforce
6onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt 192.168.1.10
7 
8606070;"># SNMPcheck
9snmpcheck -t 192.168.1.10 -c public
10 
11606070;"># Nmap SNMP scripts
12nmap -sU -p 161 --script snmp-brute,snmp-info 192.168.1.10

SNMP = Security Not My Problem

Joke in the industry: SNMP stands for "Security Not My Problem." Many devices still use default community strings like "public" and "private." Always check!

SMTP Enumeration

Mail servers can confirm valid usernames through VRFY and EXPN commands, or by observing RCPT TO responses.

bash
1606070;"># Manual SMTP enumeration
2nc -nv 192.168.1.10 25
3HELO test
4VRFY admin
5VRFY root
6EXPN admin
7 
8606070;"># Using smtp-user-enum
9smtp-user-enum -M VRFY -U /usr/share/seclists/Usernames/Names/names.txt -t 192.168.1.10
10 
11606070;"># Nmap SMTP scripts
12nmap --script smtp-enum-users -p 25 192.168.1.10

Active Recon Methodology

Active Reconnaissance Checklist

1
Host DiscoveryARP scan (local), ICMP sweep, TCP/UDP discovery to find live hosts
2
Port ScanningQuick TCP scan, then full port scan on interesting hosts (covered in Nmap lesson)
3
Service EnumerationBanner grabbing, service version detection on open ports
4
OS FingerprintingIdentify operating systems for targeted exploitation
5
Protocol-Specific EnumSMB, SNMP, DNS, SMTP enumeration based on discovered services
6
Document EverythingIP addresses, open ports, services, versions, potential vulnerabilities

Knowledge Check

Quick Quiz
Question 1 of 3

Why is ARP scanning the most reliable for local networks?

Challenges

Network Discovery Lab

Challenge
🌱 beginner

Given a /24 network range, identify all live hosts using at least 3 different discovery techniques. Document which hosts responded to which technique.

Need a hint? (4 available)

Service Enumeration

Challenge
🔥 intermediate

For a discovered host running SMB, extract: hostname, domain, users, and available shares using only command-line tools.

Need a hint? (4 available)

Key Takeaways

  • Active recon directly interacts with targets - generates logs
  • ARP is most reliable for local network discovery
  • Use multiple discovery techniques - firewalls block different things
  • Banner grabbing reveals software versions for vulnerability research
  • SMB and SNMP often leak extensive information through misconfigurations
  • Always have authorization before active scanning