Windows Firewall Rule Deletion via Netsh.exe
Adversaries utilize the netsh.exe utility to impair host-based security by removing active firewall rules, potentially facilitating unauthorized lateral movement or command-and-control communication.
Adversaries and malicious software frequently leverage the legitimate Windows command-line utility 'netsh.exe' to modify network security configurations. By executing specific commands, actors can delete firewall port or application rules, thereby disabling critical defense mechanisms. This activity is typically observed during the post-exploitation phase, where an attacker seeks to bypass restrictive network segmentation or security policies to establish persistence or enable C2 traffic. Defenders should distinguish between legitimate administrative maintenance, software updates, and unauthorized modifications initiated by non-standard parent processes.
Attack Chain
- Attacker gains initial access or code execution on the target Windows system.
- Attacker performs internal reconnaissance to identify existing firewall rules.
- Attacker determines a need to disable security filters for a specific port or service.
- Attacker executes 'netsh.exe' with elevated privileges to modify the Windows Firewall configuration.
- The command 'netsh firewall delete' or 'netsh advfirewall firewall delete' is issued against specific rules.
- The Windows Firewall removes the specified rule, creating an open hole in network ingress/egress filtering.
- Attacker proceeds with malicious objectives, such as lateral movement or exfiltration, unimpeded by previous security rules.
Impact
Successful deletion of firewall rules impairs host-based security, increasing the probability of successful exploitation, lateral movement, or data exfiltration. If left unmonitored, this activity allows adversaries to maintain long-term access and control within the target network segment.
Recommendation
- Deploy the provided Sigma rule to monitor process creation events for 'netsh.exe' command-line arguments related to firewall rule deletion.
- Baseline common administrative scripts or software installation processes that frequently modify firewall rules to reduce false positives in the detection logic.
- Enable PowerShell script block logging and process creation (Event ID 1) for visibility into administrative tool execution.
- Audit and restrict administrative access to systems where modification of firewall settings is not required by standard business operations.
Immediate actions
Deploy Sigma rule to monitor for netsh.exe firewall modifications
Threat Hunt
Search for historical logs of netsh.exe firewall deletion commands
Data: process_creation
Mitigations
Enforce Windows Firewall GPOs to prevent unauthorized modifications by standard users
T1686
Gaps
- Lack of coverage for PowerShell-based firewall manipulation (Remove-NetFirewallRule)
Detection coverage 1
Detect Firewall Rule Deletion via Netsh
mediumDetects the removal of a port or application rule in the Windows Firewall configuration using netsh
Detection queries are available on the platform. Get full rules →