forked from timwhitez/crawlergo_x_XRAY
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launcher_new.py
50 lines (41 loc) · 1.19 KB
/
launcher_new.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
#!/usr/bin/python3
# coding: utf-8
import simplejson
import threading
import subprocess
import requests
import warnings
warnings.filterwarnings(action='ignore')
def opt2File(paths):
try:
f = open('crawl_result.txt','a')
f.write(paths + '\n')
finally:
f.close()
def opt2File2(subdomains):
try:
f = open('sub_domains.txt','a')
f.write(subdomains + '\n')
finally:
f.close()
def main(data1):
target = data1
cmd = ["./crawlergo", "-c", "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","-t", "5","-f","smart","--fuzz-path", "--push-to-proxy", "http://127.0.0.1:7888/", "--push-pool-max", "10","--output-mode", "json" , target]
rsp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = rsp.communicate()
try:
result = simplejson.loads(output.decode().split("--[Mission Complete]--")[1])
except:
return
req_list = result["req_list"]
sub_domain = result["sub_domain_list"]
print(data1)
print("[crawl ok]")
for subd in sub_domain:
opt2File2(subd)
print("[scanning]")
if __name__ == '__main__':
file = open("targets.txt")
for text in file.readlines():
data1 = text.strip('\n')
main(data1)