6 ms·
A slightly more fun way to disable Windows Defender (through the WSC API)
- _xerces_ 2y agoDefender is a real irritant when doing security research and is near impossible to turn off completely and permanently. Even using the Group Policy Editor or regedits is not reliable. If you do get it to stop, it will randomly reenable itself weeks later (perhaps some timer, perhaps due to some update if you forgot to turn those off). For the vast majority of people this is a good thing!
- vezycash 2y agoEasiest way to disable defender was to install another anti virus. Did this change?
- malfist 2y agoIf they want to do research they probably prefer no AV. That said there are some no-op AV's that are specifically for tricking defender to shut off and not actually do anything
- GordonS 2y agoI was just wondering if a no-op AV might work! But I thought perhaps not, as I thought Microsoft insisted on AVs running as PP/PPL (Protected Process / Protected Process Light), which isn't realistic for OSS. Are you able to point to one please? Would love to try it and see if it works!
- jiggawatts 2y agoYes. Current versions of Defender won’t disable scanning even if another anti virus is installed. At most, it will stop reporting infections. The CPU overhead however cannot be avoided by normal means. Microsoft Dev Drive exists purely as a workaround to this self-imposed problem.
- gruez 2y ago>it will randomly reenable itself weeks later (perhaps some timer, perhaps due to some update if you forgot to turn those off). Probably caused by feature updates. I have it disabled on LTSC and it hasn't reenabled itself in years.
- tossit444 2y agoToggleDefender (https://github.com/AveYo/LeanAndMean/blob/main/ToggleDefender.bat https://github.com/AveYo/LeanAndMean/blob/main/ToggleDefende...) still works to this day!
- bozey07 2y agoNo offense to the author, but was this deliberately written to hard to read? Or does all PS look like this?
- dataflow 2y agoI've never seen Defender re-enable itself, provided that tamper detection is turned off in addition to the other stuff (in group policy and whatnot). Have you made sure to do that? And are you on 10 or 11?
- unaindz 2y agoNot op but yes, without tamper protection and disabled via group policy it reenables itself anyways. Seen it in both 10 and 11.
- dataflow 2y agoWeird. I wonder why I don't see this on my Windows 10 machine. It's possible I've done something else that prevents it from running that I'm now forgetting, I don't recall. But I do see that I have something like 6 group policy settings modified, it's not just one or two. Have you tried disabling the service & driver (WinDefend)?
- vitorgrs 2y agoIf you are in insider builds, it happens weekly once a new update arrives.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- 0xDEADFED5 2y agobrilliant, thanks for sharing. seems to work great. i mostly tolerate Windows Defender, but the lack of configurability is pretty maddening sometimes.
- cedws 2y agoDoes it require elevated privilges?
- EvanAnderson 2y agoIf I'm understanding this then the WSC API calls are being used by the included Avast EXE and DLL (which, presumably, are Avast "IP" and protected by copyright). Has anybody done reverse engineering work on the WSC API itself?
- greeniskool 2y agoThat was my first thought too. If I understood correctly, the developer claims that the API requires a signed binary in this issue: https://github.com/es3n1n/no-defender/issues/1 https://github.com/es3n1n/no-defender/issues/1
- aeyes 2y agoApparently this could be reduced to a VBScript: https://infosec.exchange/@bontchev/112494759440985111 https://infosec.exchange/@bontchev/112494759440985111
- fulafel 2y agoClick saver: no vbscript implementation is presented.
- chme 2y agoHmm.. Is there something similar for just the firewall? I am using simple wall, but with that Windows complains about a disabled firewall. Registering simple wall as a firewall with windows would be nice.
- Wowfunhappy 2y agoSo, why doesn't all malware include this?
- devwastaken 2y agoYou dont need to, you can bypass it anyways through win32 function call redirection and a dozen other methods. Antivirus's are trash, they are a mitigation that exists when the operating system does not have proper security measures in the first place. This is why Windows must ship with an AV, and everyone else laughs.
- justsomehnguy 2y ago> the operating system does not have proper security measures in the first place > everyone else laughs Meanwhile: So let's install our shiny $UB3RK3WLAPP ! # setenforce 0 # curl http://ub3rk3wlapp.io/install | sudo bash
- devwastaken 2y agoNotice the sudo and terminal. You must enter a password in a terminal. In windows you just click twice.
- chii 2y agohow is that any different? you're still allowing arbitrary code to run. Unless you are saying that those who type into the terminal will first |echo the script into a file, verify it, then run?
- _Microft 2y ago> In windows you just click twice. Uh, oh, that means you're working on an admin account. If you are using a normal user account, you will be prompted to enter your admin credentials instead. (You can also force this behaviour on administrator accounts. Search for the registry setting "ConsentPromptBehaviorAdmin")
- terlisimo 2y agoMy preferred way of disabling Windows Defender is to boot Linux, mount windows partition and rename windows defender directories to *.disabled or whatever. Example (assuming it is mounted at /mnt/ntfs): mv "/mnt/ntfs/Program Files/Windows Defender" "/mnt/ntfs/Program Files/Windows Defender.disabled" mv "/mnt/ntfs/Program Files (x86)/Windows Defender" "/mnt/ntfs/Program Files (x86)/Windows Defender.disabled" mv "/mnt/ntfs/ProgramData/Microsoft/Windows Defender" "/mnt/ntfs/ProgramData/Microsoft/Windows Defender.disabled" Antivirus service fails to start and that's about it, no other side effects. To revert just rename back. I have dual boot set up, but I believe the Ubuntu USB install image supports NTFS.
- gruez 2y agoWouldn't windows' repair mechanism (dism/sfc) autofix this eventually?
- terlisimo 2y agoApparently not. In my first attempt I've actually deleted the directories altogether but later wanted to scan a system manually and I couldn't repair the installation and get WD to run again.
- eddd-ddde 2y agoIs there a reason this doesn't work from windows itself?
- 38 2y agoWindows idiotic file permissions are almost impossible to manage, even if you know what you are doing
- SoftTalker 2y agoSeems like I used to be able to do stuff like this from a bash shell under cygwin, but I haven't really used Windows since the XP era.
- password4321 2y agoIs there a convenient "awesome red team" list on GitHub somewhere that collects these one-off repos and stays updated if they're eventually mitigated? I happened to stumble across a new repo demonstratng UAC bypass by sending keys to Task Manager as well as something for AMSI (Antimalware Scan Interface): https://github.com/cybersectroll https://github.com/cybersectroll
- oceansweep 2y agoThere's multiple. Here is one I maintain, though am very behind on it. https://github.com/rmusser01/Infosec_Reference https://github.com/rmusser01/Infosec_Reference
- password4321 2y agoThank you for sharing. Staying updated is almost a full-time job, I was hoping someone else was already sharing their efforts to do so.