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 static void Initialize(TestContext context) { _virusTotal = new VirusTotals("501caf66349cc7357eb4398ac3298fdd03dec01a3e2f3ad576525aa7b57a1987"); }
public void UnauthorizedScan() { VirusTotals virusTotal = new VirusTotals("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); //64 characters virusTotal.GetFileReport("ca6d91bad9d5d5698c92dc64295a15a6"); //conficker MD5 hash }
public static void Initialize(TestContext context) { _virusTotal = new VirusTotals(null); }