Skip to content

Commit 27f5385

Browse files
committed
Also look for github-dorks.txt in sys.prefix
1 parent c7e4c68 commit 27f5385

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

github-dork.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
import feedparser
99
from copy import copy
10-
from sys import stderr
10+
from sys import stderr, prefix
1111

1212
gh_user = os.getenv('GH_USER', None)
1313
gh_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:

0 commit comments

Comments
 (0)