# Windows Defender

## disable windows defender

> Tested on Microsoft Windows 10 Pro 10.0.19042 x64

This helps a lot when configuring a Windows pentesting environment, less annoyance regarding exploits.

Tamper protection has to be disabled (only way I found to do that is via GUI, all other approaches didn't work since the reason for it to exists is to prevent programs from modifying the configuration of the AV, which is for example via malicious program or command line).

* Windows Security -> Virus & threat protection -> Tamper Protection

**Cmd**

```
powershell -command "Set-MpPreference -DisableRealtimeMonitoring $true" && reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD_LITTLE_ENDIAN /d 1 /f
```

**Powershell**

```
Set-MpPreference -DisableRealtimeMonitoring $true; New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0xalwayslucky.gitbook.io/cybersecstack/pentest-env-windows/windows-defender.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
