def port_deal(ip="", port="", name="", productname="", head=None, context=None, nmapscript=None): head = None ans = None keywords = name hackinfo = "" port_function = getFunc(name, port, productname) if port_function != None: head, ans, keywords, hackinfo = port_function(ip=ip, port=port, name=name, productname=productname) else: temp = pocsearchtask.getObject() temp.add_work([(head, context, ip, port, productname, keywords, nmapscript, name)]) keyword = {} keyword["ip"] = [ip] from spidertool import redistool redisresult = redistool.get(ip) if redisresult: print "从redids读取位置信息" keyword = redisresult else: keyword = getgeoipinfo.getGeoipinfo(keyword) redistool.set(ip, keyword) print "从redids写入位置信息" keyword["keywords"] = keywords return head, ans, keyword, hackinfo
def port_deal(ip='', port='', name='', productname='', head=None, context=None, nmapscript=None): head = None ans = None keywords = name hackinfo = '' port_function = getFunc(name, port, productname) if port_function != None: head, ans, keywords, hackinfo = port_function(ip=ip, port=port, name=name, productname=productname) else: temp = pocsearchtask.getObject() temp.add_work([(head, context, ip, port, productname, keywords, nmapscript, name)]) keyword = {} keyword['ip'] = [ip] from spidertool import redistool redisresult = redistool.get(ip) if redisresult: print '从redids读取位置信息' keyword = redisresult else: keyword = getgeoipinfo.getGeoipinfo(keyword) redistool.set(ip, keyword) print '从redids写入位置信息' keyword['keywords'] = keywords return head, ans, keyword, hackinfo
def identify_main(head='', context='', ip='', port='', productname='', protocol='', nmapscript=''): keywords = '' hackinfo = '' # print '运行前状态' # gc.collect() # objgraph.show_growth() print ip, port, '正在纳入检测的队列' try: from httpdect import headdect from fluzzdetect import fuzztask from vuldect import pocsearchtask keywords, hackinfo = headdect.dect(head=head, context=context, ip=ip, port=port, protocol=protocol) fuz = fuzztask.getObject() fuz.add_work([(head, context, ip, port, productname, keywords, nmapscript, protocol)]) temp = pocsearchtask.getObject() temp.add_work([(head, context, ip, port, productname, keywords, nmapscript, protocol)]) except Exception, e: print e pass
def identify_main(head='',context='',ip='',port='',productname='',protocol='',nmapscript=''): keywords='' hackresults='' # print '运行前状态' # gc.collect() # objgraph.show_growth() print "detection::page_identify::identify_main()", ip + ":" + port,'正在纳入检测的队列' try: # from httpdect import headdect #webdetection缺失 from fluzzdetect import fuzztask # 只给了这部分代码, 检测拼接的子url和父url from vuldect import pocsearchtask # 通过webdetection获取webinfo,hackresults为空 # keywords, hackresults = headdect.dect(head=head, context=context, ip=ip, port=port, protocol=protocol) # print "\ndetection::page_identify::identify_main() fuzztask begin detect...." fuz = fuzztask.getObject() fuz.add_work([(head,context,ip,port,productname,keywords,nmapscript,protocol)]) # print "\ndetection::page_identify::identify_main() pocsearchtask begin init...." # print ("detection::vuldetect::head[%s]\nip[%s]\nport[%s]\nproductname[%s]\nkeywords[%s]\nnmapscript[%s]\nprotocol[%s]\n"%(str(head),str(ip),str(port),str(productname),str(keywords),str(nmapscript),str(protocol))) temp = pocsearchtask.getObject() # print "\ndetection::page_identify::identify_main() pocsearchtask begin detect...." temp.add_work([(head,context,ip,port,productname,keywords,nmapscript,protocol)]) except Exception ,e: print traceback.print_exc() pass
def port_deal(ip='',port='',name='',productname='',head=None,context=None,nmapscript=None): head=None ans=None keywords=name hackinfo='' port_function=getFunc(name,port,productname) if port_function !=None: head,ans,keywords,hackinfo=port_function(ip=ip,port=port,name=name,productname=productname) else: temp=pocsearchtask.getObject() temp.add_work([(head,context,ip,port,productname,keywords,nmapscript,name)]) return head,ans,keywords,hackinfo
def identify_main(head='',context='',ip='',port='',productname='',protocol='',nmapscript=''): keywords='' hackinfo='' # print '运行前状态' # gc.collect() # objgraph.show_growth() print ip,port,'正在纳入检测的队列' try: from httpdect import headdect from fluzzdetect import fuzztask from vuldect import pocsearchtask keywords,hackinfo=headdect.dect(head=head,context=context,ip=ip,port=port,protocol=protocol) fuz=fuzztask.getObject() fuz.add_work([(head,context,ip,port,productname,keywords,nmapscript,protocol)]) temp=pocsearchtask.getObject() temp.add_work([(head,context,ip,port,productname,keywords,nmapscript,protocol)]) except Exception ,e: print e pass