Detect Disable or Modify System Firewall in Sumo Logic CSE
Adversaries may disable or modify system firewalls in order to bypass controls limiting network usage. Changes could be disabling the entire mechanism as well as adding, deleting, or modifying particular rules. This can be done via command-line tools (netsh, iptables, ufw, pfctl), editing Windows Registry keys, or through the Windows Control Panel. On ESXi, firewall rules may be modified via esxcli. Adversaries may add new firewall rules for RDP on non-standard ports or open all traffic to enable C2, lateral movement, and data exfiltration.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1562 Impair Defenses
- Sub-technique
- T1562.004 Disable or Modify System Firewall
- Canonical reference
- https://attack.mitre.org/techniques/T1562/004/
Sumo Detection Query
(_sourceCategory="windows/sysmon" OR _sourceCategory="linux/syslog" OR _sourceCategory="windows/security")
| where (%"EventCode" = "1" OR %"event_id" = "1" OR %"EventCode" = "4688" OR %"sourcetype" = "linux_secure")
| where CommandLine matches /(?i)(netsh advfirewall set|netsh advfirewall firewall add|netsh advfirewall firewall delete|netsh firewall set opmode disable|Set-NetFirewallProfile.*Enabled.*False|New-NetFirewallRule|Remove-NetFirewallRule|iptables -F|iptables -X|iptables -P INPUT ACCEPT|iptables -P FORWARD ACCEPT|ufw disable|pfctl -d|esxcli network firewall set)/
| if(CommandLine matches /(?i)(state off|opmode disable|Enabled.*False|ufw disable|pfctl -d)/, "Firewall Disabled",
if(CommandLine matches /(?i)(firewall add|New-NetFirewallRule)/, "Rule Added",
if(CommandLine matches /(?i)(firewall delete|Remove-NetFirewallRule)/, "Rule Deleted",
if(CommandLine matches /(?i)iptables -[FX]/, "IPTables Flushed",
if(CommandLine matches /(?i)iptables -P.*ACCEPT/, "IPTables Policy ACCEPT",
"Other Modification"))))) as FirewallAction
| fields _messageTime, host, User, CommandLine, FirewallAction, ParentImage
| sort by _messageTime desc Detects system firewall disablement or modification across Windows and Linux platforms by monitoring process command-line arguments for known firewall management tools and cmdlets. Classifies the detected action type for priority-based analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Authorized firewall policy deployments by network operations teams during scheduled change windows with proper change management tickets.
- DevOps CI/CD pipelines automatically configuring firewall rules on newly provisioned virtual machines or containers during infrastructure-as-code workflows.
- Endpoint security products or host-based intrusion prevention systems modifying firewall rules as part of their own protection mechanisms.
Other platforms for T1562.004
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Disable Windows Firewall All Profiles
Expected signal: Sysmon Event ID 1: netsh.exe process creation. Windows Firewall Event ID 2003: Firewall profile changed. Each profile state change generates a separate event.
- Test 2Add Firewall Rule for RDP on Non-Standard Port
Expected signal: Sysmon Event ID 1: netsh.exe with 'firewall add rule'. Windows Firewall Event ID 2004: A rule has been added.
- Test 3Flush IPTables Rules on Linux
Expected signal: Auditd execve syscall records for iptables. Syslog entries for iptables commands. MDE DeviceProcessEvents if MDE for Linux is deployed.
References (4)
Unlock Pro Content
Get the full detection package for T1562.004 including response playbook, investigation guide, and atomic red team tests.