def parse_vt_filescans( apiresults ):
VTRES = []
COLUMNS = [ 'Index', 'Source', 'ScanDate', 'Hash', 'Verdict' ]
counter = 0
for scan in apiresults:
for item in scan:
counter += 1
if item['response_code'] == 0:
VTRES.append([ counter, 'VirusTotal', '---', item['resource'].upper(), '---' ])
elif item['response_code'] == 1:
VTRES.append([ counter, 'VirusTotal', item['scan_date'], item['resource'].upper(), '{}/{}'.format( item['positives'], item['total'] ) ])
TABLE = tabulate( VTRES, headers=COLUMNS )
return TABLE
评论列表
文章目录