GithubHelp home page GithubHelp logo

techgaun / github-dorks Goto Github PK

View Code? Open in Web Editor NEW
2.7K 92.0 573.0 73 KB

Find leaked secrets via github search

License: Apache License 2.0

Python 100.00%
security-audit github-dork hacktoberfest dork dorker hacking

github-dorks's Introduction

Github Dorks

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 Dork Search Tool

github-dork.py is a simple python tool that can search through your repository or your organization/user repositories. It's not a perfect tool at the moment but provides basic functionality to automate the search on your repositories against the dorks specified in the text file.

Installation

This tool uses github3.py to talk with GitHub Search API.

Clone this repository and run:

pip install .

Usage

GH_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-dork.py -r techgaun/github-dorks                          # search a single repo

github-dork.py -u techgaun                                       # search all repos of a user

github-dork.py -u dev-nepal                                      # search all repos of an organization

GH_USER=techgaun GH_PWD=<mypass> github-dork.py -u dev-nepal     # search as authenticated user

GH_TOKEN=<github_token> github-dork.py -u dev-nepal              # search using auth token

GH_URL=https://github.example.com github-dork.py -u dev-nepal    # search a GitHub Enterprise instance

Limitations

  • Authenticated requests get a higher rate limit. But, since this tool waits for the api rate limit to be reset (which is usually less than a minute), it can be slightly slow.
  • Output formatting is not great. PR welcome
  • Handle rate limit and retry. PR welcome

Contribution

Please consider contributing dorks that can reveal potentially sensitive information on Github.

List of Dorks

I am not categorizing at the moment. Instead, I am going to just the list of dorks with a description. Many of the dorks can be modified to make the search more specific or generic. You can see more options here.

Dork Description
filename:.npmrc _auth npm registry authentication data
filename:.dockercfg auth docker registry authentication data
extension:pem private private keys
extension:ppk private puttygen private keys
filename:id_rsa or filename:id_dsa private ssh keys
extension:sql mysql dump mysql dump
extension:sql mysql dump password mysql dump look for password; you can try varieties
filename:credentials aws_access_key_id might return false negatives with dummy values
filename:.s3cfg might return false negatives with dummy values
filename:wp-config.php wordpress config files
filename:.htpasswd htpasswd files
filename:.env DB_USERNAME NOT homestead laravel .env (CI, various ruby based frameworks too)
filename:.env MAIL_HOST=smtp.gmail.com gmail smtp configuration (try different smtp services too)
filename:.git-credentials git credentials store, add NOT username for more valid results
PT_TOKEN language:bash pivotaltracker tokens
filename:.bashrc password search for passwords, etc. in .bashrc (try with .bash_profile too)
filename:.bashrc mailchimp variation of above (try more variations)
filename:.bash_profile aws aws access and secret keys
rds.amazonaws.com password Amazon RDS possible credentials
extension:json api.forecast.io try variations, find api keys/secrets
extension:json mongolab.com mongolab credentials in json configs
extension:yaml mongolab.com mongolab credentials in yaml configs (try with yml)
jsforce extension:js conn.login possible salesforce credentials in nodejs projects
SF_USERNAME salesforce possible salesforce credentials
filename:.tugboat NOT _tugboat Digital Ocean tugboat config
HEROKU_API_KEY language:shell Heroku api keys
HEROKU_API_KEY language:json Heroku api keys in json files
filename:.netrc password netrc that possibly holds sensitive credentials
filename:_netrc password netrc that possibly holds sensitive credentials
filename:hub oauth_token hub config that stores github tokens
filename:robomongo.json mongodb credentials file used by robomongo
filename:filezilla.xml Pass filezilla config file with possible user/pass to ftp
filename:recentservers.xml Pass filezilla config file with possible user/pass to ftp
filename:config.json auths docker registry authentication data
filename:idea14.key IntelliJ Idea 14 key, try variations for other versions
filename:config irc_pass possible IRC config
filename:connections.xml possible db connections configuration, try variations to be specific
filename:express.conf path:.openshift openshift config, only email and server thou
filename:.pgpass PostgreSQL file which can contain passwords
filename:proftpdpasswd Usernames and passwords of proftpd created by cpanel
filename:ventrilo_srv.ini Ventrilo configuration
[WFClient] Password= extension:ica WinFrame-Client infos needed by users to connect toCitrix Application Servers
filename:server.cfg rcon password Counter Strike RCON Passwords
JEKYLL_GITHUB_TOKEN Github tokens used for jekyll
filename:.bash_history Bash history file
filename:.cshrc RC file for csh shell
filename:.history history file (often used by many tools)
filename:.sh_history korn shell history
filename:sshd_config OpenSSH server config
filename:dhcpd.conf DHCP service config
filename:prod.exs NOT prod.secret.exs Phoenix prod configuration file
filename:prod.secret.exs Phoenix prod secret
filename:configuration.php JConfig password Joomla configuration file
filename:config.php dbpasswd PHP application database password (e.g., phpBB forum software)
path:sites databases password Drupal website database credentials
shodan_api_key language:python Shodan API keys (try other languages too)
filename:shadow path:etc Contains encrypted passwords and account information of new unix systems
filename:passwd path:etc Contains user account information including encrypted passwords of traditional unix systems
extension:avastlic "support.avast.com" Contains license keys for Avast! Antivirus
filename:dbeaver-data-sources.xml DBeaver config containing MySQL Credentials
filename:.esmtprc password esmtp configuration
extension:json googleusercontent client_secret OAuth credentials for accessing Google APIs
HOMEBREW_GITHUB_API_TOKEN language:shell Github token usually set by homebrew users
xoxp OR xoxb Slack bot and private tokens
.mlab.com password MLAB Hosted MongoDB Credentials
filename:logins.json Firefox saved password collection (key3.db usually in same repo)
filename:CCCam.cfg CCCam Server config file
msg nickserv identify filename:config Possible IRC login passwords
filename:settings.py SECRET_KEY Django secret keys (usually allows for session hijacking, RCE, etc)
filename:secrets.yml password Usernames/passwords, Rails applications
filename:master.key path:config Rails master key (used for decrypting credentials.yml.enc for Rails 5.2+)
filename:deployment-config.json Created by sftp-deployment for Atom, contains server details and credentials
filename:.ftpconfig Created by remote-ssh for Atom, contains SFTP/SSH server details and credentials
filename:.remote-sync.json Created by remote-sync for Atom, contains FTP and/or SCP/SFTP/SSH server details and credentials
filename:sftp.json path:.vscode Created by vscode-sftp for VSCode, contains SFTP/SSH server details and credentails
filename:sftp-config.json Created by SFTP for Sublime Text, contains FTP/FTPS or SFTP/SSH server details and credentials
filename:WebServers.xml Created by Jetbrains IDEs, contains webserver credentials with encoded passwords (not encrypted!)
"api_hash" "api_id" Telegram API token
"https://hooks.slack.com/services/" Slack services URL often have secret API token as a suffix
filename:github-recovery-codes.txt GitHub recovery key
filename:gitlab-recovery-codes.txt GitLab recovery key
filename:discord_backup_codes.txt Discord recovery key
extension:yaml cloud.redislabs.com Redis credentials provided by Redis Labs found in a YAML file
extension:json cloud.redislabs.com Redis credentials provided by Redis Labs found in a JSON file

github-dorks's People

Contributors

adhocore avatar brightergy-samaracharya avatar connorshea avatar craighays avatar crdotson avatar davidmckennirey avatar dbfreem avatar donno2048 avatar fabacab avatar ffr4nz avatar hexiro avatar mesaugat avatar nootr avatar plazmaz avatar rchowell avatar srizzling avatar techgaun avatar verdantfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-dorks's Issues

Not run the github-dork.py exucutable file

first i install the github-dork with git clone then i install all requirements with pip then i make the github-dork.py exucuable and write help cmd ./gitthub-dork.py -h is give me error this

Traceback (most recent call last):
File "./github-dork.py", line 4, in
import github3 as github
File "build/bdist.linux-x86_64/egg/github3/init.py", line 24, in
File "build/bdist.linux-x86_64/egg/github3/api.py", line 13, in
File "build/bdist.linux-x86_64/egg/github3/github.py", line 10, in
File "build/bdist.linux-x86_64/egg/github3/apps.py", line 7, in
ImportError: No module named jwcrypto

i also install this module sepretlly with pip this say seccessfull install it but he give also same error

422 Validation Failed

GH_TOKEN=************************************************ python3 github-dork.py -u dev-nepal

when iam testing, iam getting this error:-

Scanning User: dev-nepal
GitHubError encountered on search of dork: filename:.dockercfg auth user:dev-nepal
422 Validation Failed

Error logging for each search

I'm testing github-dorks.py, running Python 3.x on Linux. I've set GH_USER and GH_PWD:

[rubin@THINK github-dorks (master)]$ python github-dork.py -r raaftech/session
Scanning Repo:  raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.npmrc _auth repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.dockercfg auth repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:pem private repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:ppk private repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:id_rsa or filename:id_dsa repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:sql mysql dump repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:sql mysql dump password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:credentials aws_access_key_id repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.s3cfg repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:wp-config.php repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.htpasswd repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.env DB_USERNAME NOT homestead repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.env MAIL_HOST=smtp.gmail.com repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.git-credentials repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: PT_TOKEN language:bash repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.bashrc password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.bashrc mailchimp repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.bash_profile aws repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: rds.amazonaws.com password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:json api.forecast.io repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:json mongolab.com repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:yaml mongolab.com repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: jsforce extension:js conn.login repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: SF_USERNAME salesforce repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.tugboat NOT _tugboat repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: HEROKU_API_KEY language:shell repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: HEROKU_API_KEY language:json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.netrc password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:_netrc password repo:raaftech/session
GitHub Search API rate limit reached. Sleeping for 34 seconds.

generator raised StopIteration
Error encountered on search of dork: filename:hub oauth_token repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:robomongo.json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:filezilla.xml Pass repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:recentservers.xml Pass repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:config.json auths repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:idea14.key repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:config irc_pass repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:connections.xml repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:express.conf path:.openshift repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.pgpass repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:proftpdpasswd repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:ventrilo_srv.ini repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: [WFClient] Password= extension:ica repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:server.cfg rcon password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: JEKYLL_GITHUB_TOKEN repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.bash_history repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.cshrc repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.history repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.sh_history repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:sshd_config repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:dhcpd.conf repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:prod.exs NOT prod.secret.exs repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:prod.secret.exs repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:configuration.php JConfig password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:config.php dbpasswd repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:config.php pass repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: path:sites databases password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: shodan_api_key language:python repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: shodan_api_key language:shell repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: shodan_api_key language:json repo:raaftech/session
GitHub Search API rate limit reached. Sleeping for 56 seconds.

generator raised StopIteration
Error encountered on search of dork: shodan_api_key language:ruby repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:shadow path:etc repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:passwd path:etc repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:avastlic "support.avast.com" repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:dbeaver-data-sources.xml repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:sftp-config.json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.esmtprc password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: extension:json googleusercontent client_secret repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: HOMEBREW_GITHUB_API_TOKEN language:shell repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: xoxp OR xoxb repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: .mlab.com password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:logins.json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:CCCam.cfg repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: msg nickserv identify filename:config repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:settings.py SECRET_KEY repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:secrets.yml password repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:master.key path:config repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:deployment-config.json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.ftpconfig repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:.remote-sync.json repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:sftp.json path:.vscode repo:raaftech/session
generator raised StopIteration
Error encountered on search of dork: filename:WebServers.xml repo:raaftech/session
No results for your dork search repo:raaftech/session. Hurray!

How do I find out what's going wrong here?

Problem when run

$ python3 github-dork.py -r https://github.com/techgaun/github-dorks
Traceback (most recent call last):
File "/home/kali/Programs/github-dorks/github-dork.py", line 4, in
import github3 as github
File "/home/kali/.local/lib/python3.11/site-packages/github3/init.py", line 18, in
from .api import (
File "/home/kali/.local/lib/python3.11/site-packages/github3/api.py", line 11, in
from .github import GitHub, GitHubEnterprise
File "/home/kali/.local/lib/python3.11/site-packages/github3/github.py", line 13, in
from .auths import Authorization
File "/home/kali/.local/lib/python3.11/site-packages/github3/auths.py", line 12, in
from .models import GitHubCore
File "/home/kali/.local/lib/python3.11/site-packages/github3/models.py", line 19, in
from .session import GitHubSession
File "/home/kali/.local/lib/python3.11/site-packages/github3/session.py", line 4, in
from collections import Callable
ImportError: cannot import name 'Callable' from 'collections' (/usr/lib/python3.11/collections/init.py)

Can you help me with that ?

403 Errors

Any ideas for avoiding the 403 errors? Still getting them on basic queries, even when using authentication.

'NoneType' object has no attribute 'get'

Whenever I am executing the command to find dorks, I am presented with the error "'NoneType' object has no attribute 'get'" "Error encountered on the search of dork: filename:.ftpconfig repo:techgaun/github-dorks" etc.

rate limit

GitHub Search API rate limit reached

where can i an api token to not get rate limiting?

History files as the dorks

How about adding some more local files, for when people accidentally upload their home directory.

So:

  • .history
  • .bash_history
  • etc.

Basically, find all the history files for various shells and put them in there. Should probably include .profile files as well, since people put all sorts of sensitive stuff in there as well.

Add code linter and it's GitHub action

To maintain consistency of code, add a code linter like black and it's GitHub action to check if it's properly formatted when a pull request is created

AttributeError: module 'base64' has no attribute 'decodestring'

hello! when i run this script, i got this problem.

> python .\github-dork.py
Traceback (most recent call last):
  File "C:\***\github-dorks-master\github-dork.py", line 8, in <module>
    import feedparser
  File "C:\***\AppData\Roaming\Python\Python39\site-packages\feedparser.py", line 106, in <module>
    _base64decode = getattr(base64, 'decodebytes', base64.decodestring)
AttributeError: module 'base64' has no attribute 'decodestring'

this is my env:

> python -V
Python 3.9.0

> systeminfo

主机名:           ***
OS 名称:          Microsoft Windows 10 专业版
OS 版本:          10.0.19042 暂缺 Build 19042
OS 制造商:        Microsoft Corporation
OS 配置:          独立工作站
OS 构建类型:      Multiprocessor Free
注册的所有人:     ***
注册的组织:
产品 ID:          ***
初始安装日期:     ***
系统启动时间:     2021/1/1, 1:21:19
系统制造商:       ASUSTeK COMPUTER INC.
系统型号:         ROG Zephyrus G14 GA401IV_GA401IV
系统类型:         x64-based PC
处理器:           安装了 1 个处理器。
                  [01]: AMD64 Family 23 Model 96 Stepping 1 AuthenticAMD ~2900 Mhz
BIOS 版本:        American Megatrends Inc. GA401IV.218, 2020/11/5
Windows 目录:     ***
系统目录:         ***
启动设备:         ***

offline cloned repository scanning

the way it would work is run github-dorks as an offline tool and use regex and text patterns to find potential leaks.. optionally see if we can also scan history

2 dorks require a search operator

The following github dorks require a search operator and fail

extension:avastlic Contains license keys for Avast! Antivirus
extension:dbeaver-data-sources.xml DBeaver config containing MySQL Credentials

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.