-
-
Save lobotony/2b90989bd9c771c4cc7ac760317be0ff to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3 | |
import psutil | |
import time | |
def logDebug(msg): | |
print(time.ctime() + " " + msg) | |
while True: | |
count = 0 | |
for p in psutil.process_iter(): | |
if "wdavdaemon_enterprise" == p.name(): | |
p.kill() | |
p.wait() | |
count = count +1 | |
logDebug("swatted: "+str(count)) | |
time.sleep(5) | |
Also if you run the above script and then run this line in a terminal window:
launchctl unload /Library/LaunchAgents/com.microsoft.wdav.tray.plist
You can actually hinder the Defender ATP Processes from restarting altogether, until you restart your Mac!
Hello, I met a problem that the "wdavdaemon_enterprise" process occupies a large amount of memory in my Mac. And it can not be exited forcefully.
So what is the "wdavdaemon_enterprise"?
Can I use the code above to kill this process?
Thanks!
It’s Microsoft’s Antivirus trying to check stuff on your machine. You can try killing it with this script, which is brute force, might not work and has its own problems. You can also try to add exemptions for the local monitoring of files and processes.
As a Security professional, writing here in case any of my employees come upon this gist.
To all, internal to my company or not, you might want to think twice before deliberately hindering an enterprise security tool.
Hello @lobotony,
i am a big fan of your work and enjoyed "swatmd.py" a lot so far. :)
that's why I built an improved version, which also kills all the other Defender ATP Processes and helps not waste almost 1 GB of your precious Mac Memory with this program:
I also improved the counter.