【问题标题】:How can you check the results of a virus scan in asp.net c#?如何在 asp.net c# 中检查病毒扫描的结果?
【发布时间】:2011-08-04 13:47:55
【问题描述】:

我有一个 ajax 上传器,允许用户将图片上传到程序,然后再显示给用户。我想在允许该文件保留在服务器中之前检查该文件是否有病毒。下面是将文件发送到病毒扫描程序的代码。我希望能够查看扫描结果是否产生病毒,如果确实有病毒,则将其从服务器中删除。

try
{
    Process myProcess = new Process();
    myProcess.StartInfo.FileName = @"C:\Program Files\AVG\AVG8\avgscanx.exe";
    //myProcess.StartInfo.FileName=@"C:\Program Files\ClamWin\bin\clamscan.exe";
    string myprocarg = @"""C:\Documents and Settings\Administrator.USER20501\My Documents\Luke's Projects\DADS\212\Images\FinalLogo" + file.ClientFileName + @"""";
    myProcess.StartInfo.Arguments = myprocarg;
    myProcess.OutputDataReceived += new DataReceivedEventHandler(myProcess_OutputDataReceived);
    myProcess.ErrorDataReceived += new DataReceivedEventHandler(myProcess_ErrorDataReceived);
    myProcess.StartInfo.RedirectStandardOutput = true;
    myProcess.StartInfo.RedirectStandardError = true;
    myProcess.StartInfo.UseShellExecute = false;
    myProcess.StartInfo.CreateNoWindow = true;
    myProcess.Start();
    myProcess.BeginOutputReadLine();
    myProcess.WaitForExit();
}
catch (Exception)
{

} 

void myProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
    // this value will always be null.......
    string s = e.Data.ToString();
}

void myProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
    string s = e.Data.ToString();
}

【问题讨论】:

    标签: asp.net antivirus ajax-upload


    【解决方案1】:

    用户上传特殊的手工制作的 jpg/png/whatever 图像文件利用读取组件/库的未知(在这种情况下防病毒无用)漏洞是罕见的巧合。

    如果漏洞已知并且您的 AV 知道漏洞利用签名(或在运行之前拦截漏洞利用)阻止它并保护您的系统(库不是最新的),则更罕见。

    如果上述操作系统具有 DEP 和 ASLR 感知(完全强制)组件,则更为罕见。

    【讨论】:

      猜你喜欢
      • 2010-10-02
      • 2019-09-23
      • 1970-01-01
      • 1970-01-01
      • 2011-04-06
      • 1970-01-01
      • 2010-10-13
      • 1970-01-01
      • 2011-05-30
      相关资源
      最近更新 更多