1717from module .api .dns import dns_result , dns_request
1818from module .api .shodan import shodan_api
1919from core .scan import scan
20- from core .exploit import exploit
2120from identify .identify import Identify
2221from concurrent .futures import ThreadPoolExecutor , wait , ALL_COMPLETED
2322
2423
2524class Core (object ):
2625 @staticmethod
2726 def control_options (args ): # 选项控制,用于处理所有选项
27+ mode = "poc"
2828 delay = globals .get_value ("DELAY" ) # 获取全局变量延时时间DELAY
2929 now_warn = now .timed (de = delay ) + color .red_warn ()
3030 if args .socks :
@@ -37,8 +37,6 @@ def control_options(args): # 选项控制,用于处理所有选项
3737 exit (0 )
3838 if args .thread_num != 10 : # 判断是否为默认线程
3939 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
4240 if args .debug is False : # 判断是否开启--debug功能
4341 print (now .timed (de = delay ) + color .yel_info () + color .yellow (" Using debug mode to echo debug information" ))
4442 globals .set_value ("DEBUG" , "debug" ) # 设置全局变量DEBUG
@@ -55,7 +53,7 @@ def control_options(args): # 选项控制,用于处理所有选项
5553 if os .path .isfile (args .O_JSON ): # 判断json输出文件是否冲突
5654 print (now .timed (de = delay ) + color .red_warn () + color .red (" The json file: [" + args .O_JSON + "] already exists" ))
5755 exit (0 )
58- if args . mode is None or args . mode == "poc" : # 判断是否进入poc模式
56+ if mode == "poc" : # 判断是否进入poc模式
5957 if args .url is not None and args .file is None : # 判断是否为仅-u扫描单个URL
6058 args .url = url_check (args .url ) # 处理url格式
6159 if survival_check (args .url ) == "f" : # 检查目标存活状态
@@ -113,11 +111,6 @@ def control_options(args): # 选项控制,用于处理所有选项
113111 print (now .timed (de = delay ) + color .yel_info () + color .cyan (" Scan result text saved to: " + args .O_TEXT ))
114112 if args .O_JSON :
115113 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" ))
121114 else :
122115 print (now_warn + color .red (" Options error ... ..." ))
123116
@@ -256,9 +249,6 @@ def control_webapps(target_type, target, webapps, mode):
256249 joinall (gevent_pool ) # 运行协程池
257250 wait (thread_poc , return_when = ALL_COMPLETED ) # 等待所有多线程任务运行完
258251 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
262252
263253 @staticmethod
264254 def scan_webapps (webapps_identify , thread_poc , thread_pool , gevent_pool , target ):
0 commit comments