-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFindProgram.py
77 lines (63 loc) · 3.16 KB
/
FindProgram.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from googlesearch import search
import time, os, argparse, requests, colorama , sys
colorama.init()
banner = colorama.Fore.RED + """
███████╗██╗███╗ ██╗██████╗ ██████╗ ██████╗ ██████╗
██╔════╝██║████╗ ██║██╔══██╗ ██╔══██╗██╔══██╗██╔══██╗
█████╗ ██║██╔██╗ ██║██║ ██║ ██████╔╝██████╔╝██████╔╝
██╔══╝ ██║██║╚██╗██║██║ ██║ ██╔══██╗██╔══██╗██╔═══╝
██║ ██║██║ ╚████║██████╔╝ ██████╔╝██████╔╝██║
╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝
""" + colorama.Fore.CYAN + """Twitter: @Alyrezo
Github: https://github.com/Alyrezo
"""
parser = argparse.ArgumentParser()
parser.add_argument('--silence',action="store_const",const=True,help="Not displaying the banner")
parser.add_argument('-n','--nonstop',action="store_const",const=True,help="non stop crawling")
parser.add_argument('-d','--dork',type=str,help="for using your custom dork")
parser.add_argument('-o','--output',type=str,help="result export as txt file")
parser.add_argument('-c','--count',type=int,help='count of domains it finds')
parser.add_argument('-t','--tld',type=str,help="for sort Top-Level Domain")
args = parser.parse_args()
if args.dork == None:
dork = 'inurl:"security.txt" ext:txt -github -wikipedia'
if args.tld != None:
dork = f"site:{args.tld} " + dork
else:
dork = str(args.dork).replace("'","")
if args.silence == None:
print(banner)
print(colorama.Fore.YELLOW + "[!] " + dork)
try:
os.remove(".google-cookie")
except:
pass
if args.output != None:
file = args.output
with open(file,'w') as tmp:
tmp.close()
count = 0
try:
for results in search(dork, tld="com", lang="en",num=5, start=0, stop=None, pause=2):
if args.silence == None:
print(colorama.Fore.GREEN +'[+] '+results[results.find('/',results.find('/'))+2:results.find('/',results.find('/')+2)])
try:
print(colorama.Fore.BLUE + requests.get(results,timeout=2).text+'\n\n')
except:
pass
else:
print(colorama.Fore.GREEN + results)
if args.count != None:
if count == args.count:
break
else:
count += 1
if args.output != None:
with open(file,'a') as tmp:
tmp.write(results + '\n')
if args.nonstop or args.count or args.silence == None:
print('\n' + colorama.Fore.YELLOW + '[!] continue...',end='')
input()
time.sleep(0.1)
except KeyboardInterrupt:
sys.exit()