Module 05 // discovery
Recon matrix.
Start broad enough to map the lab, then narrow by evidence. Keep every result target-scoped and every packet inside the authorized route.
Scope and route first
pe status
useip
pe vpn route "$IP"
ip route get "$IP"The helper functions below refuse non-lab routes by default. Raw tools do not: manually checking scope remains mandatory.
Recorded scans
scan
fullscan
udpquick| Helper | Underlying intent | Output |
|---|---|---|
scan | nmap -Pn -sCV default scripts and versions. | nmap/initial-IP.{nmap,gnmap,xml} |
fullscan | All 65,535 TCP ports at a lab-conscious rate. | nmap/all-ports-IP.* |
udpquick | Top 100 UDP ports; requires sudo. | nmap/udp-top100-IP.* |
Follow all-port discovery with focused scripts and versions only on the discovered ports, for example nmap -Pn -sCV -p 22,80 -oA nmap/focused "$IP".
Service triage
| Signal | Low-impact next check |
|---|---|
| HTTP/S | curl -skI "http://$IP/", then web workflow. |
| TLS | openssl s_client -connect "$IP:443" -servername NAME |
| SMB | smbclient -N -L "//$IP", then AD/Windows. |
| LDAP/Kerberos | Resolve the lab domain and DC name; check clock before authenticated testing. |
| SNMP | snmpwalk -v2c -c public "$IP" 1.3.6.1.2.1 only where the lab permits the candidate community. |
| Unknown TCP | ncat -nv "$IP" PORT or a focused Nmap version probe. |
Names matter
dig -x "$IP"
dig @DNS_IP lab.htb
dnsrecon -d lab.htb -n DNS_IPRecord confirmed names in pe host. For a single lab host, add only verified entries to /etc/hosts; avoid wildcard assumptions. Use discovered hostnames as TLS SNI and HTTP Host values.
Curated wordlists
Discovery/Web-Content/raft-small-words.txt— quick web content pass.Discovery/Web-Content/raft-medium-words.txt— deeper helper default.Discovery/Web-Content/quickhits.txt— common sensitive paths.Discovery/DNS/subdomains-top1million-110000.txt— lab DNS names.Passwords/Common-Credentials/xato-net-10-million-passwords-100000.txt— scoped password auditing only.Usernames/top-usernames-shortlist.txt— small username candidates.Fuzzing/special-chars.txtand the curated LFI list — input handling checks.
wordlists
find "$PE_WORDLIST_ROOT" -type f -maxdepth 4Turn output into state
rg 'open|hostname|domain' nmap/
pe note add -t "recon" -b "Open: 22/ssh, 80/http"
pe host port HOST_ID 80 --service http --version "observed banner"Keep raw scanner files immutable where possible and write interpretation separately. An XML/Nmap set plus concise notes is easier to validate than copied terminal scrollback.
No entry matches. Press Esc to reset.