Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 37 ยท Information Gathering

Reconnaissance Methodology: Passive and Active Information Gathering

Learn how authorized testers gather information: passive versus active recon, what to collect, how to stay in scope, and how defenders reduce what an attacker can learn.

Information gathering, or reconnaissance, decides how good the rest of a test will be. Most successful security findings come from patient observation, not clever exploits: an exposed admin page, an outdated service banner, a forgotten test server. Metasploit helps with the active parts, but the method comes first.

This lesson covers the method; Nmap and importing results and service enumeration modules cover the tools. Everything assumes the scope and authorization from the lab lesson.

Passive versus active

Passive recon learns about a target without sending traffic to it: public records, search engines, certificate transparency logs, DNS records you can query through public resolvers, job postings, code repositories and documentation. The target cannot see it. Even so, some passive techniques (for example scraping someone's personal social media) can be unethical or restricted by the contract, so check the rules.

Active recon sends packets to the target: ping sweeps, port scans, banner grabs, web crawling. It can be logged and can disturb fragile services, so it needs authorization and sometimes a time window.

Passive recon

Public records DNS, WHOIS, certificates.
Documents Job ads and docs hint at tech.
No contact Target sees nothing.

Start here; it is free and safe.

1 / 2

What you want to learn

Build a picture in layers.

  1. Scope inventory. Which networks, domains and applications belong to the target.
  2. Live hosts. Which addresses are really in use.
  3. Services. Open ports and what runs on them, with versions.
  4. Technology. Operating systems, web servers, frameworks, databases.
  5. Weak spots. Old versions, default pages, misconfigurations, exposed management interfaces.
  6. People and processes (only if in scope): email formats, public roles. Many tests exclude this part.
flowchart LR
    A["Scope list"] --> B["Passive intel"]
    B --> C["Host discovery"]
    C --> D["Port and service scan"]
    D --> E["Version and technology ID"]
    E --> F["Candidate weaknesses"]
    F --> G["Validate with care"]

Each layer narrows the next. Skipping layers produces noisy, unfocused testing.

Noise and risk

Every active technique has a footprint. A full TCP scan of 65,535 ports on many hosts is loud; a targeted scan of a few ports is quiet. Scanning fragile equipment (industrial controllers, old printers, medical devices) can hang it. Your rules of engagement should state scan speed and allowed hours. A good default: start with fewer, more informative probes, and widen only when needed.

Metasploit controls speed through module options such as THREADS and timeouts; Nmap has timing templates -T0 to -T5.

The defender's side: shrinking what recon finds

For every thing an attacker can learn, there is a mitigation:

An attacker learns Defence
Open ports Close unused services; firewall by default-deny
Exact software versions in banners Reduce or hide version banners; patch anyway
Forgotten hosts Maintain an asset inventory and decommission old systems
Internal names in public DNS or certificates Split-horizon DNS; avoid leaking internal hostnames
Employee details Awareness training; limit public org details
Directory listings, test pages Disable them; review web server defaults

Remember that hiding a banner is not a fix: security by obscurity delays but does not stop a determined tester. Patching and closing services is the fix.

A small recon planner

The stand-in builds a checklist of recon tasks for a scope and records which are passive or active so you can run the passive ones first. It is a plain planning aid; it sends nothing.

Python Order recon tasks: passive first

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.

Estimating scan size

Before you launch an active scan, estimate how much traffic it creates: hosts times ports times retries. That helps you stay inside the agreed limits and warn the owner.

Python Estimate the size of a scan

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.

A /16 with only three ports is already 400,000 probes, far more than a /24 with three ports. This is why planning matters.

Record as you go

Write what you find in Metasploit's notes (notes -a) or in your log, with the time and the source. Findings that are not recorded cannot go in the report, and notes help the client to correlate your activity with their monitoring.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is passive reconnaissance?

    Passive recon uses public sources so the target does not see contact.
  2. 2. Why should you run passive tasks first?

    Passive intel focuses active probing and avoids unnecessary noise.
  3. 3. Which is the real fix for version banners revealing old software?

    Hiding banners is obscurity; patching removes the vulnerability.
  4. 4. Why estimate the number of probes before scanning?

    Hosts, ports and retries multiply quickly; estimates help you respect limits.

Summary

  • Recon builds layers: scope, live hosts, services, technology, weak spots.
  • Do passive work first; active work is logged and can disturb systems.
  • Defenders reduce exposure by closing services, patching and keeping an inventory.
  • Estimate and record your activity.

Next: Nmap and Importing Results