Sem 7

Passive Reconnaissance

Gathering intelligence about a target without touching its systems: DNS lookup tools, WHOIS, web fingerprinting, Google dorking, OSINT tools (Shodan, theHarvester, exiftool) and OSINT frameworks (Maltego, SpiderFoot). Covers deck 2.

Reconnaissance is the phase where the adversary gathers information about the target. The gathered information is leveraged in later phases — to plan and execute initial access, to scope and prioritise post-compromise objectives, or to drive further reconnaissance. Based on interaction with the target there are two types: passive and active.

Objectives of information gatheringSearch on YouTube

  • Build a blueprint of the target's organisational structure, network information and host information.
  • Understand the target's overall security posture and where flaws exist, so the tester can focus on the low-hanging fruit.

Types of information collected:

  • Network / host information — IP addresses, DNS, servers.
  • Employee information — name, identity, email, role.

Passive reconnaissance means gathering information without direct contact with the target's hosts. It uses third-party and public sources, so it is effectively undetectable by the target.

DNS lookup toolsSearch on YouTube

ToolPurpose
hostSimple DNS lookup utility for domain names and IP addresses.
nslookupQuery internet name servers for domain-to-IP mappings.
digDNS lookup utility ("domain information groper").
dnsreconGather DNS-related information about a domain.
host example.com              # simple DNS lookup
host -t ns example.com        # -t = record type; ns = Name Server records
nslookup example.com          # query internet name servers
dig example.com               # DNS lookup (domain information groper)
dnsrecon -d example.com       # gather DNS info about a domain

The -t flag of host specifies the record type; ns asks for Name Server records.

WHOIS and web fingerprintingSearch on YouTube

whois microsoft.com           # domain registration info from public WHOIS databases
wafw00f <target-website>      # detect a Web Application Firewall protecting a site
whatweb iiitkottayam.ac.in    # fingerprint the technology stack behind a site
  • WHOIS retrieves domain registration information (registrar, contacts, dates). Web version: who.is.
  • wafw00f detects Web Application Firewalls protecting a target, so you know the defences before attacking.
  • whatweb reveals the web technology stack. If it shows, for example, PHP 7.4.22, you can look up vulnerabilities tied to that version.

Other passive-recon sites: sitereport.netcraft.com and dnsdumpster.com.

OSINT harvesting toolsSearch on YouTube

theHarvester -d microsoft.com -b all   # email / OSINT harvesting (-b = source)
sublist3r -d hackersploit.org          # subdomain enumeration
exiftool <file>                        # read metadata of images, audio, video, docs
man exiftool
  • theHarvester gathers OSINT on a company — mainly email harvesting. -d is the domain, -b the data source (all uses every source).
  • Sublist3r enumerates subdomains of a domain.
  • exiftool reads, writes and edits metadata embedded in files, especially images (author, software, GPS, timestamps). Useful on files publicly linked to a domain.
  • Sherlock hunts a username across social networks.

Google dorkingSearch on YouTube

Google Dorking (Google Hacking) uncovers sensitive information exposed on the web using advanced search operators. These queries are passive — they search Google's index, not the target directly.

OperatorPurposeExample
site:Search within a specific sitesite:gov.in
filetype:Find specific file typesfiletype:pdf
intitle:Keywords in the page titleintitle:"index of"
inurl:Search in the URLinurl:admin
cache:View Google's cached versioncache:example.com
ext:Alias for filetype:ext:xls
"text"Exact-match search"confidential report"
-Exclude a wordpassword filetype:txt -github
site:microsoft.com
site:microsoft.com -www.microsoft.com
site:*.iiitkottayam.ac.in
intitle:hacking tools
intitle:"hacking tools"
inurl:"login"
filetype:pdf penetration testing
inurl:microsoft.com filetype:pdf

The quotes matter: intitle:hacking tools finds "hacking" in the title and "tools" anywhere on the page, while intitle:"hacking tools" requires the exact phrase in the title.

OSINT tools and frameworksSearch on YouTube

OSINT (Open-Source Intelligence) tools collect and analyse publicly available information for investigations, reconnaissance and threat intelligence, without hacking or unauthorized access.

  • haveibeenpwned.com — check whether an email appears in known breaches.
  • Shodan — a search engine for devices (webcams, routers, servers, industrial systems, IoT), not websites. Create queries to find exposed services.
port:21 country:US            # devices with FTP (port 21) open in the US

Example Shodan queries: all devices running Apache in India; devices with open FTP (port 21) in the US.

Automated OSINT frameworksSearch on YouTube

ToolDescription
MaltegoVisual link analysis using transforms — graphs relationships between emails, domains, IPs and people.
SpiderFootFully automated OSINT scanner with a GUI.
OSINT FrameworkA web-based directory of OSINT tools (osintframework.com).
# Maltego on Kali
sudo apt update
sudo apt install maltego
maltego

# SpiderFoot
spiderfoot -l 127.0.0.1:5001   # then open in the browser and create a new scan

Maltego's Data Hub connects to external providers: Utilities (basic transforms: Domain, IP, DNS, Website), VirusTotal (malware reports, malicious IPs, hashes), AlienVault OTX (threat indicators / IOCs), OpenCTI (threat actors, malware, campaigns, MITRE ATT&CK), Shodan (open ports, services, banners), HaveIBeenPwned (breached emails), News, and MaxMind (IP geolocation). Choose the Community edition.

The OhSINT TryHackMe room is the passive-recon exercise: from a single image you geolocate and profile a target using only open sources — reverse image search, exiftool on the downloaded image for GPS/author metadata, and searching the discovered username across social media. No packet ever touches the target.

Exam scenarios ask you to list passive techniques for a named domain and justify each. Match the task to the tool: metadata from images = exiftool; historic DNS/subdomains without probing = DNSDumpster / certificate transparency / crt.sh; relationships between people and infrastructure = Maltego; broad automated correlation = SpiderFoot; public tech stack = whatweb / Wappalyzer / BuiltWith.

To limit passive-recon exposure: minimise information in WHOIS (use privacy protection), strip metadata from published files, keep internal hostnames out of public DNS, avoid leaking the tech stack in headers and job postings, and monitor breach databases for exposed credentials.

Quick self-testSearch on YouTube

What distinguishes passive from active reconnaissance?

Passive recon gathers information only from third-party and public sources, with no direct contact with the target's hosts, so it leaves no trace. Active recon interacts directly with the target and leaves traces in its logs.

Which command asks only for the name-server records of a domain?

host -t ns example.com — -t sets the record type and ns requests Name Server records.

What does whatweb tell you, and why is it useful to an attacker?

It fingerprints the technology stack behind a website (server, CMS, languages and versions). Knowing an exact version, e.g. PHP 7.4.22, lets the attacker look up vulnerabilities for that version.

Write a Google dork to find PDF and Word files on aurorashop.io.

site:aurorashop.io filetype:pdf OR filetype:doc OR filetype:docx. It can reveal leaked documents, manuals and their metadata.

How does Shodan differ from Google?

Google indexes websites; Shodan indexes internet-connected devices and services (webcams, routers, servers, IoT), letting you search by port, product and country.

What is the difference between intitle:hacking tools and intitle:"hacking tools"?

The first finds "hacking" in the page title and "tools" anywhere on the page. The quoted form requires the exact phrase "hacking tools" in the title.

Which tool extracts metadata from a publicly linked image, and what can it reveal?

exiftool. It can reveal author name, the software used, GPS coordinates and timestamps embedded in the file.

Name two automated OSINT frameworks and what each does.

Maltego — visual link analysis using transforms to graph relationships between people, domains and IPs. SpiderFoot — a fully automated OSINT scanner (GUI) that correlates data from many sources.

What is theHarvester used for, and what do -d and -b mean?

Gathering OSINT (mainly emails) on a company. -d sets the target domain and -b sets the data source (all uses every source).

  • Passive reconnaissance gathers intelligence without touching the target's systems, using public and third-party sources.
  • DNS tools: host, nslookup, dig, dnsrecon. whois gives registration info; wafw00f detects WAFs; whatweb fingerprints the tech stack.
  • OSINT harvesting: theHarvester (emails), sublist3r (subdomains), exiftool (file metadata).
  • Google dorking uses operators (site:, filetype:, intitle:, inurl:, cache:, ext:, -) to find exposed information.
  • Shodan searches internet-connected devices by port, product and country.
  • Automated OSINT frameworks: Maltego (visual link analysis) and SpiderFoot (automated scanner); the OhSINT room practises image-based OSINT.