Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 31 ยท Information Gathering Concepts

Reconnaissance: Passive vs Active

Understand reconnaissance in security: passive vs active information gathering, OSINT, footprinting and attack surface, and what defenders learn from it.

Every security assessment starts the same way: learn what exists. Before anyone can protect a system, or test it, they need to know which domains, servers, applications and people are part of it. This stage is called reconnaissance, or recon, or information gathering.

Attackers do it because they want to find the easiest way in. Defenders do it for the opposite reason: to see themselves the way an outsider sees them, and close gaps first. The data is the same; the purpose and the permission differ. Remember the rule from Law, Ethics and Authorization: anything that touches a target directly needs authorization.

Passive and active reconnaissance

The central distinction is whether you interact with the target's systems.

Passive reconnaissance

No contact You never send traffic to the target.
Public sources Search engines, registries, archives, job posts.
Hard to detect The target cannot see you reading public data.

Low risk, but information may be old.

1 / 2
Passive Active
Touches target systems No Yes
Typical sources Public records, search engines, certificate logs, code repositories Pings, port scans, banner requests, crawling
Detectable by target Rarely Often
Accuracy Can be stale Current
Authorization needed Depends on method; collecting public data is generally low risk, but follow your rules of engagement Always

The line can blur. Visiting a company's public website is normal browsing, but crawling it at high speed starts to look like an attack. When in doubt, check the rules of engagement or treat the action as active.

OSINT: open-source intelligence

OSINT means information from legally and publicly available sources. In security it covers things like:

  • Registration data: who registered a domain, which name servers it uses (see DNS, WHOIS and Certificate Intelligence).
  • Certificates: public logs of TLS certificates reveal hostnames an organization has used.
  • Search engines and archives: old pages, exposed documents, cached content.
  • Code and paste sites: developers sometimes publish configuration files, internal hostnames or even credentials by accident.
  • Job postings and social media: "experience with Oracle 11g and Citrix required" tells an outsider a lot about the technology stack. Staff names and roles can help a social-engineering attempt.
  • Metadata: documents and images may carry author names, software versions and file paths.

None of this requires breaking anything. That is exactly why it is so valuable to attackers, and why defenders should check it regularly.

Footprinting and the attack surface

Footprinting is building a profile of an organization's presence: domains, address ranges, technologies, people. The result is an attack surface inventory: everything an outsider could try to interact with.

An attack surface includes:

  • Internet-facing hosts and the ports they expose.
  • Web applications, APIs and login pages.
  • Cloud storage and forgotten test servers.
  • Third-party services (a support portal run by a vendor).
  • Human channels: email addresses, phone numbers, staff directories.

A frequent and costly finding is shadow IT: systems someone set up and forgot. Nobody patches what nobody remembers.

flowchart LR
    S["Public sources<br/>DNS, certificates, search"] --> I["Inventory<br/>hosts, apps, owners"]
    I --> R["Risk review<br/>what is exposed and why"]
    R --> F["Fixes<br/>remove, patch, restrict"]
    F -.->|"repeat regularly"| S

Defenders run the same recon loop, but the output is a fix list, not an entry point.

What defenders can learn from the same data

Putting yourself in the observer's position gives defenders concrete wins:

  1. Find forgotten assets. A certificate for staging-old.example.com issued three years ago may point to a server nobody maintains.
  2. Spot information leaks. Version numbers in headers, internal hostnames in public scripts, or documents with author metadata.
  3. Reduce what is exposed. If a database port answers from the internet, ask whether it needs to.
  4. Prepare monitoring. If you know what an outsider can see, you know which logs should show probes, and what normal looks like.
  5. Train people. Show staff what an attacker could learn from their public profiles.

Typical Kali tools (read-only here)

These commands need a real Kali system and a target you are authorized to examine. They are shown for recognition, not for running.

Terminal
whois example.com                  # registration data
dig example.com ANY +noall +answer # DNS records (see the next lesson)
curl -I https://example.com        # response headers: active, one polite request
theHarvester -d example.com -b all # collects public email and host names (OSINT)

Only whois-style lookups against registries are mostly passive. curl and anything that sends requests to the target is active, even if it is just one request.

Stand-in: building an attack surface inventory

Recon produces records. The skill is organizing them. This stand-in takes sample records from different sources (all in the documentation address range 203.0.113.0/24, with the reserved name example.com), merges them by host, and shows what an owner should review.

Python Merge recon records into an inventory

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 review list is the real product. A host that appears in certificates but not DNS is a question to ask; a public job post that names an appliance model is an information leak to discuss.

Stand-in: passive or active?

Classifying actions correctly is a practical habit before you run a tool. This stand-in labels sample actions by whether they send traffic to the target, using a simple rule set.

Python Classify actions as passive or active

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.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What best defines passive reconnaissance?

    Passive recon uses third-party and public sources, so the target's own systems are not contacted.
  2. 2. Why do defenders perform reconnaissance on their own organization?

    Seeing yourself as an outsider does reveals shadow IT, leaks and unnecessary exposure that can be fixed.
  3. 3. A certificate exists for staging-old.example.com but DNS no longer resolves it. What is the sensible conclusion?

    Mismatches between sources are leads. The host may be decommissioned, or it may still exist somewhere unmanaged.
  4. 4. Sending one HTTP request to the target's server to read its headers is:

    Any traffic sent to the target's systems is active reconnaissance, however small, so it needs authorization.

Summary

  • Reconnaissance is learning what exists; attackers and defenders use the same data for opposite goals.
  • Passive recon never contacts the target; active recon does and needs authorization.
  • OSINT draws on registries, certificates, search engines, code sites, job posts and metadata.
  • The attack surface is everything an outsider can interact with, including forgotten systems.
  • Comparing sources (DNS vs certificates) turns raw records into a useful review list.

Next up: DNS, WHOIS and Certificate Intelligence.