learn/phase-2/p2-w8/lesson 02
Milestone 8 · lesson 2

Reconnaissance & The Enumeration Workflow

Hands-on: try whois, nslookup, traceroute, telnet and netcat in the sandbox terminal.
Lab: First Contact

Pull the target's homepage and read what the developers left in the source.

What you'll learn

  • Define reconnaissance and explain why it is the foundation every later stage depends on.
  • Tell passive and active recon apart, with real scenarios for when to use each.
  • Use core passive sources: whois, nslookup, dig, dnsdumpster, Shodan, Censys, Google dorks, GitHub dorks.
  • Use core active techniques: browser dev tools, Wappalyzer, ping, traceroute, telnet, netcat.
  • See enumeration as a funnel, from everything the target owns down to specific weaknesses.

Reconnaissance & The Enumeration Workflow

What is reconnaissance?

Reconnaissance (recon) is the very first phase of any security assessment: gathering as much information about a target as possible, before you touch it, scan it, or attempt anything. Think of it like a burglar casing a house for a week before ever trying a door: watching who comes and goes, noting which windows are left open, reading the mail left in the box. None of that requires breaking in, and by the time they act, they already know exactly where to go.

In security work, recon answers questions like: What domains and subdomains does this company own? What software do they run, and which versions? Who works there, and what have they accidentally leaked online? Every later stage, scanning, exploitation, reporting, is only as good as the recon that fed it. Skip it, and you are guessing; do it properly, and the target's own weaknesses point the way.

Passive vs active recon, with real scenarios

PassiveActive
Talks to the target?No, queries third partiesYes, sends traffic straight to the target
Detectable by the target?No, invisible in their logsYes, can appear in logs, trip a WAF, or alert a SOC
ExampleReading a domain's whois recordRunning traceroute against their server

Real scenario 1, passive: You are scoping a bug bounty target the night before you're allowed to start. You can legally browse Shodan, read certificate logs, and Google-dork the company's domain right now, none of it touches their infrastructure, so there's nothing to be "in scope" for yet.

Real scenario 2, active: Testing begins tomorrow at 9am per the client's agreement. Only then can you ping their servers, traceroute their network, or open a telnet connection, actions that generate real packets a defender might notice.

The rule professionals follow: exhaust passive first, it's free, silent, and often reveals more than people expect, then go active only for what passive couldn't answer.

Passive recon toolkit

whois, who owns the domain

Every registered domain has public registration details: who registered it, when, which registrar, and which nameservers it uses.

whois acme.com

Real scenario: A phishing domain acme-support.com shows up in a report. whois on it reveals it was registered three days ago through a privacy-shielded registrar, a classic tell for a throwaway phishing site, versus the real acme.com, registered eight years ago by the actual company.

nslookup & dig, resolving DNS by hand

Both look up DNS records for a hostname (which IP does this name point to?).

nslookup acme.com
dig acme.com
dig MX acme.com     # which servers handle their email

dig is the more detailed, script-friendly tool; nslookup is the older, simpler one available on almost every OS by default, useful when you're on a locked-down machine with nothing else installed.

dnsdumpster, a free visual DNS map

dnsdumpster.com is a free web-based tool that maps a domain's DNS records, subdomains, and hosting providers visually, no installation, no account, just enter a domain in the browser. It's often the fastest way to get a first impression of a target's footprint before running any local tools.

Shodan & Censys, search engines for devices

Regular search engines index webpages. Shodan (shodan.io) and Censys (censys.io) index devices, they continuously scan the entire internet and let you search by IP, open port, banner, or even physical location.

org:"Acme Corp"           # Shodan: every device Shodan has seen belonging to Acme
port:3389 country:"US"    # Shodan: exposed Windows Remote Desktop in the US

Real scenario: A pentester searches Shodan for the client's org name and finds a forgotten industrial control panel exposed directly to the internet on port 502, an asset the client's own IT team didn't know was reachable. That single passive search, no scan of their own, found the biggest risk in the whole engagement.

Google dorking, weaponising search operators

Search engines have already crawled and indexed huge amounts of a target's exposed content. Dorking uses advanced search operators to filter that index down to exactly what you want.

site:acme.com filetype:pdf              # PDFs published on their site
site:acme.com inurl:admin               # pages with "admin" in the URL
site:acme.com intitle:"index of"         # exposed directory listings
"acme.com" -site:acme.com filetype:xls   # spreadsheets mentioning them, hosted elsewhere

The community-maintained Google Hacking Database (GHDB) catalogues thousands of these dorks for finding exposed logins, cameras, backups, and more.

(This is only a taste. Search Engine Dorking is a whole lesson on the operators, cross-engine and GitHub dorking, and the GHDB, and Search Engines, Crawlers & robots.txt explains how crawlers build the index a dork queries.)

GitHub dorking, leaked secrets in public code

Developers accidentally commit passwords, API keys, and internal hostnames to public repositories constantly. GitHub's own search, plus dedicated tools, can find them:

org:acme "password"              # on github.com/search: search Acme's public repos for the word "password"
github-subdomains -d acme.com -t <token>   # find subdomains mentioned in public code

Real scenario: A developer at a fintech startup pushes a .env.example file that still contains a real (not example) database password, copy-pasted by mistake. A GitHub dork for the company's org name plus DB_PASSWORD surfaces it within seconds of the commit going public.

(Certificate Transparency logs, crt.sh, subfinder, and amass are covered in depth in the Subdomain Enumeration lesson, they are passive too, just specialised for finding subdomains.)

Active recon toolkit

Browser Developer Tools, free and built into every browser

Press F12 (or right-click, Inspect) on any page. DevTools shows the raw HTML, every network request the page makes, cookies, and any JavaScript, often revealing API endpoints, hidden form fields, or comments developers forgot to remove. It's technically "active" only in the mild sense that you loaded the page normally, exactly what any visitor does.

Wappalyzer, instant technology fingerprinting

Wappalyzer is a browser extension (and API) that identifies the technology stack behind a website the moment you visit it, CMS, JavaScript framework, analytics tools, server software, payment processors, all without running a single scan.

Real scenario: Before choosing an exploit, a tester installs Wappalyzer and instantly sees the target runs WordPress 5.4 with the Contact Form 7 plugin, no manual fingerprinting needed, saving the active whatweb scan for later confirmation.

ping, is it even alive?

ping acme.com

Sends ICMP echo requests to check if a host responds at all. Simple, but it's the fastest first check, and no reply doesn't always mean "down", firewalls often block ICMP while the host is very much up.

traceroute, mapping the path

traceroute acme.com

Shows every router ("hop") a packet passes through on its way to the target, useful for understanding network topology, spotting load balancers or CDNs, and figuring out roughly where a target's infrastructure is hosted.

telnet, manually speaking to a service

telnet acme.com 80
GET / HTTP/1.1
Host: acme.com

telnet opens a raw TCP connection you can type into by hand. Point it at port 80 and you can hand-type an HTTP request; point it at port 22 or 25 and the service often announces itself immediately (a banner) the moment you connect, free version information with zero tooling.

netcat (nc), the Swiss-army knife

nc acme.com 443           # connect to a port manually, like telnet but for any protocol
nc -lvnp 4444             # listen on a port, e.g. to catch a reverse shell

netcat reads and writes raw data over TCP/UDP. It can grab banners, transfer files, or act as a listener, one small tool with more uses than almost anything else in this list.

(masscan, nmap, nikto, gobuster, and ffuf, the heavier active scanning and fuzzing tools, get full lessons of their own: Port Scanning with nmap, Service Enumeration, and Directory & Content Discovery. This lesson only covers the lighter, everyday active tools.)

The enumeration funnel

Once recon fundamentals click, every tool in this week fits one map: start as broad as possible and narrow, stage by stage, down to specific weaknesses.

Scope & OSINT
whois · Shodan · dorks · theHarvester
Subdomains
subfinder · amass · crt.sh
Live hosts
httpx · dnsx · gowitness
Ports & services
nmap · rustscan · nikto
Content, params, JS
ffuf · katana · gau · arjun
Vulnerabilities
nuclei · wpscan · searchsploit

Broad at the top, narrowing to specific weaknesses. Work top-down.

  1. Scope & OSINT , whois, Shodan/Censys, Google/GitHub dorks, dnsdumpster (this lesson).
  2. Subdomains , expand the attack surface: subfinder, amass, crt.sh (its own lesson).
  3. Live hosts , filter with dnsx (resolves) and httpx (live web servers), then gowitness to screenshot for a quick eyeball.
  4. Ports & services , nmap (thorough) or rustscan/masscan (fast), then enumerate each service (its own lesson).
  5. Content, params & JS , ffuf/gobuster for hidden paths (its own lesson), katana/gau to crawl, arjun for hidden parameters (deeper web recon).
  6. Vulnerabilities , nuclei templates, wpscan, searchsploit.

Tools that pipe together

The Unix pipe (from the shell-basics lesson) is what makes recon fast, one tool's output becomes the next tool's input:

subfinder -d target.com -silent | httpx -silent | nuclei -severity high
#   find names        ->    keep live      ->   scan for high-sev bugs

Try it (terminal)

  1. whois acme.com , read a domain's registration record.
  2. nslookup acme.com and dig acme.com , resolve it two different ways.
  3. traceroute acme.com , see the path to the host.
  4. telnet acme.com 80 then type GET / HTTP/1.1 , hand-craft an HTTP request.
  5. nc acme.com 443 , grab a quick TCP connection with netcat.
  6. subfinder -d acme.com then httpx -l subs.txt , the start of the active funnel.

Stay in scope

Passive recon (whois, Shodan, dorking) touches only third parties and is broadly safe to run anytime. The moment you go active, ping, traceroute, telnet, and everything after, only do it against assets you are explicitly authorised to test.

Why this matters

Beginners jump straight to exploiting the first thing they see. Professionals map the whole funnel first, because the easy win is almost always something recon surfaces long before any exploit is written, a leaked key on GitHub, a device exposed on Shodan, a banner that names the exact vulnerable version.

Check your understanding

14 questions

Type an answer and press Check. Grading is keyword-based and forgiving, so short answers are fine.

  1. 1

    A company hires you to find security weaknesses before attackers do. Before touching anything, what is the very first phase of your work called?

  2. 2

    You search Shodan for the target's IP and read its whois record. Have you sent any traffic to the target itself?

  3. 3

    You run traceroute and telnet directly against the target's server. Is this passive or active recon?

  4. 4

    Write the whois command to look up who registered acme.com and when the domain expires.

  5. 5

    You want to see every DNS record type (A, MX, TXT, NS) dnsdumpster.com has mapped for a domain, without installing anything. What kind of tool is dnsdumpster?

  6. 6

    Write a Google dork that finds PDF files exposed on acme.com.

  7. 7

    A developer accidentally committed an API key to a public GitHub repo. Which search technique finds leaked secrets like this across GitHub?

  8. 8

    You open a target's site and use a browser extension that instantly tells you it runs WordPress, PHP, and Nginx. Name that extension.

  9. 9

    Before running any tool, you right-click a webpage and open the browser's built-in inspector to read the page source and network requests. What is this called?

  10. 10

    Write the netcat command to manually connect to port 443 on host 10.10.10.20 (e.g. to grab a banner).

  11. 11

    Which classic command-line tool can manually speak raw HTTP to a web server on port 80, useful when curl isn't available?

  12. 12

    In recon, which do you do first: passive (third-party data) or active (touching the target)?

  13. 13

    After finding subdomains, which tool probes them to keep only the ones running a live web server?

  14. 14

    Write the classic one-line pipeline that chains subfinder, httpx and nuclei (names only).