portarray = [] if count > 0: validresult = True import base64 for temp in result: aport = ports.Port( ip=temp['ip'], port=temp['port'], timesearch=temp['timesearch'], state=temp['state'], name=temp['name'], product=temp['product'], version=temp['version'], script=base64.b64encode( SQLTool.getdecodeproperty(temp, 'script')), detail=SQLTool.getdecodeproperty(temp, 'detail'), head=SQLTool.getdecodeproperty(temp, 'head'), city=temp['city'], hackinfo=SQLTool.getdecodeproperty(temp, 'hackinfo'), disclosure=SQLTool.getdecodeproperty(temp, 'disclosure')) # aport=ports.Port(ip=temp[0],port=temp[1],timesearch=temp[2],state=temp[3],name=temp[4],product=temp[5],version=temp[6],script=temp[7]) portarray.append(aport) print str(count) + ' ' + str(pagecount) return portarray, count, pagecount return [], 0, pagecount def portshow(ip='', port='',
except Exception,e: print str(e)+'portcontrol 69' if DBhelp is not None: DBhelp.closedb() return [],0,0 if DBhelp is not None: DBhelp.closedb() DBhelp=None portarray=[] if count>0: validresult=True import base64 for temp in result : aport=ports.Port(ip=temp['ip'],port=temp['port'],timesearch=temp['timesearch'],state=temp['state'],name=temp['name'],product=temp['product'],version=temp['version'],script=base64.b64encode(SQLTool.getdecodeproperty(temp,'script')),detail=SQLTool.getdecodeproperty(temp,'detail'),head=SQLTool.getdecodeproperty(temp,'head'),city=temp['city'],hackinfo=SQLTool.getdecodeproperty(temp,'hackinfo'),disclosure=SQLTool.getdecodeproperty(temp,'disclosure')) # aport=ports.Port(ip=temp[0],port=temp[1],timesearch=temp[2],state=temp[3],name=temp[4],product=temp[5],version=temp[6],script=temp[7]) portarray.append(aport) print str(count)+' '+str(pagecount) return portarray,count,pagecount return [],0,pagecount def portshow(ip='',port='',timesearch='',state='',name='',product='',version='',script='',detail='',page='0',extra='',command='and',head='',city='',order='port'): validresult=False request_params=[] values_params=[] if ip!='': request_params.append('ip') values_params.append(SQLTool.formatstring(ip)) if port!='': request_params.append('port')