AI prompt · Infrastructure and AD pentesting · OSINT · Cloud
Attack surface prompt
Prompt that analyses an asset inventory from the authorised scope (domains, IPs, services, cloud) to prioritise testing: exposure, criticality, checks.
Published
Cheatsheet · OSINT
Passive collection on an organisation’s domain: whois and RDAP, DNS with dig, certificate transparency, subdomains, SPF and DMARC records.
Official website: subfinder
This sheet gathers the first steps of OSINT reconnaissance on an organisation’s domain, using passive collection: you query registries, public logs and third-party sources, never the target’s own infrastructure. Replace example.org with your engagement’s domain, whose scope is set using the penetration test scoping checklist. The assets you discover then serve as a starting point for active scanning, for example with the Nmap cheatsheet, only if they fall within the authorised scope.
# Classic whois lookup
whois example.org
# RDAP: structured JSON response (the service redirects to the right registry)
curl -sL https://rdap.org/domain/example.org | jq '{name: .ldhName, status: .status, events: .events}'
# Name servers and key dates
curl -sL https://rdap.org/domain/example.org | jq -r '.nameservers[].ldhName, (.events[] | "\(.eventAction) \(.eventDate)")'
RDAP (RFC 9083) succeeds whois with a stable JSON format. Registrants’ personal data is now largely redacted: look instead for the registrar, the creation and expiry dates, and the name servers, which reveal the DNS host. rdap.org redirects to the registry’s own RDAP service; some country-code registries do not offer one yet, in which case whois is still needed.
# Common records
dig example.org A +short
dig example.org AAAA +short
dig example.org MX +short
dig example.org NS +short
dig example.org TXT +short
dig example.org SOA +short
dig example.org CAA +short
# Through a specific public resolver, so as not to depend on your local one
dig @1.1.1.1 example.org NS +noall +answer
TXT records often hold verification tokens for third-party services (email, collaboration, marketing tools): they give an inventory of the SaaS providers in use. The MX record shows the mail gateway, and CAA the authorised certificate authorities. These queries go through a resolver: they stay close to passive collection, but they still query the organisation’s name servers.
Every public certificate is recorded in public logs (RFC 6962). They reveal host names that are sometimes published nowhere else.
# Names present in certificates issued for the domain and its subdomains
curl -s "https://crt.sh/?q=%25.example.org&output=json" \
| jq -r '.[].name_value' | sed 's/\*\.//' | sort -u > ct-names.txt
# Number of distinct names
wc -l ct-names.txt
crt.sh is a free third-party service: it can be slow, return errors or truncate large results. Retry later rather than pushing. Expired or wildcard certificates (*.example.org) hint at history and environments (test, staging), not at proof that a host responds today.
# subfinder: queries passive sources (certificates, aggregators, archives)
subfinder -d example.org -silent -o subfinder.txt
# All sources (slower, more complete)
subfinder -d example.org -all -silent -o subfinder.txt
# Several domains listed in a file, JSON Lines output (one object per line)
subfinder -dL domains.txt -oJ -o subfinder.json
# Limit the rate towards the sources
subfinder -d example.org -rl 10 -silent
# Amass: in recent versions, passive collection is the default (-passive is
# deprecated) and results are stored in a local database, then extracted
# with "amass subs". Check the syntax with "amass enum -h".
amass enum -d example.org
amass subs -names -d example.org -o amass.txt
# Merge and deduplicate the results of the different tools
cat ct-names.txt subfinder.txt amass.txt | sort -u > subdomains.txt
Several subfinder sources need an API key, declared in its configuration file (provider-config.yaml): without keys, coverage is weaker. Always cross-check at least two tools: none sees everything. This list is only an inventory of names: it proves neither that the host is live nor that it truly belongs to the organisation.
# URLs archived by the Wayback Machine for the domain (CDX API)
curl -s "https://web.archive.org/cdx/search/cdx?url=*.example.org&fl=original&collapse=urlkey" \
| sort -u > archived-urls.txt
# Look for sensitive pages or files in the history
grep -Ei "\.(bak|sql|zip|env|log)$|admin|backup|staging" archived-urls.txt
Archives reveal old administration pages, withdrawn documents and API paths. Many no longer respond; they are used to steer the authorised checks that follow.
# SPF: who is allowed to send on behalf of the domain
dig example.org TXT +short | grep -i "v=spf1"
# DMARC: policy applied to messages that fail the checks
dig _dmarc.example.org TXT +short
# DKIM: requires knowing the selector (here "selector1", to adapt)
dig selector1._domainkey.example.org TXT +short
# MTA-STS and TLS reporting
dig _mta-sts.example.org TXT +short
dig _smtp._tls.example.org TXT +short
| Observation | Reading |
|---|---|
| No SPF record | No restriction on authorised senders |
SPF ending in +all or ?all |
Almost no protection |
SPF ending in ~all |
Soft fail: the message is marked, not rejected |
| No DMARC | No control or reporting on domain spoofing |
DMARC p=none |
Monitoring only, no blocking |
DMARC p=quarantine or p=reject |
Effective protection, unless in test mode: t=y (RFC 9989) or pct= below 100 (older syntax) |
An SPF record exceeding ten DNS lookups (nested include:) is invalid under RFC 7208. These observations concern configuration: they can be checked without sending a single message.
| Step | Deliverable |
|---|---|
| Registrant, registrar, name servers | dated notes with the source (query and date) |
| DNS records | raw dig export in a timestamped file |
| Subdomains | deduplicated list, with the tool and source of each name |
| SPF, DKIM, DMARC table with the observed policy | |
| History | list of archived URLs kept and why |
Record the source and collection date of every piece of information: OSINT ages quickly, and a result without provenance cannot be defended in a report. Limit collection to information about the organisation and its scope: personal data of third parties (employees, individuals) has no place in the deliverable unless explicitly agreed.
AI prompt · Infrastructure and AD pentesting · OSINT · Cloud
Prompt that analyses an asset inventory from the authorised scope (domains, IPs, services, cloud) to prioritise testing: exposure, criticality, checks.
Published
Methodology · OSINT
Methodology to assess an organisation’s OSINT exposure for an authorised client: legal framework, infrastructure, people, leaks, code, brand, reporting.
Published
AI prompt · OSINT
Prompt that builds an OSINT collection plan for an authorised engagement: objectives, sources by category, tools, legal limits and deliverables.
Published
BEAROPS
BEAROPS carries out OSINT investigations lasting from a few days to several weeks, using open sources within a legal framework.