java病毒扫描代码_.NET病毒扫描API

Important note before use: 了解服务条款协议 . 您可以完全访问所有内容:"When you upload or otherwise submit content, you give VirusTotal (and those we work with) a worldwide, royalty free, irrevocable and transferable licence to use, edit, host, store, reproduce, modify, create derivative works, communicate, publish, publicly perform, publicly display and distribute such content."

您可以使用VirusTotal.com的服务,而不是使用本地防病毒程序(从而将程序绑定到特定的防病毒产品并请求客户安装该防病毒产品) .

该站点提供免费服务,您的文件作为输入提供给众多防病毒产品,您将收到一份详细报告,其中包含扫描过程产生的证据 . 通过这种方式,您的解决方案不再与特定的防病毒产品绑定(尽管您已绑定到Internet可用性)

该站点还提供了一个应用程序编程接口,允许以编程方式接近其扫描引擎 .

并且因为没有代码没有答案是完整的,所以直接从VirusTotal.NET库附带的示例客户端获取

static void Main(string[] args)

{

VirusTotal virusTotal = new VirusTotal(ConfigurationManager.AppSettings["ApiKey"]);

//Use HTTPS instead of HTTP

virusTotal.UseTLS = true;

//Create the EICAR test virus. See http://www.eicar.org/86-0-Intended-use.html

FileInfo fileInfo = new FileInfo("EICAR.txt");

File.WriteAllText(fileInfo.FullName, @"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*");

//Check if the file has been scanned before.

FileReport fileReport = virusTotal.GetFileReport(fileInfo);

bool hasFileBeenScannedBefore = fileReport.ResponseCode == ReportResponseCode.Present;

Console.WriteLine("File has been scanned before: " + (hasFileBeenScannedBefore ? "Yes" : "No"));

//If the file has been scanned before, the results are embedded inside the report.

if (hasFileBeenScannedBefore)

{

PrintScan(fileReport);

}

else

{

ScanResult fileResult = virusTotal.ScanFile(fileInfo);

PrintScan(fileResult);

}

... continue with testing a web site ....

}

DISCLAIMER

我绝不参与其中 . 我写这个答案只是因为它似乎是对这4年答案的一个很好的更新 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值