Back to Blog
Google "G" logo in brand colors beside the title "Google Hacking Database" on a dark background
Security
Feb 7, 2019
4 Min Read

Google Hacking Database

Wait, Are We Hacking Google?

Disclaimer: Don’t misuse the information here. Only test servers you own, and do so at your own risk.

Don’t worry, this isn’t about hacking Google itself. The Google Hacking Database (GHDB) is a collection of “Google dorks” created by the security community. A Google dork is a specific search query made with Google’s advanced search operators. These queries help find information that Google has indexed but probably shouldn’t be public, such as exposed email lists, login credentials, sensitive files, signs of website vulnerabilities, and even financial data like payment card details.

When used correctly, the GHDB is a valuable tool for defense. Run it on your own domain to find exposures and vulnerabilities before an attacker does.

Google Dorks

A dork is a search string made with Google’s advanced search operators, designed to find something specific. In practice, people often use several dorks together. One might find a vulnerable server, another could extract user credentials, and a third might reveal exposed database credentials.

Advanced Search Operators

The table below lists Google’s main advanced search operators. These are the building blocks for every dork.

OperatorWhat it does
site:abc.comLimits results to pages on abc.com
filetype:pdfLimits results to PDF files
inurl:xxxxxResult URLs must contain xxxxx
allinurl:abc def ghiResult URLs must contain all of abc, def, and ghi
intitle:abcResult titles must contain abc
allintitle:abc def ghiResult titles must contain all of abc, def, and ghi
intext:abcResult text must contain abc
allintext:abc def ghiResult text must contain all of abc, def, and ghi
related:abc.comFinds sites related to abc.com
cache:Shows Google’s cached version of a page
inanchor:abcLink anchor text must contain abc
allinanchor:abc def ghiLink anchor text must contain all of abc, def, and ghi
define:abcShows a definition of abc
id:Undocumented alias for info:
info:urlShows information about a url
link:urlShows pages that link to a given url

A few quick examples of these operators in action:

  1. polymorphism site:stackoverflow.com searches for “polymorphism,” but only shows results from stackoverflow.com.
  2. cars intext:hybrid site:autoblog.com searches for “cars,” but only on autoblog.com pages that also have “hybrid” in the text.
  3. intitle:"index of" finds pages with “index of” in the title. This is a classic way to find open directory listings. Many people use this query to look for movies, games, and TV shows left exposed on misconfigured servers.

You can also prefix any term with - to exclude it from the results:

  1. polymorphism -site:stackoverflow.com searches for “polymorphism,” but leaves out results from stackoverflow.com.
  2. transport -vans -cars searches for “transport,” but removes any result that mentions “vans” or “cars.”

All of this is allowed. These are just Google’s own advanced search operators, and many people use them every day to search more precisely. Try them yourself and see what you can do.

A dork uses the same operators, but with a different goal. Instead of just searching more precisely, it is meant to find sensitive information that was indexed by accident.

  1. "#mysql dump" filetype:sql finds .sql files that contain the exact phrase “#mysql dump.” The quotation marks tell Google to match the string exactly, instead of changing it, dropping symbols, or reordering words for a “better” result.
  2. intitle:"index of" htpasswd searches for exposed .htpasswd files, which store login credentials for Apache HTTP servers. When you use this with the “index of” trick above, it can reveal servers that are leaking those credentials directly.

The most widely used Google Hacking Database on the web is maintained by Exploit-DB.

Filed Under

Join the Conversation

This dispatch is part of an ongoing series on the future of intelligence. Share your perspective or subscribe for more.

Weekly dispatches. No spam. Ever.