Study guide

4.3 Search Engine Reconnaissance, Google Dorking & Information Leakage

CREST Practitioner Security Analyst CPSA

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Soft Skills, Legal Framework & Assessment Management

1.1 The Penetration Testing Engagement Lifecycle & Scoping 1.2 Legal Framework: Computer Misuse Act & Compliance 1.3 Understanding, Explaining & Managing Technical Risk 1.4 Record Keeping, Interim Escalation & Reporting Standards

2 Chapter 2: Core Networking: IP Protocols & Network Architectures

2.1 IPv4 and IPv6 Addressing, Subnetting & Header Architecture 2.2 TCP and UDP Transport Protocols & Handshake Mechanics 2.3 ICMP Protocol, Network Diagnostics & Error Messages 2.4 Network Topologies, Switched Media & VLAN Segmentation 2.5 Network Media, Ethernet Standards & Physical Topologies

3 Chapter 3: Cryptography & Secure Communication Protocols

3.1 Symmetric & Asymmetric Cryptographic Algorithms 3.2 Cryptographic Hash Functions, MACs & Digital Signatures 3.3 Secure Protocols: SSL/TLS, IPsec & SSH

4 Chapter 4: Background Information Gathering & OSINT Reconnaissance

4.1 WHOIS Records, Domain Registrars & Autonomous Systems 4.2 DNS Infrastructure, Record Types & Zone Transfers 4.3 Search Engine Reconnaissance, Google Dorking & Information Leakage 4.4 Newsgroups, Mailing Lists & Public Archive Reconnaissance

5 Chapter 5: Networking Equipment & Infrastructure Protocols

5.1 Router & Switch Management: SNMP, SSH & Authentication 5.2 Layer 2 Protocols: ARP, CDP, STP, VTP & Redundancy 5.3 Core Network Services: DHCP, NTP & TFTP 5.4 Wireless Security (802.11) & VoIP Assessment 5.5 Out-of-Band Management, Console Access & Cisco Reverse Telnet

6 Chapter 6: Network Mapping, Nmap Techniques & Target Identification

6.1 Host Discovery Techniques & Ping Sweep Methodologies 6.2 Port Scanning Mechanics: TCP, UDP & Stealth Scans 6.3 OS Fingerprinting, Service Detection & Timing Templates 6.4 Firewall and IDS/IPS Evasion Techniques 6.5 Passive OS & Service Fingerprinting 6.6 Network Access Control Analysis & Firewall Rule Base Review

7 Chapter 7: Vulnerability Identification & Tool Output Analysis

7.1 Vulnerability Scanning Principles & Methodology 7.2 CVE Referencing, CVSS Scoring & Risk Prioritisation 7.3 Banner Grabbing, Service Verification & Manual Triage 7.4 Host Audit Techniques: Processes, Sockets, Patch Levels & Interesting Files

8 Chapter 8: Microsoft Windows Security Assessment & Active Directory

8.1 Active Directory Architecture & Domain Reconnaissance 8.2 Windows User & Group Enumeration via SMB & RPC 8.3 Windows Authentication: NTLM, Kerberos & Password Security 8.4 Windows Patch Management, Local Security & Common Services 8.5 Windows File System, Share & Registry Permissions 8.6 Desktop Lockdown, Citrix Breakout & Common Windows Applications

9 Chapter 9: Unix & Linux Security Assessment & Legacy Services

9.1 Linux/Unix Security Architecture, Permissions & Filesystem 9.2 Unix User Enumeration & Service Discovery 9.3 Network File System (NFS) & RPC Services Assessment 9.4 Legacy Unix Services: R-Services, X11, FTP & Modern SSH 9.5 Unix Remote Information Services: rusers, rwho, finger & systat 9.6 Unix Vulnerability Exploitation & Post-Exploitation Workflow

10 Chapter 10: Web Architectures, Technologies & Testing Methodologies

10.1 Web Server Architecture & the HTTP/HTTPS Protocol 10.2 Web Application Components, Frameworks & State Management 10.3 Web Reconnaissance, Content Discovery & Threat Modelling 10.4 Testing Authentication, Authorization & Session Management 10.5 Web Service Protocols: SOAP, REST & XML Messaging 10.6 Web APIs, Server Extensions & Client-Side Sub-Components

11 Chapter 11: Web Testing Techniques & OWASP Top Vulnerabilities

11.1 Input Validation Vulnerabilities & Parameter Manipulation 11.2 Cross-Site Scripting (XSS): Types, Impact & Defenses 11.3 Cross-Site Request Forgery (CSRF) & Client-Side Attacks 11.4 Command Injection, File Upload Vulnerabilities & API Flaws 11.5 Information Disclosure: Error Messages & Mark-up Leakage 11.6 Injection Beyond SQL: LDAP, XPath, Code & Template Injection 11.7 Source Code Review & Encoded/Cryptographic Value Analysis

12 Chapter 12: Database Security Assessment & SQL Injection

12.1 Database Architectures, Default Ports & Authentication 12.2 SQL Injection (SQLi) Foundations & In-Band Techniques 12.3 Blind SQL Injection & Database Enumeration 12.4 Database Attack Vectors, Stored Procedures & Hardening

4.3 Search Engine Reconnaissance, Google Dorking & Information Leakage

Key Takeaways Explain This Topic AI

Advanced search operators (site:, filetype:, intitle:, inurl:, intext:, cache:) enable passive discovery of exposed admin portals, sensitive configuration files, and unindexed internal resources via the Google Hacking Database (GHDB).

Public code repositories (GitHub, GitLab, Bitbucket) and paste sites frequently leak high-value secrets including hardcoded API tokens, private SSH keys, and cloud database connection strings, detectable with automated pattern-matching tools like TruffleHog and Gitleaks.

Electronic documents (.pdf, .docx, .xlsx) and image files (EXIF) contain rich embedded metadata revealing internal usernames, filesystem paths, corporate printer models, software versions, and GPS coordinates.

Email header inspection (Received: headers) traces the chronological hop-by-hop transmission path of messages from bottom to top, revealing internal server hostnames, non-routable private IP addresses, MTA versions, and SPF/DKIM/DMARC alignment status.

Last updated: September 2026

4.3 Search Engine Reconnaissance, Google Dorking & Information Leakage

Search engines continuously index the World Wide Web using automated web spiders. In the process, they index not only public marketing pages but also misconfigured staging environments, exposed administrative interfaces, sensitive documents, and leaked credentials. For the CREST Practitioner Security Analyst (CPSA), search engine reconnaissance—often referred to as Google Dorking —along with code repository mining, metadata extraction, and email header analysis, represents a core capability for passive information gathering.

1. Search Engine Operators & The Google Hacking Database (GHDB)

Search engines parse web pages and store indexed terms across specific document fields: URL strings, page titles, text bodies, file extensions, and HTTP headers. Standard queries search broad keyword indices; advanced search operators force the search engine to query specific field indices with Boolean precision.

Advanced Search Operators

Operator Function Example Query Reconnaissance Objective

site: Restricts results to a specific domain, subdomain, or TLD. site:target.com Maps all indexed pages within the organization's domain.

filetype: / ext: Restricts search to specific file extensions. site:target.com filetype:pdf Discovers sensitive document types (PDF, DOCX, XLSX, SQL).

intitle: Searches for terms within the HTML <title> tag. intitle:"index of /" Locates web servers with open directory browsing enabled.

allintitle: Requires all following terms to appear in the <title> tag. allintitle: admin login portal Identifies administrative authentication portals.

inurl: Searches for terms anywhere within the URL path. inurl:/wp-content/uploads/ Locates uploaded file directories and CMS plugin paths.

allinurl: Requires all following terms to appear within the URL. allinurl: /api/v1/ users Uncovers undocumented or unlinked API endpoints.

intext: Searches strictly within the visible body text of the webpage. intext:"confidential" Hunts for internal disclosures or data classifications.

cache: Displays Google's cached snapshot of a specific page. cache:target.com/page.html Inspects recently modified or deleted pages; bypasses WAF blocks.

- (Negation) Excludes results matching the specified term or operator. site:target.com -site:www.target.com Eliminates main marketing pages to isolate obscure subdomains. Advanced Operator Anatomy:

  • site:target.com AND filetype:env AND intext:"DB_PASSWORD"
  • │ │ │
  • Restricts to Target Filters to DotEnv Ensures High-Value Credential
  • Domain Scope Configuration Files String Exists in Plaintext
  • The Google Hacking Database (GHDB)

Maintained by Offensive Security on Exploit-DB, the Google Hacking Database (GHDB) is an categorized repository of search queries designed to uncover security vulnerabilities, information disclosures, and exposed infrastructure:

Directory Traversal & Open Directory Listings:

site:target.com intitle:"index of /" "parent directory"

Impact: Web servers configured without default index documents ( index.html or index.php ) often display raw directory trees, allowing testers to browse and download internal files.

Exposed Configuration Files & Environment Secrets:

  • site:target.com filetype:env "DB_PASSWORD"
  • site:target.com ext:xml inurl:web.config
  • site:target.com filetype:ini inurl:php.ini

Impact: Exposes database credentials, mail server tokens, application secrets, and internal server paths.

Public Database Dumps & Log Files:

  • site:target.com filetype:sql ("dump" OR "INSERT INTO")
  • site:target.com filetype:log inurl:error.log

Impact: Exposes raw database schemas, customer data, and stack traces revealing software versions and filesystem architectures.

Backup Files & Editor Swap Files:

site:target.com (ext:bak OR ext:old OR ext:swp OR ext:backup OR ext:zip)

Impact: Developers frequently edit production scripts in text editors (like Vim or nano) or create ad-hoc backups ( config.php.bak ). Web servers do not execute .bak or .swp extensions as PHP; instead, they serve them as plaintext , completely leaking underlying source code and database connection strings.

Authentication Portals & Management Consoles:

  • site:target.com (inurl:login OR inurl:admin OR inurl:portal)
  • site:target.com intitle:"Dashboard [Jenkins]"
  • site:target.com inurl:phpmyadmin/index.php

Impact: Locates attack targets for password spraying, credential stuffing, or default credential exploitation.

2. Code Repository & Paste Site Leakage

Modern software development relies heavily on version control platforms (GitHub, GitLab, Bitbucket). Developers under commercial pressure frequently commit sensitive infrastructure secrets to public repositories.

Types of Leaked Credentials

Cloud Provider API Keys: AWS Access Key IDs ( AKIA[0-9A-Z]{16} ), Google Cloud Platform API keys ( AIza[0-9A-Za-z\-_]{35} ), Azure Storage connection strings.

Payment & SaaS Tokens: Stripe secret keys ( sk_live_[0-9a-zA-Z]{24} ), Slack webhooks ( hooks.slack.com/services/... ), SendGrid API keys.

Cryptographic Keys: Private SSH keys ( -----BEGIN RSA PRIVATE KEY----- ), TLS certificates, JSON Web Token (JWT) HMAC signing secrets.

Database Connection Strings: URIs containing cleartext credentials: postgres://dbadmin:P@ssw0rd123!@db.target.corp:5432/prod_db .

The Danger of Git Commit History

A common misconception among junior developers is that removing a secret in a subsequent commit neutralizes the exposure. In Git, every commit is cryptographically preserved in the repository's .git history : # A secret committed in revision A remains accessible even after deletion in revision B

  • git log -p -- path/to/config.json
  • # An attacker simply checks out the historical commit to recover the active key
  • git checkout HEAD~1
  • Automated Secret Detection Tools

TruffleHog: Scans entire Git commit histories, filesystems, and S3 buckets. Utilizes regular expressions combined with Shannon Entropy analysis to detect high-entropy strings characteristic of encrypted or base64-encoded secrets. Crucially, TruffleHog includes automated live validation modules that query provider APIs (e.g., verifying whether an AWS key is active and determining its IAM permissions).

Gitleaks: A fast, lightweight, Go-based regex scanner designed for continuous integration (CI/CD) pipelines to intercept secrets before they are pushed to remote repositories.

Paste Sites & Scraping Portals

Sites like Pastebin , Ghostbin , and JustPaste.it serve as temporary staging grounds for code snippets, debug outputs, and malicious threat actor dumps. Analysts monitor paste feeds using automated scraping tools (e.g., pastehunter ) to alert whenever target corporate email domains or internal IP ranges are posted.

3. Document Metadata Extraction & EXIF Analysis

Every time an employee creates an electronic document or takes a photograph, the originating software embeds metadata into the file structure. Organizations publish thousands of PDF whitepapers, Word manuals, and Excel financial reports to their public websites. Inadvertently, these files contain rich intelligence regarding internal operations. Public PDF Download ──► [ ExifTool / FOCA Metadata Analysis ]

  • │
  • ┌─────────────────────────────┼─────────────────────────────┐
  • ▼ ▼ ▼
  • [ Usernames & Accounts ] [ Software Versions ] [ Network Paths & Shares ]
  • jsmith • Microsoft Word 2016 (v16.0) • \\srv-fs01\finance\2026\
  • bwilson • Acrobat Distiller 11.0 • \\dc01\sysvol\corp\scripts
  • admin_svc • LibreOffice 7.2 • PRN-LON-CORP-HP608 (Printer)
  • Intelligence Disclosed in Office & PDF Metadata

Usernames & Email Formats: The Author , Creator , and Last Modified By properties frequently record network login names ( jsmith , svc_finance ). This eliminates guesswork when building username lists for subsequent password spraying attacks.

Software & OS Versions: The Producer and Application tags record exact software versions (e.g., Microsoft Office 2013 on Windows 7 ), allowing testers to identify vulnerable, unpatched client-side applications for client-side exploitation.

Network Paths & File Shares: Universal Naming Convention (UNC) paths embedded in document templates or linked objects reveal internal file server names and directory structures (e.g., \\fs01.corp.local\Shared\HR ).

Printer Models: Embedded print job properties disclose internal printer models and network printer share names ( HP LaserJet Enterprise M608 on prnt-srv-02 ).

Image EXIF (Exchangeable Image File Format) Analysis

Photographs taken with digital cameras or smartphones embed EXIF metadata:

Camera Hardware: Make, model, and lens specifications.

Timestamps: Exact date, time, and time zone of photo creation.

GPS Geolocation: Precise latitude, longitude, and altitude coordinates.

Testing Implication: Photographs of corporate data centers, office security badges, or server racks posted to corporate social media or corporate blogs can be analyzed to reveal exact physical coordinates and internal equipment models.

Metadata Extraction Tools

exiftool : The gold standard command-line utility for reading, writing, and manipulating metadata across hundreds of file types: # Extract all metadata from a target PDF document

exiftool -a -u -g1 document.pdf

  • # Extract GPS coordinates from an image
  • exiftool -GPSLatitude -GPSLongitude server_room.jpg
  • # Secure sanitization: strip all metadata from a file before publication
  • exiftool -all= clean_document.pdf

FOCA (Fingerprinting Organizations with Collected Archives): An automated reconnaissance tool that searches Google, Bing, and DuckDuckGo for files matching specific extensions ( .pdf , .doc , .xls , .ppt ) belonging to a target domain, downloads them, extracts all metadata, and automatically correlates the findings into an interactive organizational map showing users, servers, printer shares, and software versions.

4. Email Header Analysis & Information Disclosure

Email transmission is governed by RFC 5322 . As an email message travels from the sender's client across the Internet to the recipient's mailbox, each intermediate Mail Transfer Agent (MTA) inspects the message and prepends routing metadata to the header block. +-------------------------------------------------------------------------+

  • | RFC 5322 EMAIL HEADER STACK |
  • +-------------------------------------------------------------------------+
  • [ Received: from mail-in.recipient.com by imap.recipient.com ] ◄── (Top / Most Recent)
  • [ Received: from relay02.corp.target.com (198.51.100.5) ... ]
  • [ Received: from internal-ex01.corp.target.com (10.10.20.15) ]
  • [ Received: from [10.10.50.104] (client-pc.corp.target.com) ] ◄── (Bottom / Origin)
  • --------------------------------------------------------------------------
  • From: CEO <ceo@target.com>
  • To: Vendor <sales@vendor.com>
  • Subject: Project Alpha Financials
  • X-Mailer: Microsoft Outlook 16.0 (Build 14326.20404)
  • Authentication-Results: spf=pass smtp.mailfrom=target.com; dkim=pass
  • Reading the Received: Header Chain

The Golden Rule of Email Analysis: Received: headers are prepended at the top of the header stack by each receiving MTA. Therefore, to trace the chronological path of an email, analysts must read the Received: chain from bottom to top :

The bottom-most Received: header represents the original sending client (MUA) transmitting the message to the first outbound mail server.

Intermediate headers record transmission across edge gateways, spam filters, and cloud relays.

The top-most Received: header represents the final delivery into the recipient's mailbox server.

Information Leaked in Email Headers

Internal RFC 1918 IP Addresses: Misconfigured Microsoft Exchange or Postfix servers frequently record the originating workstation's internal private IP address (e.g., Received: from [10.10.50.104] ) in the first hop, exposing internal subnet schemes.

Internal Hostnames & Server FQDNs: Headers disclose internal mail server names ( internal-ex01.corp.target.com ) and routing hops that are never published in public DNS.

Mail User Agent (MUA) Fingerprinting: Headers such as User-Agent: or X-Mailer: explicitly reveal the client's email application and operating system version (e.g., X-Mailer: iPhone Mail (20G75) or X-Mailer: Microsoft Outlook 16.0 ).

Email Authentication & Spoofability Assessment

During OSINT and social engineering assessments, penetration testers inspect the target's email security posture to evaluate whether the organization's domain can be spoofed:

SPF Verification: Inspected in Received-SPF: . If the sending IP is not authorized in the sender's DNS SPF record, the result is Fail or SoftFail .

DKIM Alignment: The DKIM-Signature: header contains the cryptographic hash and digital signature. The recipient's server queries the public key published under selector._domainkey.domain.com to verify message integrity.

DMARC Enforcement Analysis: The Authentication-Results: header indicates how the receiving MTA evaluated DMARC policy. If the domain publishes p=none , email servers will not reject or quarantine spoofed messages, allowing penetration testers to demonstrate email impersonation vulnerabilities during authorized social engineering simulations.