QA Interview Hub · Knowledge base · Quizzes · Українська

Penetration Testing › Recon and attack surface mapping

Passive reconnaissance: what the internet already knows about a company

Passive reconnaissance gathers data from public sources and sends the target no request at all. Sources: DNS, WHOIS/RDAP, Certificate Transparency logs, search engines, public repositories, scan databases such as Shodan. It goes first because it leaves no trace in the target's logs and shows what to check actively. Data goes stale, so every name is verified, and a found key is never used.

Pentest · Recon

How many of a company’s sites can you find without sending it a single packet?

The scope before a test lists one domain, shop.example. In an hour a pentester writes out more than two dozen subdomains, finds a forgotten staging-old, learns that the front end is React and the back end is Java, and sees a contractor’s repository with a config. They sent no request to the company’s servers. This lesson is about passive reconnaissance: where this information comes from, what it is good for and where its limits are.

How it works and why. Passive reconnaissance collects data from public sources and does not interact with the target’s systems directly. Active reconnaissance (the next lesson) sends packets and requests to the target. Passive goes first because it costs nothing, leaves no traces in the target’s logs and shows what is worth checking actively and within which scope. Typical sources:

  • DNS and WHOIS/RDAP: domain records, mail servers, the registrar, related domains;
  • Certificate Transparency logs: every issued TLS certificate is recorded publicly, so subdomains show up, forgotten ones too;
  • Search engines and archives: search operators, the Wayback Machine, caches;
  • Public repositories and packages: code, configs, keys, internal host names;
  • Scan databases (Shodan, Censys): they have already scanned the internet, you only read their results;
  • Job posts, blogs, documents: the technology stack, system names, file metadata.

From sources to an asset list

DNS, WHOISCT logsSearch, GitHubAssetlistnot a single packet to the target
Figure 1. Passive reconnaissance reads other people’s data about the target and does not ask the target itself.

Example: subdomains from Certificate Transparency. The crt.sh service lets you search certificates by a name pattern. The query goes to crt.sh, not to the company:

curl -s "https://crt.sh/?q=%25.shop.example&output=json" \
  | jq -r '.[].name_value' | sort -u

A made-up output:

api.shop.example
www.shop.example
staging-old.shop.example
vpn.shop.example

The host staging-old is not linked anywhere in the interface but appeared in certificates. It is a candidate for an active check (whether it is alive and in scope). The logs also keep expired certificates, so the list may contain names that no longer exist: each name is checked, not taken as proof.

A real case. In October 2022 Toyota reported that a subcontractor who developed the T-Connect website had put part of the code in a public GitHub repository, and the code contained an access key to a data server. According to the company, the repository was open from December 2017 to 15 September 2022 and the key was replaced on 17 September. 296,019 email addresses were at risk; names, phone numbers and cards were not involved, and the company could not confirm third-party access. For reconnaissance the conclusion is: public code of contractors and former employees is part of the attack surface and is looked at first. If a working key is found it is not used to log in (that is access, not reconnaissance) and the contact person is told.

Limits and alternatives. Passive data goes stale: a service may be gone, an IP changed. It is incomplete and does not show what is open now, so it is complemented with active reconnaissance within scope. “Passive” does not mean “without rules”: collecting data about employees (social networks, personal accounts) is allowed only if the rules of engagement provide for it, and personal data laws always apply. Some tools (for example amass) have both passive and active modes: the agreement says which is allowed.

Common mistakes.

  • Treating passive reconnaissance as not limited by scope: data about other companies and people must not be collected.
  • Trusting a list of subdomains without checking: some names have long been gone or belong to another owner.
  • Using a found key “just to check”: that is unauthorized access.
  • Not recording the source of a finding: the report needs references to reproduce it.

Check yourself

Why is searching for subdomains in Certificate Transparency logs considered passive reconnaissance even though it shows a company’s real hosts?

Answer

The query goes to a public log (for example crt.sh), not to the company’s systems, so no packet is sent to the target. The data exists because certificate issuers publish certificates themselves.

An access key to the company’s storage is found in a contractor’s public repository. What next?

Answer

Do not use the key: logging in with it is access that is not permitted. Record where it was found and notify the contact person immediately so the key is revoked, because it is considered compromised from the moment of publication.

In an interview. Junior: “Passive reconnaissance collects public information without requests to the target: DNS, certificate logs, search, public code. It goes first and helps plan active checks within scope”. Middle/Senior: I add: verifying every name, leaks in contractors’ code (the Toyota 2022 example), the limits set by the rules of engagement for data about people, and how to handle found keys.

More articles in this chapter