My account Get a quote
Security

What Is Google Dorking? Protect Your Site From Information Leaks

We explain what Google dorking is, how to audit your own site with harmless search operators, and how to keep sensitive data out of search results.

· 7 min read
What Is Google Dorking? Protect Your Site From Information Leaks

What is a Google dork? A Google dork is a specialised search query built by combining Google's advanced search operators, such as site:, filetype:, intitle: and inurl:. Unlike a regular search, it narrows results to a specific site, file type or page feature, so it returns far more precise results. This article looks at Google dorking from the defensive side: why dorks matter, and what site owners should do so they do not expose their own information to search engines.

Why do Google dorks matter?

Search engines crawl and index everything on the internet that is publicly reachable. A file, a backup, a test page or a configuration file that you consider "hidden" but that sits on a server without protection will not escape the notice of crawler bots. Because dork queries make this indexed content easier to filter, they can be used by security specialists and by malicious actors alike.

So the problem is not the dork itself, but content that has been accidentally left exposed on a site. A dork only makes what is already public easier to find. That is why the right defence is to know what the search engine can see.

Basic search operators

Most of these operators are also useful in everyday searching. All of the examples below are harmless and can be used to review your own site.

OperatorWhat it doesHarmless example
site:Limits results to a specific domainsite:example.com
filetype:Lists a specific file typesite:example.com filetype:pdf
intitle:Searches for a word in the page titlesite:example.com intitle:campaign
inurl:Searches for a term in the addresssite:example.com inurl:blog
"..."Matches an exact phrase"free estimate"
-Excludes a word from resultssite:example.com -blog

The key point is that the site: operator lets you quickly see how many of your pages appear on Google and which of them are indexed. If a page or file you did not expect shows up, you need to investigate it.

How to audit your own site

The first step in defence is to see what the search engine knows about you. Run the following checks on your own domain:

  1. Type site:yourdomain.com and check whether the total number of results matches the number of pages you expect.
  2. Use file type queries such as site:yourdomain.com filetype:pdf to check whether documents you do not want published have been indexed. Run the same check for other types such as doc, xls, txt, zip and sql.
  3. For test, staging or old-version pages, try terms that match your own naming habits, such as site:yourdomain.com inurl:test or inurl:old.
  4. Review your subdomains with site:yourdomain.com -www; a subdomain you have forgotten about may still be in the index.
  5. Keep track of indexed addresses regularly using the "Pages" and "Coverage" reports in Google Search Console.

Using this audit to look for information on someone else's site without authorisation is unethical and, in most cases, illegal. In Turkey, unauthorised access to information systems and the seizure of data are also crimes. Only carry out audits on sites you own or have written permission to test.

Preventing information leaks: a checklist for site owners

1. Remove sensitive files from the web root

Database backups, environment files such as .env, configuration files, log records and source code archives should not sit in publicly accessible folders. Store these files outside the web root (the public folder) and make sure only the application can read them. Keep backups in a separate area of the server with restricted access, or move them to external storage.

2. Turn off directory listing

If a folder has no index file and directory listing is enabled, the server displays every file in that folder as a list. That list can also be indexed by search engines. Disable this behaviour with Options -Indexes on Apache, or with the autoindex off setting on Nginx.

3. Understand noindex and robots.txt correctly

These two tools are often confused, which leads to serious mistakes:

  • robots.txt is not a security measure. Anyone can read this file, so listing the folders you want to hide in it simply advertises their existence. Also, robots.txt only prevents crawling; if an address receives links from other sites, it can still appear in the index.
  • The noindex tag (<meta name="robots" content="noindex"> or the X-Robots-Tag: noindex HTTP header) stops the page from appearing in search results. However, the bot must be able to crawl the page to see the tag. In other words, you cannot block the same page with robots.txt and expect noindex to work.
  • For non-HTML files such as PDFs, the X-Robots-Tag header is used.

For content that truly needs to stay private, the only correct method is authentication. noindex is not a privacy tool; it only removes content from search results.

4. Protect admin and test environments

Admin panels, staging sites and development environments should sit behind a password, an IP restriction or a VPN. Telling these environments to "keep out" with robots.txt is not enough; access itself must be restricted. Also make sure that version control folders such as .git and .svn cannot be reached through the web.

5. Check upload folders and file names

If documents uploaded by users (invoices, ID copies, contracts) sit in a public folder under predictable names, they can be indexed. Store sensitive uploads outside the web root and serve them through a script that checks authorisation.

6. Hide error messages and version information

Detailed error output should be turned off in production. Details such as file paths, database names or version numbers leak out unnecessarily. In PHP, display_errors should be off, and errors should only be written to the log file.

7. Don't forget third-party services

Shared cloud folders, publicly accessible storage buckets, code repositories and document sharing links can also be indexed. Review link-sharing settings regularly, and clean up repositories that contain secrets such as keys or passwords. Deleting a leaked key is not enough; always replace it with a new one.

What to do if content has appeared in search results

  1. First, shut down the source: remove the file, restrict access or put it behind a password. Otherwise, removing it from search results will only be a temporary fix.
  2. Use the "Removals" tool in Google Search Console to request that the address be temporarily hidden from results.
  3. For a permanent fix, the page should return a 404 or 410 response or contain a noindex tag.
  4. If the content contains passwords, keys or personal data, change them immediately and review your records for possible misuse.
  5. If personal data is involved, assess your notification obligations under KVKK (Turkey's Personal Data Protection Law).

Build a regular checking habit

A dork audit is not a one-off task. Repeat the same checks after every major update or migration, and whenever you open a new subdomain. For automatic warnings, keep Search Console notifications turned on, and watch your server access logs for unusual crawling activity. For a more detailed look at index management on the SEO side, our article what is SEO will also help.

Conclusion

Google dorking is a powerful but neutral search technique. The risk comes from data that should not be indexed being left exposed. Removing sensitive files from the web root, turning off directory listing, protecting admin and test environments, and using noindex and robots.txt correctly will largely protect your site against this kind of information leak.

If you would like to review your site's indexing and security status together, you can get in touch with us. You can find our server maintenance and security services on the products page.

Frequently asked questions

Is using Google dorks legal?

Using search operators is legal, since you are performing a public search. However, gaining unauthorised access to other people's systems or using leaked data is a crime. Only carry out checks on your own site.

Does robots.txt protect sensitive files?

No. robots.txt only tells well-behaved bots your crawling preferences, and anyone can read it. Sensitive content requires authentication and storage outside the web root.

What should I do if a file from my site appears on Google?

First remove the file or close access to it, then send a removal request from Search Console. If it contains passwords or keys, change them immediately.

How do I turn off directory listing?

On an Apache server, use Options -Indexes; on Nginx, use autoindex off. In most hosting panels this option is usually called directory privacy or directory browsing.

Can noindex and robots.txt be used together?

Do not use them on the same page. A bot blocked from crawling a page by robots.txt cannot see the noindex tag on it. If you want to remove a page from search results, allow crawling and add noindex.

Need help with this?

Tell us briefly about your project, and we’ll get back to you with a roadmap and a quote.

Get a quote

Related posts

All →