MJT
MJT
CC#
Created by MJT on 9/14/2024 in #help
✅ False Positive Virus Detection on my C# network ping code
So i'm trying to make a simple ping utility that just given a bunch of hostnames, does a ping to the host periodically, and graphs the results. I can make the app and it works fine for my needs. But I publish it and send it to my buddy to have a look at and his corporate Windows Defender says its a virus and deletes it. If i scan my published files it detects it as "MaxSecure Trojan.Malware.300983.susgen" on virustotal. the specific lines of code that seem to trigger this behaviour are as follows
public async Task AddPing()
{
Ping p = new();

var reply = await p.SendPingAsync(hostname);

if (reply.Status != IPStatus.Success)
{
Debug.WriteLine(hostname + " error :" + reply.Status.ToString());
}

///////////////////////////// this line triggers the MaxSecure Trojan.Malware.300983.susgen
await AddResult(reply.RoundtripTime);

return;
}

public Task AddResult(long pingresult)
{
_results.Add(pingresult);

return Task.CompletedTask;
}
public async Task AddPing()
{
Ping p = new();

var reply = await p.SendPingAsync(hostname);

if (reply.Status != IPStatus.Success)
{
Debug.WriteLine(hostname + " error :" + reply.Status.ToString());
}

///////////////////////////// this line triggers the MaxSecure Trojan.Malware.300983.susgen
await AddResult(reply.RoundtripTime);

return;
}

public Task AddResult(long pingresult)
{
_results.Add(pingresult);

return Task.CompletedTask;
}
I guess my question is, how do I stop this from happening other than randomly changing my code and hoping it doesn't flag as a false positive?
12 replies