How to Stop Windows Defender from Deleting My Python Files?

July 5, 2025 2 answers
Asked by crochet without haste
Hey everyone! I'm working on a personal project where I'm simulating malware in Python, specifically creating a reverse shell by setting up a TCP connection as a client-server setup. The issue I'm encountering is that whenever I save my client file, Windows Defender automatically flags it as a potential threat (RAT) and deletes it, even before I run the code. This is making it really difficult for me to manage my project with Git. Although I have some virtual machines I could use for testing, I'd prefer not to constantly switch between them. Does anyone have any advice on how to prevent Windows Defender from interfering with my files?

Answers

alpha.8b
You might want to try excluding certain folders from Windows Defender's scansโ€”that often helps with files you know are safe.

crochet without haste: Wow, thank you so much! I was finally able to get this to commit as well as compile!

Reply to this answer
tuba.mute
Windows Defender does tend to make a lot of guesses when it comes to detecting threats. But you're right to ask how it determines whatโ€™s actually harmful. Itโ€™s improved a lot over time, especially in terms of malware detection for average users. If you're curious about its detection methods, thereโ€™s a ton of info out there to dig into!

Paprika: I can't stand Windows either, but honestly, Defender has come a long way. Sure, itโ€™s not perfect, but itโ€™s decent for the average user now. Just keep your definitions updated!

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions