Github Search is a quite powerful and useful feature that can be used to search for sensitive data on repositories. Collection of Github dorks can reveal sensitive personal and/or organizational information such as private keys, credentials, authentication tokens, etc. This list is supposed to be useful for assessing security and performing pen-testing of systems.
github-dorks is a Python command-line tool that searches a repository or an
organization/user's repositories using the queries in a dorks file.
This tool uses github3.py to talk with GitHub Search API.
Clone this repository and run:
pip install .You can also run github-dorks using Docker for a consistent environment:
# Build the Docker image
docker build -t github-dorks .
# Run with a GitHub token (recommended)
docker run -e GH_TOKEN=your_github_token github-dorks -u someuser
# Run with username/password
docker run -e GH_USER=your_username -e GH_PWD=your_password github-dorks -u someuser
# Save results to a CSV file
docker run -v $(pwd)/output:/app/output -e GH_TOKEN=your_github_token github-dorks -u someuser -o /app/output/results.csvGH_USER - Environment variable to specify Github user
GH_PWD - Environment variable to specify a password
GH_TOKEN - Environment variable to specify Github token
GH_URL - Environment variable to specify GitHub Enterprise base URL
Some example usages are listed below:
github-dorks -r techgaun/github-dorks # search a single repo
github-dorks -u techgaun # search all repos of a user
github-dorks -u dev-nepal # search all repos of an organization
GH_USER=techgaun GH_PWD=<mypass> github-dorks -u dev-nepal # search as authenticated user
GH_TOKEN=<github_token> github-dorks -u dev-nepal # search using auth token
GH_URL=https://github.example.com github-dorks -u dev-nepal # search a GitHub Enterprise instance
github-dorks -r techgaun/github-dorks --max-retries 5 # retry recoverable failures up to five times
github-dorks -r techgaun/github-dorks --format json # stream JSON to stdout
github-dorks -u dev-nepal --format jsonl -o results.jsonl # write newline-delimited JSON
github-dorks -u dev-nepal --format csv -o results.csv --force # explicitly replace an existing file
github-dorks --list-categories # list bundled dictionaries
github-dorks -r techgaun/github-dorks -c cloud -c devops # scan selected categories
github-dorks --local ./cloned-repo -c ai -c identity # scan a local working tree
github-dorks --local . --format jsonl -o local-results.jsonl # save offline resultsThe legacy python github-dork.py ... invocation remains available for
compatibility. The package can also run as python -m github_dorks ....
Each scan ends with a summary of queries, matches, failures, retries, and
elapsed time. The command exits with status 0 after a complete scan, 2 when
one or more queries failed, and 1 for fatal configuration, file, or
authentication errors.
Local scans do not require GitHub credentials or network access. In a Git
working tree, the scanner checks tracked files and non-ignored untracked files;
elsewhere it recursively checks files while excluding .git. It supports the
dictionary syntax used by this project, including quoted text, OR, NOT, and
the filename:, path:, extension:, and common language: qualifiers.
Binary files and files larger than 1 MB are skipped by default. Override that
limit in bytes with --max-file-size.
Supported result formats are text, csv, json, and jsonl. Text is the
default for terminal output; using -o/--output without --format preserves
the historical CSV default. Existing files are protected unless --force is
provided. Use --quiet to suppress progress and summaries, or --verbose to
print every query as it runs. Structured stdout remains machine-readable because
status messages are sent to stderr.
The bundled dictionary is split into ai, cloud, databases, devops,
frameworks, identity, observability, private-keys, saas, and system
categories. Repeat -c/--category to combine categories. With no category or
custom --dork file, the command uses the backward-compatible
github-dorks.txt aggregate. That aggregate is generated from the category
files with python scripts/build-dorks.py.
Run the dependency-free unit test suite with:
python -m unittest discover -s tests -vThe CI test matrix covers Python 3.10 through 3.13.
- Authenticated requests receive higher rate limits. Searches may pause until GitHub resets the search limit.
- Large category combinations can take time because GitHub applies a separate search rate limit.
- Offline scanning inspects the current working tree only; Git history scanning is not yet supported.
Please consider contributing dorks that can reveal potentially sensitive information on GitHub. Documented sources for newer credential families are maintained in docs/dork-sources.md.
The canonical dictionaries are the categorized files. The generated github-dorks.txt file contains every category for backward compatibility. The table below provides descriptions for many established patterns; newer credential families and their vendor references are tracked in docs/dork-sources.md. Many dorks can be modified to make the search more specific or generic. You can see more options here.
