def fingerscan(self, taskID, url, proxy=0, thread=50, time=5): url = add_http(url) # os.system("cd "+BASE_DIR+"/ScanMoudle/webscan/fingerdetect/") cmd = [ 'python2', 'TideFinger.py', '-u', url, '-p', str(proxy), '-m', str(thread), '-t', str(time) ] cmd = ' '.join(cmd) print(cmd) result = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, cwd=PROJECT_PATH + "/ScanMoudle/webscan/fingerdetect/") res = str(result.stdout.read())[2:-3] # print(json.dumps(res)) try: print(res) json.loads(res) _ = MongoDB() _.add_cms_finger(taskID, res) except Exception as e: print(e) return res
def ServInfo(self, taskID, url): compile_ip = re.compile( '^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$' ) if compile_ip.match(url): url = "http://" + url # url = "http://blog.zzp198.cn" # url = 'https://blog.ixuchao.cn' res = WebEye(url) res.run() cms = res.cms_list if 'Server' in cms.keys(): del cms['Server'] print(cms) _ = MongoDB() _.add_cms_finger(taskID, json.dumps(cms)) return cms