Beispiel #1
0
        public void GetReportForKnownFile()
        {
            //Create a hash of the EICAR test virus. See http://www.eicar.org/86-0-Intended-use.html
            string hash = HashHelper.GetMD5(@"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*");

            FileReport fileReport = _virusTotal.GetFileReport(hash);

            //It should always be in the VirusTotal database.
            Assert.AreEqual(ReportResponseCode.Present, fileReport.ResponseCode);
        }
Beispiel #2
0
        private void buttonsScan_Click(object sender, EventArgs e)
        {
            try
            {
                VirusTotals virusTotal = new VirusTotals("501caf66349cc7357eb4398ac3298fdd03dec01a3e2f3ad576525aa7b57a1987");
                virusTotal.UseTLS = true;

                labelMessageResult.Text        = "Please wait";
                labelMessageResult.Text        = null;
                linkLabelVirustotal.Text       = null;
                labelSHA256Result.Text         = null;
                labelDetectionRatioResult.Text = null;
                labelDateOfAnalysisResult.Text = null;

                FileInfo fileInfo = new FileInfo(textBoxVirusTotal.Text);

                //Check if the file has been scanned before.
                FileReport fileResult = virusTotal.GetFileReport(fileInfo);
                bool       hasFileBeenScannedBefore = fileResult.ResponseCode == ReportResponseCode.Present;


                if (hasFileBeenScannedBefore)
                {
                    PrintScan(fileResult);
                }
                else
                {
                    PrintScan(fileResult, false);;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void UnauthorizedScan()
        {
            VirusTotals virusTotal = new VirusTotals("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); //64 characters

            virusTotal.GetFileReport("ca6d91bad9d5d5698c92dc64295a15a6");                                                 //conficker MD5 hash
        }