Footprinting (Reconnaissance / Information Gathering) là gì?
Footprinting (còn gọi Reconnaissance hoặc Information Gathering) là giai đoạn đầu tiên và quan trọng nhất trong quy trình tấn công mạng (Cyber Kill Chain - Reconnaissance, MITRE ATT&CK - TA0043). Mục tiêu: Thu thập càng nhiều thông tin càng tốt về mục tiêu (target organization/network/system) để xây dựng bản đồ tấn công, xác định bề mặt tấn công (attack surface), phát hiện lỗ hổng tiềm năng và lập kế hoạch xâm nhập.
Phân loại Footprinting
| Loại | Đặc điểm | Ví dụ kỹ thuật |
|---|---|---|
| Passive Footprinting (Thụ động) | Không tương tác trực tiếp với hệ thống mục tiêu. Không để lại dấu vết trong log của target. An toàn cho attacker. | OSINT (Open Source Intelligence): Google Dorks, Shodan, Censys, WHOIS, DNS records, SSL cert (crt.sh), LinkedIn, GitHub, job posting, financial report, breach database (HaveIBeenPwned, DeHashed). |
| Active Footprinting (Chủ động) | Tương tác trực tiếp với target (gửi gói tin, query). Có thể bị phát hiện bởi IDS/IPS/Firewall log. | Port scanning (Nmap), Service enumeration, Banner grabbing, DNS zone transfer (AXFR), SNMP walk, SMB enum, LDAP enum, Web spidering/crawling, Vulnerability scanning (Nessus, OpenVAS). |
Thông tin thu thập được (Footprinting Targets)
- Network Range: CIDR blocks, ASN, BGP prefixes (whois, RADb, Hurricane Electric BGP Toolkit).
- Domain & Subdomain: Enum subdomain (Sublist3r, Amass, Assetfinder, crt.sh, DNSdumpster).
- DNS Records: A, AAAA, MX, NS, TXT (SPF/DMARC), CNAME, SOA (version.bind, hostname.bind).
- IP & Port/Services: Open port, service version, OS fingerprint (Nmap -sV -O, Masscan + Nmap).
- Web Technology Stack: Wappalyzer, BuiltWith, WhatRuns, Header analysis (Server, X-Powered-By, CSP, HSTS).
- SSL/TLS Certificate: crt.sh, Censys, Shodan – xem SAN, issuer, validity, CT log.
- Email & Credentials: Hunter.io, VoilaNorbert, DeHashed, LinkedIn Sales Navigator – spear phishing prep.
- Employee & Org Info: LinkedIn, Facebook, Glassdoor, job description (tech stack reveal), org chart.
- Cloud/DevOps Exposure: GitHub/GitLab/Bitbucket public repo (secrets, API key, config), Docker Hub, npm/PyPI packages, CI/CD logs, Terraform state public.
- Physical & Social: Địa chỉ văn phòng, badge system, vendor, janitor, social engineering vector.
Công cụ Footprinting điển hình (Toolkit 2024)
| Loại | Công cụ |
|---|---|
| OSINT Framework | OSINT Framework (web), Maltego, SpiderFoot, Recon-ng, theHarvester, Sherlock (social media) |
| Network/Port Scan | Nmap (gold standard), Masscan (fast), ZMap, RustScan, Naabu |
| DNS Enum | Amass, Sublist3r, Assetfinder, Subfinder, DNSdumpster, dnsenum, dig/host/drill |
| Web Recon | Wappalyzer, WhatWeb, Nuclei (template-based), Feroxbuster/Dirsearch (content discovery), Katana (crawler) |
| Cloud Asset | CloudEnum, S3Scanner, GCPBucketBrute, AzureBlobScanner, TruffleHog (secrets), GitLeaks |
| Threat Intel / Passive | Shodan, Censys, Fofa, ZoomEye, BinaryEdge, GreyNoise, VirusTotal, AlienVault OTX, URLScan.io |
| Email/People | Hunter.io, VoilaNorbert, RocketReach, LinkedIn, Clearbit, Phonebook.cz |
| Automation Framework | Recon-ng, SpiderFoot HX, AutoRecon, bbot, pwnedOrNot |
Ví dụ quy trình Footprinting thực tế (Red Team / Penetration Test)
- Passive: `whois target.com` → CIDR, registrar, admin email. `amass enum -passive -d target.com` → subdomain list. `curl -s https://crt.sh/?q=%.target.com | grep -oP '(?<=
)[^<]+(?= )' | sort -u` → cert transparency subdomains. `shodan host` → open port, banner, vuln. `github-search "target.com" api_key password` → secrets leak. - Active (có phép / rules of engagement): `nmap -sS -sV -O -p- -T4
-oA nmap_full`. `nmap --script vuln,auth,default `. `enum4linux-ng ` (SMB/LDAP). `ldapsearch -x -H ldap:// -b "dc=target,dc=com"`. `snmpwalk -v2c -c public `. - Correlation: Kết hợp dữ liệu → Attack Surface Map → Ưu tiên target: Internet-facing app (CVE, misconfig), VPN/RDP/SSH exposed, Cloud storage public, Expired cert, Weak cipher, Default cred, Information disclosure (debug page, .git, .env, backup file).
Phòng chống Footprinting (Defensive Perspective)
- Giảm thiểu thông tin công khai (Reduce OSINT Exposure):
- WHOIS privacy protection (redact contact info).
- Chặn DNS Zone Transfer (AXFR) cho unauthorized NS.
- Không publish internal hostname/IP trên DNS public (split-horizon DNS).
- Giới hạn metadata trong SSL cert (không dùng internal hostname trong SAN).
- GitHub/GitLab: Secret scanning (push protection), private repo, không commit secret.
- Job description: Không tiết lộ tech stack chi tiết (version, internal tool).
- LinkedIn: Policy nhân viên không post project/internal tool/architecture detail.
- Phát hiện Reconnaissance (Detect Recon):
- Network: IDS/IPS rule cho port scan (threshold-based), Nmap script detection, honeypot/honeynet (Canary, Thinkst).
- Web: WAF rate-limit, bot detection, anomaly scoring (too many 404, sequential path enum).
- DNS: Monitor AXFR attempt, excessive query volume, DGA detection.
- Email: DMARC/DKIM/SPF strict, phishing simulation, monitor credential leak (HaveIBeenPwned API).
- Deception / Misdirection:
- Honeypot/Honeynet (Cowrie SSH, Dionaea, Conpot, Elasticpot) – thu thập TTP attacker.
- Canary token (DNS, HTTP, AWS keys, PDF, QR) – cảnh báo sớm khi bị truy cập.
- Fake data / Decoy document / Decoy subnet – lãng phí thời gian attacker.
- Hardening giảm bề mặt tấn công:
- Tắt service/port không cần thiết.
- Banner grabbing protection (custom banner, remove version).
- Server header hardening (remove Server, X-Powered-By).
- Disable directory listing, default files.
- Security Awareness: Đào tạo nhân viên nhận diện social engineering, pretexting, phishing, vishing, smishing – vector footprinting con người.
Footprinting trong các khung chuẩn
- MITRE ATT&CK: TA0043 Reconnaissance – T1590 (Active Scanning), T1591 (Gather Victim Org Info), T1592 (Gather Victim Host Info), T1593 (Gather Victim Network Info), T1594 (Search Open Technical Databases), T1595 (Active Scanning), T1596 (Search Open Websites/Domains), T1597 (Search Closed Sources), T1598 (Phishing for Information).
- Cyber Kill Chain (Lockheed Martin): Step 1 – Reconnaissance.
- PTES (Penetration Testing Execution Standard): Pre-engagement → Intelligence Gathering (Footprinting) → Threat Modeling → Vulnerability Analysis → Exploitation → Post-Exploitation → Reporting.
- NIST SP 800-115: Information Gathering (Passive/Active).
Kết luận
Footprinting là mắt xích đầu tiên của chuỗi tấn công – "Know your enemy, know yourself". Người phòng thủ phải giả định kẻ tấn công đã biết mọi thứ public và tập trung: Giảm thiểu OSINT exposure, Phát hiện recon sớm (IDS/IPS/WAF/Honeypot/Canary), Hardening bề mặt tấn công, Đào tạo nhân viên. Công cụ footprinting (Nmap, Amass, Nuclei, Shodan, Maltego...) là vũ khí hai lưỡi – dùng để audit mình trước khi kẻ xấu dùng.