Mastering Google Dorking: The Ultimate Guide
Google Dorking, also known as Google Hacking, is a technique used to uncover sensitive information exposed on the internet. This guide covers everything from the basics to advanced techniques, including automation, OSINT gathering, vulnerability exploitation, and ethical considerations. Whether you’re a beginner or an experienced cybersecurity professional, this guide will help you master Google Dorking.
Table of Contents
- Introduction to Google Dorking
- Fundamentals of Google Dorking
- Understanding Google Dork Operators
- Common Google Dork Queries
- Advanced Techniques
- Case Studies
- Preventing Google Dorking
- Google Dorking Tools and Resources
- Legal Considerations
- Conclusion
Introduction to Google Dorking
Google Dorking is a technique used to find sensitive information accidentally exposed on the internet. This can include:
- Log files with usernames and passwords
- Exposed cameras and IoT devices
- Sensitive documents (e.g., financial records, confidential files)
- Website vulnerabilities (e.g., SQL injection points)
While Google Dorking is a powerful tool for information gathering, it is often misused for malicious purposes such as cyberattacks, identity theft, and digital espionage. This guide emphasizes ethical use and encourages readers to use these techniques for security testing and vulnerability assessment.
Fundamentals of Google Dorking
Google Dorking relies on advanced search operators to refine search results. These operators allow you to target specific types of information. Below are the seven fundamental types of queries used in Google Dorking:
- intitle: Searches for pages with specific text in their HTML title.
- Example:
intitle:"login page"
- allintitle: Similar to
intitle
, but requires all keywords to be in the title.- Example:
allintitle:"login page admin"
- inurl: Searches for pages based on text in the URL.
- allinurl: Similar to
inurl
, but requires all keywords to be in the URL.- Example:
allinurl:admin login
- filetype: Filters results by specific file types.
- ext: Filters results by file extensions.
- site: Limits search results to a specific website.
- Example:
site:example.com
Understanding Google Dork Operators
Google Dork operators are the building blocks of effective queries. Here’s a breakdown of the most commonly used operators:
Operator | Description | Example |
---|
intitle | Searches for pages with specific text in the title. | intitle:"login page" |
allintitle | Searches for pages with all specified keywords in the title. | allintitle:"admin login" |
inurl | Searches for pages with specific text in the URL. | inurl:admin |
allinurl | Searches for pages with all specified keywords in the URL. | allinurl:admin login |
filetype | Filters results by specific file types. | filetype:pdf |
ext | Filters results by file extensions. | ext:log |
intext | Searches for pages containing specific text in the body. | intext:"username" |
allintext | Searches for pages containing all specified keywords in the body. | allintext:"username password" |
site | Limits search results to a specific domain. | site:example.com |
cache | Displays the cached version of a page. | cache:example.com |
Common Google Dork Queries
Below are some commonly used Google Dork queries for various purposes:
General Dorks
1
2
3
4
5
6
| intitle:"Index of"
intitle:"Index of" site:example.com
filetype:log inurl:"access.log"
intext:"Welcome to phpMyAdmin"
intitle:"Login — WordPress"
intext:"Powered by WordPress"
|
1
2
3
4
| inurl:/phpmyadmin/index.php
inurl:/db/websql/
inurl:/phpPgAdmin/index.php
intext:"phpPgAdmin — Login"
|
Search for Vulnerabilities
1
2
| intext:"Error Message" intext:"MySQL server" intext:"on * using password:"
intext:"Warning: mysql_connect()" intext:"on line" filetype:php
|
Exposed Documents and Files
1
2
3
4
| filetype:pdf intitle:"Confidential"
filetype:doc intitle:"Confidential"
filetype:xls intitle:"Confidential"
filetype:ppt intitle:"Confidential"
|
Directory Listings
1
2
3
4
5
| intitle:"Index of" inurl:/parent-directory
intitle:"Index of" inurl:/admin*
intitle:"Index of" inurl:/backup
intitle:"Index of" inurl:/config
intitle:"Index of" inurl:/logs
|
Exposed Webcams and Cameras
1
2
3
| inurl:"view/index.shtml"
intitle:"Live View /-AXIS"
intitle:"Network Camera NetworkCamera"
|
1
2
3
| intitle:"Login" inurl:/admin
intitle:"Login" inurl:/login
inurl:"/admin/login.php"
|
Exposed Control Panels
1
2
| intitle:"Control Panel" inurl:/admin
intitle:"Control Panel" inurl:/cpanel
|
Exposed IoT Devices
1
2
| intitle:"Smart TV" inurl:/cgi-bin/login
intitle:"Router Login" inurl:/login
|
Finding PHP Info Pages
1
| intitle:"PHP Version" intext:"PHP Version"
|
Exposing Sensitive Files on Government Sites
1
| site:gov (inurl:doc | inurl:pdf | inurl:xls | inurl:ppt | inurl:rtf | inurl:ps)
|
Exposed Network Devices
1
2
3
| intitle:"Brother" intext:"View Configuration"
intitle:"Network Print Server" filetype:html
intitle:"HP LaserJet" inurl:SSI/index.htm
|
File Upload Vulnerabilities
1
2
| inurl:/uploadfile/ filetype:php
intext:"File Upload" inurl:/php/
|
Advanced Techniques
Advanced Query Crafting
Combine multiple operators for precise searches. Use parentheses ()
to group conditions and logical operators (OR
, AND
, -
) to refine results.
Example:
1
| site:example.com (intitle:"login" OR inurl:"admin") filetype:php
|
Exploiting Specific Vulnerabilities
- SQL Injection:
inurl:index.php?id=
- XSS Vulnerabilities:
inurl:search.php?q=
- File Inclusion Vulnerabilities:
inurl:index.php?page=
Using Google Dorking for OSINT
- Gathering Information:
site:linkedin.com intitle:"John Doe"
- Finding Leaked Credentials:
filetype:txt "username" "password"
Automation and Scripting
Automate Google Dorking using Python and the requests
library.
Example Script:
1
2
3
4
5
6
7
8
9
10
11
| import requests
def google_dork(query):
url = f"https://www.google.com/search?q={query}"
headers = {"User-Agent": "Mozilla/5.0"}
response = requests.get(url, headers=headers)
return response.text
query = 'inurl:index.php?id='
results = google_dork(query)
print(results)
|
Case Studies
Real-World Example 1: Finding Exposed Admin Panels
A penetration tester used the following query to find exposed admin panels:
1
| intitle:"Admin Login" inurl:/admin
|
Real-World Example 2: Exploiting SQL Injection
A bug bounty hunter used the following query to find SQL injection vulnerabilities:
Preventing Google Dorking
To protect your website from Google Dorking:
- IP-based Restrictions: Limit access to sensitive areas.
- Vulnerability Scans: Regularly scan for vulnerabilities.
- Google Search Console: Remove sensitive content from search results.
- robots.txt: Use this file to block search engines from indexing sensitive directories.
- Secure Passwords: Change default passwords on devices and systems.
- Disable Remote Logins: Prevent unauthorized access to network devices.
Here are some tools and resources to help you get started:
Legal Considerations
Understanding Legal Boundaries
Google Dorking can be a legal gray area. Ensure you have explicit permission before testing any website. Unauthorized access to systems is illegal and punishable by law.
Conclusion
Google Dorking is an invaluable skill for cybersecurity professionals, but it must be used responsibly. By mastering advanced techniques, automating queries, and understanding legal boundaries, you can leverage Google Dorking to enhance security and uncover vulnerabilities. Always prioritize ethical use and obtain proper authorization before performing any tests.