-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitDork.py
36 lines (33 loc) · 1.2 KB
/
gitDork.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
try:
import time
from sys import __stdout__, stdout
from threading import Thread
from subprocess import *
import os
import sys
import subprocess
import threading
import readline
from termcolor import colored
except ImportError:
print("\ncheck for prerequisities ")
def githubDorker(target):
cmd = [
'python3 ~/Tools/GitDorker/GitDorker.py -tf ~/Tools/.github_tokens -e 5 -q '+target +
' -p -ri -d ~/Tools/GitDorker/Dorks/medium_dorks.txt | grep "\[+\]" | grep "git" | anew -q output/gitdork/gitdorks.txt',
'sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" output/gitdork/gitdorks.txt'
]
try:
for c in cmd:
proc = subprocess.run(
c, shell=True, stderr=STDOUT, stdout=sys.stdout)
if(proc.returncode != 0):
print(colored('Step 1 Failed! Check/Update prerequisitie packages. \nError: ',
'blue', attrs=['bold']) + proc.stderr.rstrip())
return False
else:
print(colored("[x] Executed", 'blue', attrs=['bold']))
return True
except:
print("Something went wrong! Check prerequisities.\n")
return False