17
17
from module .api .dns import dns_result , dns_request
18
18
from module .api .shodan import shodan_api
19
19
from core .scan import scan
20
- from core .exploit import exploit
21
20
from identify .identify import Identify
22
21
from concurrent .futures import ThreadPoolExecutor , wait , ALL_COMPLETED
23
22
24
23
25
24
class Core (object ):
26
25
@staticmethod
27
26
def control_options (args ): # 选项控制,用于处理所有选项
27
+ mode = "poc"
28
28
delay = globals .get_value ("DELAY" ) # 获取全局变量延时时间DELAY
29
29
now_warn = now .timed (de = delay ) + color .red_warn ()
30
30
if args .socks :
@@ -37,8 +37,6 @@ def control_options(args): # 选项控制,用于处理所有选项
37
37
exit (0 )
38
38
if args .thread_num != 10 : # 判断是否为默认线程
39
39
print (now .timed (de = 0 ) + color .yel_info () + color .yellow (" Custom thread number: " + str (args .thread_num )))
40
- if args .vul is not None : # 判断是否-v进行漏洞利用
41
- args .mode = "exp" # 若进行漏洞利用修改模式为exp
42
40
if args .debug is False : # 判断是否开启--debug功能
43
41
print (now .timed (de = delay ) + color .yel_info () + color .yellow (" Using debug mode to echo debug information" ))
44
42
globals .set_value ("DEBUG" , "debug" ) # 设置全局变量DEBUG
@@ -55,7 +53,7 @@ def control_options(args): # 选项控制,用于处理所有选项
55
53
if os .path .isfile (args .O_JSON ): # 判断json输出文件是否冲突
56
54
print (now .timed (de = delay ) + color .red_warn () + color .red (" The json file: [" + args .O_JSON + "] already exists" ))
57
55
exit (0 )
58
- if args . mode is None or args . mode == "poc" : # 判断是否进入poc模式
56
+ if mode == "poc" : # 判断是否进入poc模式
59
57
if args .url is not None and args .file is None : # 判断是否为仅-u扫描单个URL
60
58
args .url = url_check (args .url ) # 处理url格式
61
59
if survival_check (args .url ) == "f" : # 检查目标存活状态
@@ -113,11 +111,6 @@ def control_options(args): # 选项控制,用于处理所有选项
113
111
print (now .timed (de = delay ) + color .yel_info () + color .cyan (" Scan result text saved to: " + args .O_TEXT ))
114
112
if args .O_JSON :
115
113
print (now .timed (de = delay ) + color .yel_info () + color .cyan (" Scan result json saved to: " + args .O_JSON ))
116
- elif args .mode == "exp" : # 漏洞利用模式参数较少
117
- if args .vul is not None and args .url is not None : # 判断是否进入漏洞利用模式
118
- core .control_webapps ("url" , args .url , args .vul , "exp" )
119
- else :
120
- print (now_warn + color .red (" Options error, -v must specify -u" ))
121
114
else :
122
115
print (now_warn + color .red (" Options error ... ..." ))
123
116
@@ -256,9 +249,6 @@ def control_webapps(target_type, target, webapps, mode):
256
249
joinall (gevent_pool ) # 运行协程池
257
250
wait (thread_poc , return_when = ALL_COMPLETED ) # 等待所有多线程任务运行完
258
251
print (now .timed (de = 0 ) + color .yel_info () + color .yellow (" Scan completed and ended " ))
259
- elif mode == "exp" : # 漏洞利用
260
- vul_num = webapps
261
- exploit (target , vul_num ) # 调用core中的exploit
262
252
263
253
@staticmethod
264
254
def scan_webapps (webapps_identify , thread_poc , thread_pool , gevent_pool , target ):
0 commit comments