我想对上传的文件进行病毒扫描。 我无法控制安装的病毒扫描程序,这是由多方使用不同扫描仪托管的产品。扫描上传的文件C#ASP.net
我试过以下库,但它总是返回eicar文件上的VirusNotFound。 https://antivirusscanner.codeplex.com/
您是否知道其他解决方案?
我想对上传的文件进行病毒扫描。 我无法控制安装的病毒扫描程序,这是由多方使用不同扫描仪托管的产品。扫描上传的文件C#ASP.net
我试过以下库,但它总是返回eicar文件上的VirusNotFound。 https://antivirusscanner.codeplex.com/
您是否知道其他解决方案?
ClamAV的有非常糟糕的检测分数。 VirusTotal不在场所中。
我决定创建多个扫描器CLI包装,包装的NuGet可以在这里找到:https://www.nuget.org/packages?q=avscan
我使用这个库.NET(它使用VirusTotal公共API):
https://github.com/Genbox/VirusTotal.NET
从GitHub一个小例子:
static void Main(string[] args)
{
VirusTotal virusTotal = new VirusTotal("INSERT API KEY HERE");
//Use HTTPS instead of HTTP
virusTotal.UseTLS = true;
FileInfo fileInfo = new FileInfo("testfile.txt");
//Create a new file
File.WriteAllText(fileInfo.FullName, "This is a test file!");
//Check if the file has been scanned before.
Report fileReport = virusTotal.GetFileReport(fileInfo).First();
bool hasFileBeenScannedBefore = fileReport.ResponseCode == 1;
if (hasFileBeenScannedBefore)
{
Console.WriteLine(fileReport.ScanId);
}
else
{
ScanResult fileResults = virusTotal.ScanFile(fileInfo);
Console.WriteLine(fileResults.VerboseMsg);
}
}
完整的例子可以在这里找到:
https://github.com/Genbox/VirusTotal.NET/blob/master/VirusTotal.NET%20Client/Program.cs
Clam AV很不错。 https://www.clamav.net/downloads
您可以使用病毒总API –