本文整理匯總了Python中spidertool.SQLTool.escapewordby方法的典型用法代碼示例。如果您正苦於以下問題:Python SQLTool.escapewordby方法的具體用法?Python SQLTool.escapewordby怎麽用?Python SQLTool.escapewordby使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類spidertool.SQLTool
的用法示例。
在下文中一共展示了SQLTool.escapewordby方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: storedata
# 需要導入模塊: from spidertool import SQLTool [as 別名]
# 或者: from spidertool.SQLTool import escapewordby [as 別名]
def storedata(ip='',port='',hackinfo=None):
sqlTool=Sqldatatask.getObject()
localtime=str(time.strftime("%Y-%m-%d %X", time.localtime()))
insertdata=[]
# if islocalwork==0:
# work=[]
# dic={"table":config.Config.iptable,"select_params": ['ip','vendor','osfamily','osgen','accurate','updatetime','hostname','state'],"insert_values": [(temphosts,tempvendor,temposfamily,temposgen,tempaccuracy,localtime,temphostname,tempstate)]}
# tempdata={"func":'replaceinserttableinfo_byparams',"dic":dic}
# jsondata=uploaditem.UploadData(url=self.webconfig.upload_ip_info,way='POST',params=tempdata)
# work.append(jsondata)
# self.uploadwork.add_work(work)
# else:
hackinfo=SQLTool.escapewordby(str(hackinfo))
extra=' on duplicate key update hackinfo=\''+hackinfo+'\' , timesearch=\''+localtime+'\''
insertdata.append((str(ip),port,hackinfo,str(port)))
sqldatawprk=[]
dic={"table":config.Config.porttable,"select_params":['ip','port','hackinfo','portnumber'],"insert_values":insertdata,"extra":extra}
tempwprk=Sqldata.SqlData('inserttableinfo_byparams',dic)
sqldatawprk.append(tempwprk)
sqlTool.add_work(sqldatawprk)
pass
示例2: storedata
# 需要導入模塊: from spidertool import SQLTool [as 別名]
# 或者: from spidertool.SQLTool import escapewordby [as 別名]
def storedata(ip='',port='',hackinfo=None):
sqlTool=Sqldatatask.getObject()
localtime=str(time.strftime("%Y-%m-%d %X", time.localtime()))
insertdata=[]
hackinfo=SQLTool.escapewordby(str(hackinfo))
extra=' on duplicate key update disclosure=\''+hackinfo+'\' , timesearch=\''+localtime+'\''
insertdata.append((str(ip),port,hackinfo,str(port)))
dic={"table":config.Config.porttable,"select_params":['ip','port','disclosure','portnumber'],"insert_values":insertdata,"extra":extra}
if islocalwork==0:
work=[]
tempdata={"func":'inserttableinfo_byparams',"dic":dic}
jsondata=uploaditem.UploadData(url=webconfig.WebConfig.upload_ip_info,way='POST',params=tempdata)
work.append(jsondata)
temp=uploadtask.getObject()
temp.add_work(work)
else:
sqldatawprk=[]
tempwprk=Sqldata.SqlData(func='inserttableinfo_byparams',dic)
sqldatawprk.append(tempwprk)
sqlTool.add_work(sqldatawprk)
print 'fuzz 數據存儲'
pass