Windows PowerShell: Disable Windows Firewall Profile via Set-NetFirewallProfile
Flags PowerShell commands that disable one or more Windows Firewall profiles via Set-NetFirewallProfile -Enabled $false.
- Product
- windows
- Category
- ps_script
- Author
- Austin Songer @austinsonger (SigmaHQ), DRL 1.1
- Published
- 2021-10-12
- Updated
- 2026-07-31
ATT&CK techniques
Recon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies PowerShell script block activity where Set-NetFirewallProfile is used to set the -Enabled parameter to False and includes profile scope indicators (e.g., All, Public, Domain, Private). Disabling firewall profiles can reduce network filtering and help an attacker evade defensive controls. It relies on PowerShell Script Block Logging telemetry capturing the relevant command text and arguments within script blocks.
Reporting behind it
- learn.microsoft.comhttps://learn.microsoft.com/en-us/powershell/module/netsecurity/set-netfirewallprofile?view=windowsserver2022-ps
- tutorialspoint.comhttps://www.tutorialspoint.com/how-to-get-windows-firewall-profile-settings-using-powershell
- web.archive.orghttps://web.archive.org/web/20230929023836/http://powershellhelp.space/commands/set-netfirewallrule-psv5.php
- woshub.comhttp://woshub.com/manage-windows-firewall-powershell/
- elastic.cohttps://www.elastic.co/guide/en/security/current/windows-firewall-disabled-via-powershell.html
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_windows_firewall_profile_disabled.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows PowerShell: Disable Windows Firewall Profile via Set-NetFirewallProfile"
id: 180ccf49-12a0-42b9-a438-f8802cce6d84
related:
- id: 12f6b752-042d-483e-bf9c-915a6d06ad75
type: similar
- id: 488b44e7-3781-4a71-888d-c95abfacf44d
type: derived
status: test
description: This rule identifies PowerShell script block activity where Set-NetFirewallProfile is used to set the -Enabled parameter to False and includes profile scope indicators (e.g., All, Public, Domain, Private). Disabling firewall profiles can reduce network filtering and help an attacker evade defensive controls. It relies on PowerShell Script Block Logging telemetry capturing the relevant command text and arguments within script blocks.
references:
- https://learn.microsoft.com/en-us/powershell/module/netsecurity/set-netfirewallprofile?view=windowsserver2022-ps
- https://www.tutorialspoint.com/how-to-get-windows-firewall-profile-settings-using-powershell
- https://web.archive.org/web/20230929023836/http://powershellhelp.space/commands/set-netfirewallrule-psv5.php
- http://woshub.com/manage-windows-firewall-powershell/
- https://www.elastic.co/guide/en/security/current/windows-firewall-disabled-via-powershell.html
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_windows_firewall_profile_disabled.yml
author: Austin Songer @austinsonger, Huntrule Team
date: 2021-10-12
modified: 2022-12-30
tags:
- attack.defense-impairment
- attack.t1686.003
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection_args:
ScriptBlockText|contains|all:
- "Set-NetFirewallProfile "
- " -Enabled "
- " False"
selection_opt:
ScriptBlockText|contains:
- " -All "
- Public
- Domain
- Private
condition: all of selection*
falsepositives:
- Unknown
level: medium
license: DRL-1.1