Code Monkey home page Code Monkey logo

gitdorker's Introduction

Logo

GitDorker

GitDorker is a tool that utilizes the GitHub Search API and an extensive list of GitHub dorks that I've compiled from various sources to provide an overview of sensitive information stored on github given a search query.

The Primary purpose of GitDorker is to provide the user with a clean and tailored attack surface to begin harvesting sensitive information on GitHub. GitDorker can be used with additional tools such as GitRob or Trufflehog on interesting repos or users discovered from GitDorker to produce best results.

In Depth How to Video and Use Cases

https://youtu.be/UwzB5a5GrZk

Rate Limits

GitDorker utilizes the GitHub Search API and is limited to 30 requests per minute. In order to prevent rate limites a sleep function is built into GitDorker after every 30 requests to prevent search failures. Therefore, if one were to run use the alldorks.txt file with GitDorker, the process will take roughly 5 minutes to complete.

Requirements

** Python3

** GitHub Personal Access Token

** Install requirements inside of the requirements.txt file of this repo (pip3 install -r requirements.txt)

Please follow the guide below if you are unsure of how to create a personal access token: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token

Recommendations

It is recommended to provide GitDorker with at least two GitHub personal access tokens so that it may alternate between the two during the dorking process and reduce the likelihood of being rate limited. Using multiple tokens from separate GitHub accounts will provide the best results.

Dorks

Within the dorks folder are a list of dorks. It is recommended to use the "alldorks.txt" file when mapping out your github secrets attack surface. The "alldorks.txt" is my collection of dorks that i've pulled from various resources, totalling to 239 individual dorks of sensitive github information.

Usage

I've created a blog post with far more detail in how to use GitDorker and potential use cases here: https://medium.com/@obheda12/gitdorker-a-new-tool-for-manual-github-dorking-and-easy-bug-bounty-wins-92a0a0a6b8d5

For a full detailed look of use cases and how to use GitDorker's most updated features please see the BlackHat Presentation below: https://youtu.be/UwzB5a5GrZk

Help Output:

Help

Docker

## Build Command
docker build -t gitdorker .

## Basic Run Command
docker run -it gitdorker

## Run Command
docker run -it -v $(pwd)/tf:/tf gitdorker -tf tf/TOKENSFILE -q tesla.com -d dorks/DORKFILE -o tesla

## Run Command
docker run -it -v $(pwd)/tf:/tf xshuden/gitdorker -tf tf/TOKENSFILE -q tesla.com -d dorks/DORKFILE -o tesla

Screenshots

Below is an example of the results from running the query "tesla.com" with a small list of dorks.

The following command was run to query for "tesla.com" against a list of dorks:

python3 GitDorker.py -tf TOKENSFILE -q tesla.com -d Dorks/DORKFILE -o tesla

Results

Note: The more advanced queries you put (i.e incorporation of user, org, endpoint information, etc. the more succint results you will achieve)

If you like GitDorker and want to see more cool tools!

Buy Me A Coffee

Credits

Reference points for creating GitDorker and compiling dorks lists

  • @gwendallecoguic - special thank you to gwendall and his scripts that provided me with the framework for creating GitDorker.
  • @techgaun - His list of dorks provided a fantastic base for the dorks file
  • @Shashank-In - His list of Travis leaks helped add additional dorks
  • @Jhaddix - Methodology and reference for dorks

Disclaimer

This project is made for educational and ethical testing purposes only. Usage of this tool for attacking targets without prior mutual consent is illegal. Developers assume no liability and are not responsible for any misuse or damage caused by this tool.

gitdorker's People

Contributors

obheda12 avatar wellenc avatar xshuden avatar yassineaboukir 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

gitdorker's Issues

python multiprocessing pool.map errors

I have included pictures of the same errors in powershell and on centOS8.

I've also included one picture of the pool.py errors at line 48 "in mapstar return list(map(*args))" and the GitDorker.py error at line 325 " line 325, in pool.map(api_search, url_dict)".

The other picture is the errors in GitDorker.py at line 140 and 164
" line 140, in token_round_robin current_token = tokens_list[n] IndexError: list index out of range"
"line 164, in api_search headers = {"Authorization": "token " + token_round_robin()}"

←[0mTraceback (most recent call last):$$$$$$$$ Dorking In Progress $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 3/240
File "C:\Users\GuyWhoNotSoSmart\GitDorker\GitDorker.py", line 325, in
pool.map(api_search, url_dict)
File "C:\Users\GuyWhoNotSoSmart\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\Users\GuyWhoNotSoSmart\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 771, in get
raise self._value
File "C:\Users\GuyWhoNotSoSmart\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users\GuyWhoNotSoSmart\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 48, in mapstar
return list(map(*args))
File "C:\Users\GuyWhoNotSoSmart\GitDorker\GitDorker.py", line 164, in api_search
headers = {"Authorization": "token " + token_round_robin()}
File "C:\Users\GuyWhoNotSoSmart\GitDorker\GitDorker.py", line 140, in token_round_robin
current_token = tokens_list[n]
IndexError: list index out of range
Screenshot (148)_LI
Screenshot (149)
Screenshot (150)_LI
Screenshot (151)_LI

Variable error

Wondering if anyone is having this issue:

File "GitDorker.py", line 485, in
sys.stdout.write(colored('%s' % new_url, 'white'))
NameError: name 'new_url' is not defined

Thanks

only positive results

It would be cool if there were a function --results whitch outputs in terminal/file only the + results instead of # and -

API frequency limit

Can you add GitHub user name and password options for configuring users? This will not be limited by API frequency.

this is my tokenslist, I have six token, But it still makes mistakes

image

python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -d Dorks/medium_dorks.txt -o tesla

image

Secondary rate limit error

gitdorker-error

Already similar kind of one issue #19 is there and it is closed. But the solution given in the issue was increase the no. of personal tokens, but i have already done that. I first run the command (python3 GitDorker.py -d Dorks/akeyless-dorks.txt -q akeyless.io -tf tf/TOKENSFILE -o akeyless-output.txt) with 2 tokens, it showed me the same error and then i run the command with four tokens, then also i got the same error. And the token is placed in a text file as per your guidelines only(i.e., without spaces and without newlines). I dont know what is the issue here. Pls help...

[-] error occurred: https://docs.github.com/rest

i am using 5 tokens from 2 different accounts
command i tried-
python3 GitDorker.py -tf /root/git_tokens.txt -org orgname -d /root/alldorksv3 -o githubdorks.txt
also error same with "-u mygithubaccount"
weird thing is with -t single_token both above options works fine
gitdork1
but quite slow.
please help i want to use -tf option somehow.

Feature request: support for GHE

Hi @obheda12 ,

Any plans to support Github enterprise in near future?

technically for this feature, it need to search only dorks without any query (or query optional) for internal git servers.

This will be very helpful feature for PT or red teams.

Empty CSV

Problem: Every time I run gitdorker I get a 0 byte CSV file

  • I am running the latest version of GitDorker and python 3.8.5
  • I am using this command:

python3 GitDorker.py -tf example_tf -org example_org -d alldorksv3 -output example_out

but example_out.csv is always empty, despite seeing lots of results in the console output

Quieries file

Hello, it would be cool if there were a function "-qf", so you could pass the program many domains like
tesla.com
teslamtoros.com
and so on and the program iterates throught them instead creating a new proccess for each domain with copy-paste

Provide a Dockerfile?

It would be really nice to have the ability to run this via Docker with the ability to just pass in the env variables. Would this be something you'd like to see contributed?

Hello

Bro whats command in terminal ? if i want to found or grab Bulk Query???

NameError new_url not defined

[-] Traceback (most recent call last):
File "/root/Tools/GitDorker/GitDorker.py", line 404, in
sys.stdout.write(colored('%s' % new_url, 'white'))
NameError: name 'new_url' is not defined

Finding with GitDoker but retorning nothing on browser?

Hey

I tried your project and generate a access key as advised, it worked and produced some output with potential results. However, when I copy and past the link it always says that no results were found. I'm logged with the same account and also tried with a new incognito window.

Ant advise?

-k keyword not working

am I missing something with the keyword? (-k) tried from dork file results and it finds nothing:
python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -k filename:sshd_config -o tesla
python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -k language:yaml -o tesla
python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -k "pwd" -o tesla
python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -k "slack_api" -o tesla
python3 GitDorker.py -tf tf/TOKENSFILE -q tesla.com -k "private_key" -o tesla

with and without quotes and alot of combos.
any ideas?
just want to search a single term/keyword.

Error with itertools

When try to install the requirements. got this error message.
ERROR: Could not find a version that satisfies the requirement itertools (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for itertools (from -r requirements.txt (line 1))

error occurred: https://docs.github.com/v3/search/

Hello Omar, I am getting this error when I run the following command python3 /home/GitDorker/GitDorker.py -tf /home/git_token.txt -org target -d /home/GitDorker/Dorks/alldorks.txt -o gitdorks_target.txt

gitdorker_error

rate limit error :(

python3 GitDorker.py -q teslamotors.com -d Dorks/medium_dorks.txt -tf tf/TOKENSFILE

When I try to run the above command I get the rate limit error as shown below even though I'm using two unique git tokens. Please help me to resolve this issue.
MicrosoftTeams-image (6)

rate-limit with valid token

is this script still work?

i am getting this error with valid token that never used:
https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
also which one of token type need? Fine-grained or classic

[#] 0 organizations found.
[#] 0 users found.
[#] 240 dorks found.
[#] 0 keywords found.
[#] 1 queries ran.
[#] 240 urls generated.
[#] 1 tokens being used.
[#] running 1 threads.
[#] 29 requests per minute allowed

[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits
[-] error occurred: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits

show error,显示报错了

image

File "GitDorker.py", line 325, in
pool.map(api_search, url_dict)
File "D:\python38\lib\multiprocessing\pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\python38\lib\multiprocessing\pool.py", line 771, in get
raise self._value
File "D:\python38\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "D:\python38\lib\multiprocessing\pool.py", line 48, in mapstar
return list(map(*args))
File "GitDorker.py", line 164, in api_search
headers = {"Authorization": "token " + token_round_robin()}
File "GitDorker.py", line 140, in token_round_robin
current_token = tokens_list[n]
IndexError: list index out of range

User search failed

When I run the tool to search selected users on GitHub I get the following error, any recommendations?
error-gitdorker

the -q option seem to be broken.

greetings while using the -q option it seems to not generate or fetch the organization's name. there's also another issue don't know if it is changes to Github on token usage or changed URL but it also doesn't seem to generate the search URL doesn't generate the search uris
Screenshot from 2021-10-06 12-22-23

Main command error due to case sensitive folder name

To run the GitDorker script, author has given sample command on the main page. https://github.com/obheda12/GitDorker

The command is python3 GitDorker.py -tf TOKENSFILE -q tesla.com -d dorks/DORKFILE -o tesla

If user runs this command as it is, it will give error because the dorks folder in main directory is named as Dorks and in command its written as dorks

Please make D capital in command OR rename the folder from Dorks to dorks

Getting error


/ _ ___ ___ __ / / /__
/ , / -|-</ // / / __(-<
//||_//_,//_/__/


[+] SUCCESS | RESULTS RETURNED
[#] NEUTRAL | NO RESULTS RETURNED
[-] FAILURE | RATE LIMITS OR API FAILURE

QUERY PROVIDED: *.com

[-] Traceback (most recent call last):
File "GitDorker.py", line 404, in
sys.stdout.write(colored('%s' % new_url, 'white'))
NameError: name 'new_url' is not defined

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.