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.

NmapDNSservice triageevidence
Authorized labs only. Confirm the scope, target and route before active testing. Examples use placeholders; replace them only with values from your permitted lab.

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
HelperUnderlying intentOutput
scannmap -Pn -sCV default scripts and versions.nmap/initial-IP.{nmap,gnmap,xml}
fullscanAll 65,535 TCP ports at a lab-conscious rate.nmap/all-ports-IP.*
udpquickTop 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

SignalLow-impact next check
HTTP/Scurl -skI "http://$IP/", then web workflow.
TLSopenssl s_client -connect "$IP:443" -servername NAME
SMBsmbclient -N -L "//$IP", then AD/Windows.
LDAP/KerberosResolve the lab domain and DC name; check clock before authenticated testing.
SNMPsnmpwalk -v2c -c public "$IP" 1.3.6.1.2.1 only where the lab permits the candidate community.
Unknown TCPncat -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_IP

Record 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.txt and the curated LFI list — input handling checks.
wordlists
find "$PE_WORDLIST_ROOT" -type f -maxdepth 4

Turn 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.