Created
May 11, 2022 17:15
-
-
Save lobotony/2b90989bd9c771c4cc7ac760317be0ff to your computer and use it in GitHub Desktop.
waits for wdavdaemon_enterprise processes and kills them. run with sudo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!