
Google is the most used search engine in the world and the place where most of us look for information on the internet.
Google Search is a huge database of information about the content of websites. Google's indexing tools store everything they come across, as long as website developers do not set clear instructions for certain folders or files not to be indexed (and very often they forget to).
But did you know there is a way to use Google to uncover information that is not easy to find through an ordinary search? The technique is called "Google Dorks" or "Google Hacking", and it is a powerful tool that can be used for good and for bad.
What is Google Dorks?
Google Dorks or Google Hacking is a search technique that uses advanced operators to find specific information that is hard to reach through normal searches. These operators can narrow the results to a single website, certain file types, certain kinds of data or other criteria.
Just like with a relational database, with the right operators we can get very precise search results.
Why does Google Dorks matter?
First of all, Google Dorks matters because it lets you find information that is very hard to reach through an ordinary search. Google's ranking algorithm sometimes buries the pages we are looking for among thousands of results, in positions that are almost impossible to notice.
Google Dorks can also be used to test the security of websites and web applications. Using specific search terms, attackers can identify vulnerabilities that can be exploited (e.g. software and server versions, logs, credentials, e-mail addresses etc.).
How can Google Dorks be used?
Google Dorks is easy to use: you type the search terms into the search engine as usual. The terms must contain specific operators, depending on the results you want. Here are some examples using the most common operators:
- site:example.com filetype:pdf
Shows all *.pdf files on example.com. - intitle:"index of" password
Shows all pages with "index of" in the title and "password" in the content. - inurl:admin.php
Shows all pages with "admin.php" in the URL. - cache:example.com
Looks for the cached version of example.com.
Other important operators:
- +: used to concatenate words
- -: excludes results containing the word that follows it
- inanchor: searches the anchor text of links
- around(n): finds pages where two terms appear close to each other (the number in brackets is the maximum number of words between them)
Use "robots.txt" to fix it or to avoid indexing
Robots.txt is a file placed in the root of the website (or in other folders) with instructions for search engine bots. These instructions control how the resources under the folder containing the file are indexed.
For example, we can have the following "robots.txt" file in the root of the site:
User-agent: *
Disallow: /secret-document.pdf
Disallow: /secret-folder/This file tells crawlers not to index "secret-document.pdf" in the site root, nor anything in "secret-folder". Keep in mind that robots.txt is public and does not protect anything by itself: sensitive files must also be access-controlled.
If sensitive information has already been indexed by Google, create a Google Search Console account, verify the site and go to the "Removals" section to request the urgent removal of a URL or of all sensitive URLs.
Conclusion
Google Dorks is a search technique that can help you find hidden information and test the security of websites and web applications. Use these techniques responsibly and for ethical purposes.
