Перейти к основному содержимому
Passive & Active Information Gathering
Урок 2 из 11

Passive & Active Information Gathering

Distinguish passive OSINT from active network probing, discover subdomains and live hosts within an authorised scope, and reduce an organisation's exposed footprint.

Средний 26 мин Пентест
Этого урока пока нет на выбранном языке — показана версия на другом языке. Перевод готовится.
Только в разрешённой среде — Описанные здесь приёмы применяются только в учебных лабораториях и в системах, которые принадлежат вам или на которые есть письменное разрешение.

Цели обучения

  • Distinguish passive information gathering from active reconnaissance by traffic visibility and detection risk
  • Enumerate domains, DNS records, and subdomains using WHOIS, Certificate Transparency, amass, and subfinder
  • Verify live hosts and virtual hosts safely inside an authorised lab scope using dig and Nmap
  • Identify common reconnaissance mistakes and explain how defenders monitor and shrink external attack surfaces

Рекомендуется заранее: Методология пентеста, правила взаимодействия (RoE) и этика

#Why this matters

Every engagement and defensive audit starts by mapping what actually exists. Organisations often assume their perimeter consists of one website and a mail server, yet forgotten staging portals, old cloud buckets, and misconfigured DNS records expand the attack surface over time.

Good reconnaissance answers two questions before any exploit is considered: what assets belong to the target, and which ones are live and in scope. Defenders run the same workflow to catch shadow IT and leaked metadata before attackers do.

#Passive versus active reconnaissance

The core distinction is where your packets go. Passive techniques query public registries, search engines, and Certificate Transparency logs so target firewalls never see your traffic. Active techniques send DNS queries, ICMP echo requests, or TCP probes directly to target infrastructure.

Aspect Passive reconnaissance Active reconnaissance
Target contact None (third-party sources only) Direct packets to target assets
Detection risk Very low on target sensors Logged by firewalls, DNS, and IDS
Data freshness May include retired hosts Reflects current live state
Typical sources WHOIS/RDAP, CT logs, passive DNS DNS queries, nmap -sn, HTTP probes

Because passive records can be outdated, a practical workflow gathers passive leads first and then confirms live targets with controlled active checks.

  1. Check ScopeVerify domains and CIDRs in Rules of Engagement
  2. Passive OSINTQuery WHOIS, CT logs, subfinder, amass
  3. Resolve DNSConfirm active A, AAAA, CNAME, and TXT records
  4. Host DiscoveryRun targeted Nmap sweeps on in-scope IPs

#Passive OSINT and DNS discovery

Passive gathering begins with ownership records. Running whois (or querying RDAP) reveals registrar details, name servers, netblock ownership, and autonomous system numbers (ASNs). While privacy redaction hides personal contacts, name servers and IP allocations still point to hosting providers and adjacent ranges.

Subdomain discovery tools query dozens of public sources at once: Certificate Transparency (CT) logs, passive DNS databases, and code repositories. Every public TLS certificate is recorded in append-only CT logs, frequently exposing internal names such as staging-api or vpn. Both subfinder and amass automate this step cleanly.

Passive subdomain enumeration on a lab domain
$ subfinder -d example.test -silent
api.example.test
dev-portal.example.test
mail.example.test
$ amass enum -passive -d example.test
api.example.test
dev-portal.example.test

Do not skip non-web DNS records. TXT records often reveal SPF (v=spf1) mail rules, SaaS verification tokens, and CIDR blocks owned by the organisation.

#Active probing and host discovery

With candidate hostnames collected, active verification separates retired entries from live systems. Start with dig to check whether a hostname resolves to an in-scope IP or points via CNAME to an external CDN.

Verifying DNS records and running host discovery
$ dig +short A dev-portal.example.test
10.10.10.24
$ dig +short TXT example.test
"v=spf1 ip4:10.10.10.0/24 -all"
$ nmap -sn 10.10.10.0/24
Nmap scan report for gateway.lab.local (10.10.10.1)
Host is up (0.0012s latency).
Nmap scan report for dev-portal.lab.local (10.10.10.24)
Host is up (0.0018s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 2.41 seconds

The Nmap -sn flag runs host discovery without port scanning. On local subnets it sends ARP requests; across routed networks it sends ICMP echo, TCP SYN to port 443, TCP ACK to port 80, and ICMP timestamp probes.

Watch for virtual hosts during active checks. Multiple subdomains (app.lab.local, admin.lab.local) can share one IP address, with the web server routing requests using the HTTP Host header.

#Defending and common mistakes

Defenders reduce external exposure through continuous hygiene:

  • Maintain an asset inventory: Retire staging domains promptly instead of leaving forgotten DNS entries active.
  • Keep internal names private: Use a private internal CA for VPN-only services so internal hostnames do not appear in public CT logs.
  • Clean up DNS and transfers: Remove dangling CNAME records (to prevent subdomain takeover) and restrict AXFR zone transfers to authorised secondary name servers.

Common tester mistakes:

  • Scanning third-party IPs: Probing an IP without checking WHOIS or CNAME ownership can hit a CDN or SaaS provider outside scope.
  • Skipping passive recon: Jumping straight into noisy scans misses historical subdomains and alerts the blue team immediately.
  • Trusting unverified OSINT: Reporting passive findings without active DNS checks wastes time on dead hosts.

#Summary

  • Passive reconnaissance gathers intelligence from WHOIS, CT logs, subfinder, and amass without touching target systems.
  • Active reconnaissance queries DNS and probes hosts (such as nmap -sn) to verify live assets, creating target-side logs.
  • Checking ownership and CNAME records before probing prevents out-of-scope traffic to third-party providers.
  • Defenders shrink exposure by inventorying subdomains, keeping internal names out of public CT logs, and removing stale DNS records.

Проверка знаний

Войдите, чтобы проходить тест, завершать уроки и сохранять прогресс. Войти в систему

Практика: проверьте свои знания