External Recon and Enumeration Principles
External reconnaissance is performed before an Active Directory pentest to gather publicly accessible information that can affect the outcome of the engagement. Goals include:
- Validating information in the scoping document
- Ensuring actions are taken against the correct scope
- Identifying publicly accessible information such as leaked credentials
What to Look For
| Data Point | Description |
|---|---|
| IP Space | Valid ASN, netblocks, cloud presence, hosting providers, DNS record entries |
| Domain Information | DNS records, subdomains, publicly accessible services (mail servers, VPN portals, etc.), defenses in place (SIEM, AV, IPS/IDS) |
| Schema Format | Email accounts, AD usernames, password policies — useful for building username lists for password spraying, credential stuffing, brute forcing |
| Data Disclosures | Publicly accessible files (.pdf, .ppt, .docx, .xlsx) containing intranet links, user metadata, shares, credentials in code repos, AD username formats in document metadata |
| Breach Data | Publicly released usernames, passwords, or other critical information |
Where to Look
| Resource | Examples |
|---|---|
| ASN / IP Registrars | IANA, ARIN (Americas), RIPE (Europe), BGP Toolkit |
| Domain Registrars & DNS | DomainTools, PTRArchive, ICANN, manual DNS queries against well-known servers (e.g. 8.8.8.8) |
| Social Media | LinkedIn, Twitter, Facebook, regional social media, news articles |
| Public-Facing Company Websites | News articles, embedded documents, “About Us” and “Contact Us” pages |
| Cloud & Dev Storage | GitHub, AWS S3 buckets, Azure Blob storage, Google Dorks |
| Breach Data Sources | HaveIBeenPwned, Dehashed — search for corporate emails with cleartext passwords or crackable hashes to test against exposed login portals (Citrix, RDS, OWA, O365, VPN, VMware Horizon, etc.) |
Finding Address Spaces
Use the BGP Toolkit (Hurricane Electric) to research address blocks and ASNs for an organization. Key considerations:
- Large corporations often self-host infrastructure and have their own ASN
- Smaller organizations typically host with third-party providers (Cloudflare, GCP, AWS, Azure)
- Always verify you are not interacting with infrastructure outside your scope
- Some hosting providers (e.g. AWS) have specific penetration testing guidelines; others (e.g. Oracle) require a Cloud Security Testing Notification
- When in doubt, escalate before attacking any external-facing services you are unsure of
DNS Enumeration
Use sites like DomainTools and ViewDNS.info to:
- Validate scope and find undisclosed reachable hosts
- Retrieve DNS resolution data, DNSSEC status, and accessibility info
- Discover additional subdomains residing on in-scope IP addresses
- Cross-validate IP/ASN search results
Public Data
Social Media & Job Postings
- Sites like LinkedIn, Indeed, and Glassdoor can reveal organizational structure, technology stack, software versions, and security implementations
- Job postings may disclose specific software versions (e.g. SharePoint 2013/2016), which hints at potential upgrade-in-place vulnerabilities
Company Websites
- Gather contact emails, phone numbers, org charts, published documents
- Embedded documents may contain links to internal infrastructure or intranet sites
- Check for data inadvertently leaked on GitHub, AWS cloud storage, or other web platforms
- Tools: Trufflehog (credential scanning in repos), Greyhat Warfare (public cloud storage search)
Username Harvesting
Use tools like linkedin2username to scrape a company’s LinkedIn page and generate username permutations:
flastfirst.lastf.last
These can be added to password spraying target lists.
Credential Hunting
Dehashed can be used to search for cleartext credentials and password hashes in breach data:
sudo python3 dehashed.py -q inlanefreight.local -p
Results may include email, username, cleartext password, hashed password, and the source database. Test discovered credentials against exposed login portals using AD authentication.
Google Dorking Examples
| Purpose | Dork |
|---|---|
| Find PDF files on target | filetype:pdf inurl:targetdomain.com |
| Find email addresses on target | intext:"@targetdomain.com" inurl:targetdomain.com |
Overarching Enumeration Principles
Enumeration is an iterative process repeated throughout a penetration test:
- Start with passive resources, wide in scope, and narrow down
- Exhaust passive enumeration, examine results
- Move into active enumeration
Example Enumeration Workflow
- Check ASN/IP & Domain Data — Use BGP Toolkit to find IP addresses, mail servers, nameservers
- Validate findings — Cross-reference with ViewDNS.info, nslookup, etc.
- Harvest public data — Google Dorks for files and email addresses on the target domain
- Scrape usernames — LinkedIn and other sources
- Search breach data — Dehashed, HaveIBeenPwned for credential leaks
- Build wordlists — Combine findings for targeted password spraying
Key Takeaways
- Always save files, screenshots, scan output, and tool output as soon as you find them
- If stuck during a pentest, revisit passive recon for additional leads (e.g. breach data for VPN access)
- The majority of internal AD enumeration can be performed with just low-privilege domain user credentials
- A thorough external recon phase can mean the difference between days of brute-forcing and a quick foothold