本文整理汇总了Python中virus_total_apis.PublicApi.get_url_report方法的典型用法代码示例。如果您正苦于以下问题:Python PublicApi.get_url_report方法的具体用法?Python PublicApi.get_url_report怎么用?Python PublicApi.get_url_report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virus_total_apis.PublicApi
的用法示例。
在下文中一共展示了PublicApi.get_url_report方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_url_report
# 需要导入模块: from virus_total_apis import PublicApi [as 别名]
# 或者: from virus_total_apis.PublicApi import get_url_report [as 别名]
def test_get_url_report(self):
vt = PublicApi(API_KEY)
try:
print(json.dumps(vt.get_url_report('www.wired.com'), sort_keys=False, indent=4))
except Exception as e:
self.fail(e)
示例2: link_to_virustotal
# 需要导入模块: from virus_total_apis import PublicApi [as 别名]
# 或者: from virus_total_apis.PublicApi import get_url_report [as 别名]
def link_to_virustotal(link, pkt):
''' IN CASE WE FOUND GET link, WE SCAN IT '''
print 'SCANNING %s'%link
virus_total_instance = PublicApi('2e1d7b6e998ed0a9830269571ecffa110e41dd8bf34b88ad41e40b4351165d18')
REQ = virus_total_instance.scan_url(link)
print 'Waiting for virustotal'
while True:
if 'Scan finished' in str(virus_total_instance.get_url_report(link)):
print 'Scan finished!'
REP = virus_total_instance.get_url_report(link)['results']['positives']
break
else:
print 'Naaa not yet'
if REP == '0' or REP == 0:
print 'SCANNED %s - VERDICT OK [REP=%s]'%(link,REP)
pkt.accept()
else:
print 'SCANNED %s - VERDICT KO [REP=%s]'%(link,REP)
pkt.drop()
'''
示例3: vt_url
# 需要导入模块: from virus_total_apis import PublicApi [as 别名]
# 或者: from virus_total_apis.PublicApi import get_url_report [as 别名]
def vt_url(input):
vt = VirusTotalPublicApi("87ab79d0a21d9a7ae5c5558969c7d6b38defa1901b77d27796ae466b3823c776")
try:
input_list = [input_item.strip() for input_item in input.split(",")]
for ip in input_list:
scan_report = vt.get_url_report(ip)
return render_template(
"vt-url.html",
url_request=scan_report.get("results").get("url").replace(":", "[:]").replace(".", "[.]"),
scan_date=scan_report.get("results").get("scan_date"),
positives=scan_report.get("results").get("positives"),
total=scan_report.get("results").get("total"),
link=scan_report.get("results").get("permalink"),
)
except Exception as e:
return render_template("vt-url.html", text="Error: Please try again.")