代码拉取完成,页面将自动刷新
#!/usr/bin/env python
import csv
import sys
# Name of file
finput = sys.argv[1]
data = {}
# Open the file
with open(finput, 'r') as csvfile:
# Get file iterator
reader = csv.DictReader(csvfile)
for row in reader:
if row['Risk'] != "None":
name = str(row['Name'])+' '+str(row['CVSS'])
value = str(row['Host'])+':'+str(row['Port'])+"\t("+str(row['Protocol'])+')'
if data.has_key(name):
data[name].append(value)
else:
data[name] = [value]
# The data is printed and saved in files
foutput = "output.txt"
with open(foutput, "w") as output:
for d in data:
print "\n\n"+ d +"\n\n"
output.write("\n\n"+ d +"\n\n")
filtered = sorted(set(data[d]))
for i in filtered:
print i
output.write(i+"\n")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。