利用python和VirusTotal的API接口写的在线样本扫描的脚本
来源:互联网 发布:mac 删除智能文件夹 编辑:程序博客网 时间:2024/06/12 01:16
import requestsimport sysimport osimport time# 简单实现 将批量的Sha256 上传到https://www.virustotal.com/ 进行病毒分析,在JSON中返回结果40多家vendor的结果VT_Unknown=set()def CheckVT(): try: sha2file=open(sys.argv[2],"r") info = open("CheckVT_error.log","w") # if time out ,we can find here except IOError,e: print e index = 0 success=0 ttt=0 while True: shalist='' number = 0 while True: sha=sha2file.readline() #print sha if len(sha)<10: break index=index+1 sha=sha.replace('\n','') sha=sha.replace('\r','') shalist=shalist+'%s,'%(sha) number = number + 1 if number == 25: break if len(shalist)==0: break params = {'apikey': '968e3bc6d33c79c2b957696cf53b3f7c9c607411ee623e67dd3b57d52f8986e4', 'resource': '%s'%(shalist)} try: response = requests.get('https://www.virustotal.com/vtapi/v2/file/report', params=params) json_response_list = response.json() except: print >> info,'Query fail:%s'%(shalist) continue for json_response in json_response_list: sha = json_response['resource'] #print json_response positives = int(json_response['positives']) try: if json_response['scans']['Symantec']['detected']: #print json_response['scans']['Symantec']['detected'] positives = positives-1 except: pass if json_response['response_code']==1 and positives < 2 : # least 3 vendor convict #print positives VT_Unknown.add(sha+"\n" ) success=success+1 sys.stdout.write("\rProcess:%d. Result: %d"%(index,success)) sys.stdout.flush() info.close() sha2file.close() print "VT_Unknown\n",len( VT_Unknown), VT_Unknown resultfile = open(sys.argv[2],'w') resultfile.writelines(ManualLabel_result) resultfile.close() return
0 0
- 利用python和VirusTotal的API接口写的在线样本扫描的脚本
- python-上传样本到virustotal,查询扫描信息
- virustotal.com上的公共接口学习
- Virustotal的使用
- Virustotal——上传样本保存扫描结果
- python-封装得到virustotal扫描结果
- 在线生成网址二维码的API接口
- python写的打包脚本
- python写的投票脚本
- python写的翻译脚本
- virustotal提交目录样本
- 最好用的API调试接口 在线接口测试工具
- 最好用的API调试接口 在线接口测试工具
- 利用OPENCV写的从视频中提取图片样本的小程序
- 利用OPENCV写的从视频中提取图片样本的小程序
- iOS的服务端api接口怎么写
- 其他网站和应用的Python接口API
- python写的读写文件的脚本
- JAVA的动态代理
- jsp页面将数据导出到Excel
- SED AND AWK
- CXF的三种发布方式和客户端调用方法
- 关于目前开源的物联网框架。
- 利用python和VirusTotal的API接口写的在线样本扫描的脚本
- Android 下使用 Http 协议实现多线程断点续传下载
- exe调用dll中的对话框防资源冲突解决之道
- Spring是如何缓存单例bean
- jquery操作节点;jquery遍历节点
- VC的生产者消费者模型
- FMS Flex 视频应用开发
- Hive CSV Support(csv-serde)
- 第十五周-(项目三)带姓名的成绩单。