File tree Expand file tree Collapse file tree 3 files changed +34
-9
lines changed
Expand file tree Collapse file tree 3 files changed +34
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ This tool uses [github3.py](https://github.com/sigmavirus24/github3.py) to talk
1313Clone this repository and run:
1414
1515``` shell
16- pip install -r requirements.txt
16+ pip install .
1717```
1818
1919### Usage
@@ -28,17 +28,17 @@ GH_URL - Environment variable to specify GitHub Enterprise base URL
2828Some example usages are listed below:
2929
3030``` shell
31- python github-dork.py -r techgaun/github-dorks # search a single repo
31+ github-dork.py -r techgaun/github-dorks # search a single repo
3232
33- python github-dork.py -u techgaun # search all repos of a user
33+ github-dork.py -u techgaun # search all repos of a user
3434
35- python github-dork.py -u dev-nepal # search all repos of an organization
35+ github-dork.py -u dev-nepal # search all repos of an organization
3636
37- GH_USER=techgaun GH_PWD=< mypass> python github-dork.py -u dev-nepal # search as authenticated user
37+ GH_USER=techgaun GH_PWD=< mypass> github-dork.py -u dev-nepal # search as authenticated user
3838
39- GH_TOKEN=< github_token> python github-dork.py -u dev-nepal # search using auth token
39+ GH_TOKEN=< github_token> github-dork.py -u dev-nepal # search using auth token
4040
41- GH_URL=https://github.example.com python github-dork.py -u dev-nepal # search a GitHub Enterprise instance
41+ GH_URL=https://github.example.com github-dork.py -u dev-nepal # search a GitHub Enterprise instance
4242```
4343
4444### Limitations
Original file line number Diff line number Diff line change 77import time
88import feedparser
99from copy import copy
10- from sys import stderr
10+ from sys import stderr , prefix
1111
1212gh_user = os .getenv ('GH_USER' , None )
1313gh_pass = os .getenv ('GH_PWD' , None )
@@ -87,7 +87,12 @@ def search(repo_to_search=None,
8787 output_filename = None ):
8888
8989 if gh_dorks_file is None :
90- gh_dorks_file = 'github-dorks.txt'
90+ for path_prefix in ['.' , os .path .join (prefix , 'github-dorks/' )]:
91+ filename = os .path .join (path_prefix , 'github-dorks.txt' )
92+ if os .path .isfile (filename ):
93+ gh_dorks_file = filename
94+ break
95+
9196 if not os .path .isfile (gh_dorks_file ):
9297 raise Exception ('Error, the dorks file path is not valid' )
9398 if user_to_search :
Original file line number Diff line number Diff line change 1+ from setuptools import setup
2+
3+ with open ('README.md' , 'r' ) as f :
4+ long_description = f .read ()
5+
6+ setup (
7+ name = 'github-dorks' ,
8+ version = '0.1' ,
9+ description = 'Find leaked secrets via github search.' ,
10+ license = 'Apache License 2.0' ,
11+ long_description = long_description ,
12+ author = 'Samar Dhwoj Acharya (@techgaun)' ,
13+ long_description_content_type = 'text/markdown' ,
14+ scripts = ['github-dork.py' ],
15+ data_files = [('github-dorks' , ['github-dorks.txt' ])],
16+ install_requires = [
17+ 'github3.py==1.0.0a2' ,
18+ 'feedparser==6.0.2' ,
19+ ],
20+ )
You can’t perform that action at this time.
0 commit comments