# Disable Apps and Firewall

## Disable Defender&#x20;

`powershell Set-MpPreference -DisableRealtimeMonitoring $true`&#x20;

OR&#x20;

`Set-ItemProperty -Path "HKLM:SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 0x00000001 -Force`&#x20;

## Disable Firewall&#x20;

**Show status:**&#x20;

`netsh firewall show state`&#x20;

**Disable:**&#x20;

`netsh advfirewall set  currentprofile state off`&#x20;

Or&#x20;

`netsh firewall set opmode disable`&#x20;

**To check the status of Windows Firewall:**&#x20;

`Netsh Advfirewall show allprofiles`&#x20;


---

# 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://infra.newerasec.com/infrastructure-testing/privilege-esclation/windows/disable-apps-and-firewall.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.
