00->1
Learning pathStep 20 of 62How attacks begin ← All writeups

Reconnaissance, Explained

If you are reading this, you have probably seen "recon" as the first step in every attack diagram, and you want to know what it involves, why it matters and how to defend against something that happens outside your network.

By the end you will be able to define reconnaissance, separate passive from active, list what attackers look for, understand where it fits in an attack, and describe how to reduce your exposure. Everything here stays at the level a defender and a learner needs; scanning real systems you do not own is illegal.


1. What reconnaissance is

In MITRE ATT&CK, Reconnaissance is the first tactic: "The adversary is trying to gather information they can use to plan future operations." It covers collecting information about the target organization, its infrastructure and its people, using both active and passive methods (MITRE ATT&CK TA0043).

Recon answers questions like: Who works there? Which systems are on the internet? What software do they run? How do they communicate? Who are their suppliers? The better the answers, the more convincing the later steps, from a tailored phishing email to choosing a vulnerable service.

It is not only for attackers. Authorized testers do the same to understand a client's exposure (see the red team post), and defenders do it to see what an outsider can see.


2. Passive and active reconnaissance

Passive Active
What it is Collecting information that is already published, without touching the target's systems Interacting directly with the target's systems to get information
Examples Search engines, social media, public records, code repositories, DNS and WHOIS records, certificate logs, scan databases Scanning IP ranges, probing for open ports and services, vulnerability scanning, guessing hidden web paths
Visible to the target? Generally not Often, since it creates network traffic
Needs permission? Public sources are open to anyone, but personal data rules and site terms still apply Yes. Scanning systems you do not own or have no permission to test is not allowed

MITRE defines active scanning as when "the adversary probes victim infrastructure via network traffic, as opposed to other forms of reconnaissance that do not involve direct interaction" (T1595). Passive collection from public sources is the area of OSINT.


3. What attackers gather

MITRE lists these categories of information gathering about a victim:

Category Examples
Identity Names, email addresses, credentials, employee roles
Organization Business relationships, locations, roles and responsibilities
Network Domain names, DNS, IP ranges, network topology and security appliances
Host Hardware, software and operating system details, client configurations

and these ways of getting it:

Technique What it means
Active Scanning (T1595) Scanning IP blocks, vulnerability scanning, and wordlist scanning (guessing directories or pages)
Search Open Websites and Domains (T1593) Social media, search engines and code repositories
Search Open Technical Databases (T1596) Passive DNS, WHOIS, digital certificates, CDN data and internet scan databases
Phishing for Information (T1598) Tricking people into revealing details
Search Closed Sources (T1597) Using paid or private threat intelligence and data

Examples of groups using open-web research, listed by MITRE: researching banks to build convincing phishing pages, and web searches about victims before compromise (T1593).

Why it works

  • Organizations publish a great deal without noticing: job adverts reveal technologies, staff pages reveal names and roles, and a public code repository may contain keys or internal hostnames.
  • Internet-facing services can be found by anyone. Scan databases and certificate logs show which hosts and subdomains exist.
  • Social media shows relationships and routines.

4. Where it fits

Recon is the opening step, and the information feeds everything after it:

  1. Recon: learn about the target.
  2. Initial access: use that knowledge, for example a targeted phishing email, or a flaw in an exposed service.
  3. Execution, persistence, privilege escalation, and so on (see the privilege escalation post).

Some of the best-known social engineering attacks depend entirely on this step. Impersonation and spear phishing only work if the attacker knows the right names, roles and projects.


5. Seeing it from the defender's side

You cannot easily stop it

MITRE's guidance for these techniques is blunt: they "cannot be easily mitigated with preventive controls since [they are] based on behaviors performed outside of the scope of enterprise defenses." Detection is also hard, because much of the activity "may have a very high occurrence and associated false positive rate" and often takes place outside the target's visibility (T1596).

So the realistic strategy has three parts.

Part 1: Know and reduce your exposure

Action Why
Inventory what is on the internet (domains, subdomains, IP addresses, services) You cannot protect what you have forgotten
Look at yourself as an outsider (search engines, certificate logs, scan databases, WHOIS) Find what an attacker finds first (see the safe exercises in the OSINT post)
Close or restrict what does not need to be public Fewer exposed services means fewer targets
Keep secrets out of public code. MITRE advises developers to "avoid publishing sensitive information such as credentials and API keys" and to scan public repositories for exposed credentials A common and easy mistake
Limit public detail about staff and technology Job adverts, staff directories and social media posts can reveal too much
Use WHOIS privacy where appropriate and keep registration data minimal Reduces contact information available
Keep exposed software patched Active scanning finds known-vulnerable versions fast

Part 2: Detect what you can

Active reconnaissance leaves traces. MITRE suggests monitoring for uncommon data flows, unusual traffic patterns that deviate from protocol standards, and gratuitous packets. In practice:

  • Review firewall and intrusion detection logs for scans and repeated probing.
  • Watch for bursts of requests to many paths or ports from one source.
  • Treat reconnaissance as a signal, not an incident: scanning of the internet is constant. Look for scans followed by attempts against the same system.

Remember the lesson from the false positives post: with a very high volume of recon traffic, alert on the combination (scan, then exploitation attempt, then a login) rather than on every probe.

Part 3: Assume the attacker knows

Since recon is hard to stop, make the later stages difficult: multi-factor authentication, verification steps for money and credential requests, least privilege, patching, and monitoring.


6. Doing it legally and safely

Authorized reconnaissance is a normal part of security work. The rules:

  • Passive on your own organization is safe and encouraged.
  • Active on systems you own or have written permission to test. Even tools designed for scanning warn about this. The nmap documentation stresses scanning only systems you own or have explicit permission to test. NIST's testing guide (SP 800-115) also notes that scanning "can disrupt network operations by consuming bandwidth and slowing network response times," so it must be planned and scoped.
  • Agree the scope and rules of engagement in writing before any testing against a client.
  • Respect privacy. Gathering personal information about individuals raises legal and ethical issues even if it is public.
  • Practise in a lab or on platforms built for it.

7. Common mistakes

Myth The facts
"Recon is just scanning" Scanning is one active method. Most recon is passive and uses public information
"If it is public, there is no harm in collecting it" Privacy law and ethics still apply, particularly for personal data
"We would notice if we were being scanned" Passive recon is invisible to you, and active scans of the internet are constant
"Hiding our systems stops recon" Obscurity alone does not work. Reduce exposure and secure what remains
"Recon does not matter, only exploits do" Quality of recon decides how convincing and efficient the attack is
"Scanning my neighbour's network is harmless practice" It can be illegal and can disrupt services. Use your own lab

Closing

Reconnaissance is how attackers learn what they need before they strike, and it is the stage you can least prevent because it mostly happens outside your systems. The effective response is to know what you expose, reduce it, detect the active parts, and build defences that still work when the attacker knows a lot about you.

Keep these points:

  • Passive uses public information; active touches the target's systems.
  • Attackers gather identity, organization, network and host information.
  • It is hard to prevent and hard to detect, so reduce exposure and watch for follow-on behaviour.
  • Look at yourself as an outsider regularly.
  • Only scan what you own or are authorized to test.