def match_POC(self, head='', context='', ip='', port='', productname='', keywords='', hackinfo='', POCS=None, **kw): haveresult = False for poc in POCS: result = poc.verify(head=head, context=context, ip=ip, port=port, productname=productname, keywords=keywords, hackinfo=hackinfo) if result['result']: haveresult = callbackresult.storedata(ip=ip, port=port, hackinfo=result) print '发现漏洞' break if haveresult == False: print '-----------------------' print '暂未发现相关漏洞'
def match_POC(self,head='',context='',ip='',port='',productname=None,keywords='',hackinfo='',POCS=None, **kw): haveresult=False dataresult=[] i=0 for poc in POCS: result = poc.verify(head=head,context=context,ip=ip,port=port,productname=productname,keywords=keywords,hackinfo=hackinfo) if result['result']: i=1 dataresult.append(result) print '发现漏洞' if i==1: callbackresult.storedata(ip=ip,port=port,hackinfo=dataresult) pass else: print '-----------------------' print '暂未发现相关漏洞' del POCS
def match_POC(self, head='', context='', ip='', port='', productname='', keywords='', hackinfo='', POCS=None, **kw): haveresult = False dataresult = [] i = 0 for poc in POCS: result = poc.verify(head=head, context=context, ip=ip, port=port, productname=productname, keywords=keywords, hackinfo=hackinfo) if result['result']: i = 1 dataresult.append(result) print '发现漏洞' if i == 1: callbackresult.storedata(ip=ip, port=port, hackinfo=dataresult) else: print '-----------------------' print '暂未发现相关漏洞' del POCS
def match_POC(self,head='',context='',ip='',port='',productname='',keywords='',hackinfo='',POCS=None, **kw): haveresult=False for poc in POCS: result = poc.verify(head=head,context=context,ip=ip,port=port,productname=productname,keywords=keywords,hackinfo=hackinfo) if result['result']: haveresult=callbackresult.storedata(ip=ip,port=port,hackinfo=result) print '发现漏洞' break; if haveresult == False: print '-----------------------' print '暂未发现相关漏洞'
if type(result) == dict: if result['result']: i = 1 dataresult.append(result) print '发现漏洞' except Exception, e: print e, poc else: pass if i == 1: callbackresult.storedata(ip=ip, port=port, hackinfo=dataresult) # callbackresult.storeresult(dataresult) pass else: print '-----------------------' print '暂未发现相关漏洞' del POCS @classmethod def __match_rules(self, pocclass=None, head='', context='', ip='', port='', productname=None,
result={} i=0 for poc in POCS: try: result = poc.verify(head=head,context=context,ip=ip,port=port,productname=productname,keywords=keywords,hackinfo=hackinfo) except Exception,e: print e if result['result']: i=1 dataresult.append(result) print '发现漏洞' if i==1: callbackresult.storedata(ip=ip,port=port,hackinfo=dataresult) # callbackresult.storeresult(dataresult) pass else: print '-----------------------' print '暂未发现相关漏洞' del POCS @classmethod def __match_rules(self,pocclass=None,head='',context='',ip='',port='',productname=None,keywords='',hackinfo='', **kw): return pocclass.match_rule(head='',context='',ip='',port='',productname=productname,keywords='',hackinfo='', **kw)