Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiled C executable is detected as a virus by windows defender

Tags:

c++

c

I had compiled a simple hello world program in C with the MinGW compiler using the command line. As it had finished compiling, windows defender popped up and detected a virus (Trojan:Win32/Fuery.C!cl).

#include <stdio.h>
#include <stdlib.h>
int main() {
    printf("Hello World");
    return 0;
}

https://imgur.com/a/05yDjw5

I had taken action on this (Removed) as windows defender suggested, but when I compile again the same happened, multiple times.

I had downloaded an AntiVirus (Malwarebytes) and scanned my whole system and it detected some registry key errors, but not this.

I've tried compiling C++ files too, but windows defender did not detect any virus there. This only happens when I compile in C.

I've also tried checking the compiled executable at VirusTotal. https://www.virustotal.com/gui/file/476d47215dad80db49c9fd508ab5e10e5aeb5b623248ca156830a28b70affe5f/detection

I tried CodeBlock's MinGW compiler and 0 engines detected it. (Same C file) https://www.virustotal.com/gui/file/8ba4b0fa24b1b6b69152acce2353fcca8447bbecbfc4e5ec48d33cc75d94f2f1/detection

EDIT: I deleted the path variable of C:/MinGW and added CodeBlock's MinGW compiler. I then used the command line to compile the same C file again and had uploaded the .exe file to VirusTotal. This time, 0 engines detected. So I have come to the conclusion that, the MinGW compiler that I had installed was creating this problem. https://www.virustotal.com/gui/file/34d383f6c09f897d8c9a44ed0e7850574320e50fdf439eeb1f06705fdcc95386/detection

I don't know why this happens. Is there a malware in my computer that affects my C programs or is this a false detection?

like image 504
tan Avatar asked Jun 13 '20 19:06

tan


People also ask

What if Windows Defender detects Trojan?

A number of Windows users have reported that Windows Defender is detecting legitimate Windows files as trojans. To fix the issue, users should check for new updates to Windows Defender and install them immediately.

Can Windows Defender detect any virus?

Yes. If Windows Defender detects malware, it will remove it from your PC. However, because Microsoft doesn't update Defender's virus definitions regularly, the newest malware won't be detected. Relying on Windows Defender as your sole antivirus puts your entire PC at risk of infection.

Does Windows Defender remove virus?

To scan and remove viruses with the Microsoft Defender Antivirus Offline scan feature, use these steps: RECOMMENDED VIDEOS FOR YOU... Open Windows Security. Click on Virus & threat protection.


1 Answers

There is no malware, it is a false positive. The executable generated by your version of MinGW looks very similar to a particular virus.

To avoid the problem, add the directory where you build your code to the list of exclusion in the antivirus.

Also consider using mingw-w64 instead of mingw.org .

like image 77
M.M Avatar answered Oct 19 '22 02:10

M.M