Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 53 ยท Reconnaissance and Scanning

Passive Reconnaissance and OSINT

Learn passive reconnaissance and OSINT: DNS records, certificate transparency, metadata leaks and public information, plus how organizations can shrink their exposed footprint.

Before anyone attacks a system, they learn about it. That first phase is reconnaissance, and its quietest form is passive reconnaissance: collecting information from public sources without sending a single packet to the target's own systems. The target's logs never see you, because you only read what the world already publishes: DNS data, certificate records, job ads, code repositories, documents.

For defenders this is the most useful phase to study. Everything a tester finds this way, a real attacker can find too, and it costs nothing to look. In an authorized engagement (see Law, Scope and Rules of Engagement), passive recon shows the client what their public footprint reveals. In this lesson you learn the main sources, what each one leaks, and how to shrink the leak. The technology involved (public DNS, search engines, certificate logs) cannot be queried from this site, so the examples are read-only descriptions plus a Python stand-in that analyzes sample DNS records you could have collected yourself.

Passive versus active

Two ways to learn about a target

Passive Read public sources. The target sees nothing.
Active Touch the target's systems. Logs show you.

Active steps need written authorization. Passive ones still need a purpose and limits.

1 / 2

The line is not always sharp. Asking a public resolver for a domain's A record is usually treated as passive because you contact your own resolver, not the target. Visiting the target's website is active, even though it looks like normal browsing. Your rules of engagement decide what is allowed; when in doubt, ask in writing.

Public sources and what they reveal

DNS records. Every domain publishes records that anyone can query. Common types:

Record Holds What it leaks
A / AAAA IPv4 / IPv6 address Where services run, hosting provider
MX Mail servers Email provider (a company's mail filter or cloud suite)
NS Name servers DNS provider
TXT Free text SPF mail policy, domain-verification tokens that name the SaaS products in use
CNAME Alias to another name Third-party services, and forgotten aliases

Subdomain names such as vpn, staging, jira or old-shop tell a story: what exists, what is internal-facing, what may be forgotten.

Certificate transparency (CT). Public certificate authorities must log every certificate they issue in open, append-only logs. Anyone can search those logs by domain name. Because a certificate names the hostnames it covers, CT logs list subdomains the owner never advertised, including test servers that received a certificate. This is the reason you should never rely on an obscure name for secrecy.

Search engines and code hosting. Search operators can find documents, login pages and error messages that were indexed by mistake. Public repositories sometimes contain configuration files, internal host names or even credentials that a developer committed once and deleted later (history still has them; see Secure Coding and DevSecOps).

Documents and metadata. A PDF, spreadsheet or photo can carry metadata: author name, software version, internal file paths, the GPS position where a photo was taken. A published file named report.pdf may reveal a username like jsmith and a path like C:\Users\jsmith\... that matches the company's naming scheme for accounts.

People and organization. Job postings list the technologies a company runs ("experience with Oracle 19c and Fortinet firewalls"). Professional profiles show the org chart, which helps a phishing author pick believable targets. Press releases name vendors and projects.

Breach and paste data. Public breach notifications show whether employee emails have appeared in leaks, which matters because of credential stuffing.

A professional works with a purpose and a record. Everything collected goes into notes with its source and date, and personal data about individuals is kept to what the engagement needs. OSINT is legal in most places because the data is public, but collecting it about private people, or using it to harass, is not acceptable in any engagement.

Reading DNS records like an analyst

Suppose your authorized assessment of the fictional company example-shop.test yielded the records below (the .test domain is reserved for documentation and does not exist). The stand-in code groups them, spots the hosting and mail providers, and flags the entries a defender should look at. Nothing here queries the network.

Python Analyze sample DNS records

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The code is a stand-in for tooling that does the same bookkeeping at scale. What is real: the record types and what each reveals, and the fact that a dangling CNAME to a service you no longer use is a known takeover risk. What is made up: the domain, addresses and vendors.

Reducing your footprint

You cannot make public data private, but you can control how much of it exists and how useful it is.

  1. Inventory first. Keep a list of your domains, subdomains and certificates. Remove DNS entries for retired systems; a stale CNAME is a liability.
  2. Separate internal from external. Use internal DNS for internal names, so jira or vpn do not appear in public records unless they must.
  3. Do not hide behind obscure names. CT logs expose them anyway. Protect the service itself with authentication and patching.
  4. Strip metadata from documents and images before you publish them.
  5. Check code hosting. Scan repositories for secrets, rotate any that leaked, and use pre-commit checks.
  6. Review job ads and press releases for details that are more specific than a candidate needs.
  7. Publish email authentication (SPF, DKIM, DMARC) so attackers cannot forge your domain, covered in Malware Types and Social Engineering Defense.
  8. Train staff on what they share publicly, because people are part of the footprint.

Scoring your own exposure

Here is a small second stand-in: it assigns a rough exposure score to a list of findings so you can compare before and after a cleanup. The weights are a teaching choice, not a standard.

Python Score a public footprint

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The point is the habit: list what is exposed, rank it by how much damage it could enable, and fix the biggest items first. The same idea returns in Vulnerability Scanning and Triage.

WHOIS, search-engine dorking and footprinting tools

Three classic sources deserve a closer look, because each one is easy to use and easy to forget about on your own side.

WHOIS records describe who registered a domain or an address block: the registrar, creation and expiry dates, name servers and sometimes contact details. Many registries now redact personal data, but name servers, registrar and dates remain useful: they hint at hosting providers and reveal domains that are about to expire (an expired domain can be re-registered by someone else). IP ranges have their own records that name the organization that owns a block.

Search-engine dorking means using a search engine's advanced operators to find pages that were indexed by accident. Common operators include site: (limit to one domain), filetype: (a file extension), intitle: and inurl: (words in the title or address) and quoted phrases. The Google Hacking Database (GHDB) is a public catalog of such queries that turn up exposed log files, configuration backups, login panels and directory listings. The defensive use is the point of this lesson: run these searches against your own domain to see what a stranger would find, then remove or protect it and ask the search engine to drop the cached copy.

Footprinting tools automate the same collection. Internet-wide search engines for devices (Shodan and Censys are the best known) index banners and certificates for exposed services; theHarvester collects email addresses and subdomains from public sources; Maltego draws relationships between people, domains and servers as a graph; Recon-ng is a framework of reconnaissance modules. They query public data, but each has terms of use, and results may include third parties' data, so keep to the scope and the rules of engagement.

The stand-in below does the defensive part. It builds a list of dork-style queries for a domain you own and checks an invented list of indexed URLs against simple exposure rules. Nothing is sent to a search engine.

Node.js Review your own exposure with dork-style rules

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

After fixing, request removal from the search index, rotate any secret that was exposed (assume it was copied) and add Disallow rules only as a courtesy: robots.txt is not an access control and even advertises the paths you list in it.

Regional Internet Registries: ARIN and its siblings

IP addresses and AS numbers are handed out by five Regional Internet Registries (RIRs): ARIN (North America), RIPE NCC (Europe, Middle East), APNIC (Asia-Pacific), LACNIC (Latin America) and AFRINIC (Africa). ARIN is a non-profit run by a Board of Trustees elected by its members. It publishes a public WHOIS/RDAP service that answers "who holds this address block?" with organization name, address range and contact roles. For a tester this reveals a client's address space and which provider hosts a service.

Countermeasures are about exposing less: use role-based contact addresses instead of personal names, keep records accurate (wrong data breaks abuse reports) but minimal, use registrar privacy services for domains, and remember the block itself stays public by design.

Web, IP and e-mail based reconnaissance

Reconnaissance can be sorted by where the information lives.

  • Web-based: the company site, job ads (which list technology), search-engine caches, archived pages, code repositories and social profiles.
  • IP-address based: registry records, reverse DNS, certificate transparency logs, and internet-wide search engines such as Shodan that index banners of exposed devices.
  • E-mail intelligence (EMAILINT): discovering address formats (first.last@company), headers that show mail servers, and breach lookups.
  • Physical and human: dumpster diving (paper and drives thrown away without shredding), Bluetooth discovery of nearby devices, and shoulder surfing.
  • Files and metadata: documents and photos carry hidden data, for example EXIF in images (camera model, date, sometimes GPS coordinates) and author names in office files.
  • Breach and paste sites: HaveIBeenPwned tells you whether an address appeared in a known breach, and paste sites sometimes hold leaked credentials or configuration.

Defense: strip metadata before publishing, shred paper, review what job ads reveal, monitor breach notifications for your domains and force password resets, and search for your own company the way an outsider would.

Footprinting and OSINT tools

Common open-source tools gather the above automatically. Maltego draws link graphs between people, domains and servers. theHarvester collects e-mail addresses, subdomains and names from public sources. Recon-ng is a modular framework in the style of Metasploit. Shodan searches banners of internet-connected devices. SpiderFoot automates dozens of OSINT lookups. NeoTrace (now historic) showed traceroute on a map. Tools such as DorkScanner automate search-engine dorks, but automated queries usually break the search provider's terms of service, so write queries by hand against your own domains. Use these tools only within the scope of an engagement and respect the privacy of individuals; collect what the task needs and no more.

WHOIS lookup services

Besides the command-line client, web services present domain records with history: ViewDNS.info, DomainTools, SecurityTrails, Netcraft and WhoisFreaks. They retrieve domain records (registrar, creation and expiry dates, name servers, registrant contacts) and often historical DNS, reverse WHOIS (every domain a given e-mail registered) and hosting changes. For defenders the advantages are asset discovery (finding forgotten domains of your company), spotting look-alike phishing domains, and checking expiry dates. For testers they sketch the target's infrastructure and technology without touching it. Privacy protection on your own domains hides personal details but not the name servers.

Attack surface and attack surface management

The attack surface is the sum of all points where an unauthorized party could try to enter or extract data. It has three main types: the digital surface (hosts, services, APIs, cloud assets, code, third-party scripts), the physical surface (offices, devices, ports, USB) and the human or social surface (staff, contractors, suppliers). Reducing it means turning off unused services, closing ports, deleting stale accounts and DNS records, and limiting who can reach what.

Attack surface management (ASM) is the continuous process: discover assets (including shadow IT and forgotten cloud buckets), classify them by owner and criticality, prioritize exposure by severity, and monitor for change. Commercial platforms from vendors such as Tenable, Rapid7, Splunk and Cloudflare automate this; the same idea can run as a weekly script over your own inventory.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What makes reconnaissance 'passive'?

    Passive recon reads information that is already public, so the target's systems see no traffic from you. Rules of engagement still apply.
  2. 2. Why do certificate transparency logs matter for a defender?

    Every publicly trusted certificate is logged and searchable by name, so hidden-looking hostnames become discoverable. Obscure names are not protection.
  3. 3. A CNAME record points to a third-party service you have stopped using. What is the risk?

    A dangling alias can allow subdomain takeover when the external resource can be registered by someone else. Remove stale records.
  4. 4. Which action reduces the metadata leak from published documents?

    Metadata such as author names, internal paths and GPS data is stored inside the file, so it must be removed or cleaned before the file is public.

Summary

  • Passive reconnaissance gathers information from public sources without touching the target's systems.
  • DNS records, certificate transparency logs, search results, code hosting, document metadata and job ads all reveal technologies, names and structure.
  • Obscure host names do not hide anything; CT logs and DNS data expose them.
  • Record sources, keep personal data to the minimum the engagement needs, and follow the rules of engagement.
  • Shrink the footprint by keeping an inventory, removing stale DNS entries, stripping metadata, scanning repositories and publishing email authentication.
  • Passive findings guide the next phase, active discovery.

Next: Port Scanning and Service Discovery Concepts