Passive and Active Reconnaissance, OSINT and Its Limits
Before a tester sends a single packet to the client, a surprising amount is already public: the company's domains and subdomains, the addresses its mail servers use, the job adverts that list its technology stack, the code its developers pushed to public repositories, the certificates it requested. Reconnaissance collects that picture so the test spends its days in the right places. It also has rules. Some sources are fine to read, some count as touching the target, and some (a leaked password dump, an employee's private profile) are off limits however useful they look.
Passive and active
| Passive reconnaissance | Active reconnaissance | |
|---|---|---|
| Definition | gathering information without sending traffic to the target's systems | interacting with the target's systems directly |
| Examples | public DNS data from third-party datasets, certificate transparency logs, search engines, the company's own website as any visitor sees it, job adverts, WHOIS and RIR records, public code repositories | DNS queries to the target's own name servers, zone-transfer attempts, port scans, banner grabs, web crawling, directory brute-forcing |
| Detectable by the target? | essentially no | yes: logs, IDS alerts, WAF blocks |
| Needs authorization? | not legally for public data, but the engagement's rules still apply to what you do with it | yes: it is testing, and must be inside scope, window and techniques |
The boundary is not always sharp. Browsing the client's public website like a customer is passive in effect but reaches its servers; crawling every page at speed is active. Querying a public resolver for the client's A records reaches the client's authoritative name servers through the resolver. Treat anything that makes the client's systems do work you asked for as active, and keep it inside the window.
OSINT and its ethical limits
Open-source intelligence (OSINT) is information from publicly available sources. "Publicly available" doesn't mean "anything goes". The engagement's purpose is to assess the organisation; the people in it are not targets unless social engineering is explicitly in scope, and even then the RoE limits it.
| Source | Use in a test | Limits |
|---|---|---|
| Company website, press releases, annual reports | technology, locations, suppliers, naming conventions | none beyond the window, if you crawl it |
| Job adverts | technology stack ("experience with Exchange 2019, Fortinet") | none |
| Certificate transparency, passive DNS | host names | names are leads, not scope: screen them |
| Public code repositories | leaked configuration, internal host names, keys | don't use found credentials unless the RoE allows it; report them at once |
| Professional networking profiles | roles and team structure, for an e-mail address format | collect roles, not private lives; no fake profiles or connection requests without written approval |
| Breach data and paste sites | whether staff credentials have leaked | only through lawful services that tell you that an address appears in a breach; never download or use dumps of passwords |
| Personal social media, family details, home addresses | none in a normal test | out of bounds; it is surveillance of individuals, and in many countries a data-protection breach |
Data-protection law applies to OSINT too: collecting personal data about employees is processing it. Collect what the engagement needs (roles, a naming pattern), store it like other evidence, and delete it at the end.
A recon log with rules
Every recon action goes into the activity log with its source and its class. The checker below applies the engagement's rules to a day's planned actions: active steps only inside the window and against in-scope targets, and OSINT only from allowed source types. The actions are lab examples.
RULES = {
"window_open": False, # planning happens the week before the window
"in_scope": {"lab.test", "www.lab.test", "mail.lab.test"},
"social_engineering": False,
"allowed_osint": {"ct-log", "search-engine", "company-site", "job-ads", "code-repo", "rir-whois", "breach-notification"},
}
plan = [
("ct-log", "passive", "lab.test", "list certificate names for *.lab.test"),
("job-ads", "passive", "lab.test", "technology keywords in 12 adverts"),
("code-repo", "passive", "lab.test", "search public repos for 'lab.test' configs"),
("dns-query", "active", "lab.test", "query the lab name servers for MX/TXT"),
("port-scan", "active", "www.lab.test", "top 1000 TCP ports"),
("profiles", "passive", "staff", "collect roles of the IT team"),
("fake-profile", "active", "staff", "connect with admins to learn the VPN product"),
("breach-dump", "passive", "staff", "download a password dump to test logins"),
("breach-notification", "passive", "staff", "ask a breach-notification service which staff addresses appear"),
]
def verdict(source, kind, target):
if source in {"fake-profile"} and not RULES["social_engineering"]:
return "NO social engineering not authorised"
if source == "breach-dump":
return "NO never obtain or use leaked credentials"
if kind == "active":
if not RULES["window_open"]:
return "WAIT active step: only inside the test window"
if target not in RULES["in_scope"]:
return "NO target not in scope"
return "ok"
if source not in RULES["allowed_osint"]:
return "ASK source type not listed in the RoE"
return "ok"
for source, kind, target, what in plan:
print(f"{source:<20} {kind:<8} {verdict(source, kind, target):<46} {what}")ct-log passive ok list certificate names for *.lab.test
job-ads passive ok technology keywords in 12 adverts
code-repo passive ok search public repos for 'lab.test' configs
dns-query active WAIT active step: only inside the test window query the lab name servers for MX/TXT
port-scan active WAIT active step: only inside the test window top 1000 TCP ports
profiles passive ASK source type not listed in the RoE collect roles of the IT team
fake-profile active NO social engineering not authorised connect with admins to learn the VPN product
breach-dump passive NO never obtain or use leaked credentials download a password dump to test logins
breach-notification passive ok ask a breach-notification service which staff addresses appear
The professional-profile step is flagged because the RoE doesn't list it, not because it is necessarily wrong: collecting job titles to guess the e-mail format is common, but the client should agree in writing. The fake profile and the password dump are refused outright. The first is social engineering, which nobody authorised. The second means handling stolen credentials, which no RoE should allow.
How recon is detected
Passive recon is invisible to the target by definition, which is why defenders do it to themselves (see below). Active recon leaves traces: DNS query logs on the authoritative servers (a burst of queries for names that don't exist is a brute-force), web logs with crawler patterns and requests for robots.txt-listed paths, IDS alerts for scans, and connection requests to staff from unknown profiles.
How exposure is reduced
Defenders run the same OSINT against themselves regularly (attack-surface management): monitor certificate transparency for their domains, scan public code repositories for their host names and secrets (secret-scanning services do this automatically), review what job adverts reveal, and subscribe to breach notifications for their domains. Each item found is either removed (a leaked key revoked, a forgotten host shut down) or accepted knowingly.
Pitfalls
- Recon outside the window. "It's only DNS" is still active if the queries hit the client's servers.
- Treating a found name as in scope. Recon finds leads; the scope screen decides.
- Using found credentials. A key in a public repository is a critical finding to report immediately, not a way in, unless the RoE explicitly says so.
- Over-collecting about people. A report that lists employees' family members or home addresses harms the people and the client.
Practice
- Classify as passive or active: (a) reading the client's DMARC record through a public resolver, (b) reading old copies of the client's website in a web archive, (c) requesting
https://www.lab.test/robots.txt, (d) reverse-DNS lookups of the client's /24 against its own name server. - A public repository contains
config.ymlwithdb_password: Lab-Prod-2026!fordb01.lab.test. What do you do?
Answers
- (a) mostly passive in effect but reaches the client's authoritative server through the resolver: treat it as active and do it inside the window; (b) passive (a third party's copy); (c) active (a request to the target), though harmless; (d) active.
- Don't try the password. Record the repository URL, file, commit and time; notify the client contact at once as a critical finding (a production credential is public); recommend rotating the password, removing it from the history and enabling secret scanning. The fact that it was public, and since when, goes into the report.
Test yourself
Which of these is passive reconnaissance?
- A port scan of www.lab.test
- Reading certificate transparency logs for *.lab.test
- A zone-transfer attempt against the client's name server
- Brute-forcing directories on the client's website
During recon you find a leaked password dump that contains staff addresses. What is acceptable?
- Download it and test the passwords
- Use a lawful breach-notification service to learn which addresses appear, and report it; never handle the dump
- Sell it to the client
- Post the list in the report
Why is collecting employees' private social-media details out of bounds in a normal test?
- It is too slow
- The people aren't the target; it is surveillance of individuals and a data-protection problem
- Search engines block it
- It is passive
How do defenders reduce what OSINT reveals?
- They can't
- By running the same reconnaissance on themselves: CT monitoring, secret scanning, reviewing what adverts and sites reveal
- By blocking search engines
- By deleting their DNS records