def worker(self, args): PID, IP_1, Target_IP, Target_Hash = args Scan_ThreadLocal.__target = Target_IP Scan_ThreadLocal.__pid = PID Tmp_INT = 0 KEY_Patch_Module = None PluginPID = self._plugins[PID] if imp.get_magic() == PluginPID[:4]: Data_xuliehua = marshal.loads(PluginPID[8:]) #读序列化数据 Tmp_INT = struct.unpack('<l', PluginPID[4:8])[0] #将二进制数据转换成 Python 数据 else: Data_xuliehua = PluginPID II = self._load_module(Data_xuliehua) if Tmp_INT > 1440345600: KEY_Patch_Module = PluginPID[-48:-16] module_Hash = PluginPID[-16:] if module_Hash != md5.new(PluginPID[:-16]).digest()[::-1]: Logging_Obj.exception('[_load_module_hash_not_match:%s]' % PID)#载入模块的Hash不匹配 return II.curl = miniCurl.Curl(sniff_func=self._audit_sniff, init_cookie=self._cookie, user_agent=self._user_agent, plugin_id=PID, log_func=Mysql_table_insert) self._patch_module(II, KEY_Patch_Module) Day_time_1 = time.time() * 1000 try: II.audit(IP_1) except: Logging_Obj.exception('[M:%s] %s' % (PID, repr(IP_1))) Day_time_2 = time.time() * 1000 Mysql_table_insert('auditlog', uuid=Target_Hash, plugin_id=PID, type=0, arg=repr(IP_1), time=int(Day_time_2 - Day_time_1))
#!/usr/bin/env python # -*- coding: utf-8 -*- from common import * import util import miniCurl curl = miniCurl.Curl() _G = { 'scanport': False, 'subdomain': False, 'target': 'www.abc.com', 'disallow_ip': ['127.0.0.1'], 'kv': {}, #'user_dict':'http://192.168.0.158/1.txt' #'pass_dict':'http://192.168.0.158/1.txt' } util._G = _G def debug(fmt, *args): print(fmt % args) LEVEL_NOTE = 0 LEVEL_INFO = 1 LEVEL_WARNING = 2 LEVEL_HOLE = 3 def _problem(level, body, uuid):