Detect Disable or Modify Network Device Firewall in Sumo Logic CSE
Adversaries may disable network device-based firewall mechanisms entirely or add, delete, or modify particular rules in order to bypass controls limiting network usage. Modifying or disabling a network firewall may enable adversary C2 communications, lateral movement, and/or data exfiltration that would otherwise not be allowed. For example, adversaries may add new network firewall rules to allow access to all internal network subnets without restrictions. Adversaries may gain access to the firewall management console via Valid Accounts or by exploiting a vulnerability. In some cases, threat actors may target firewalls that have been exposed to the internet. This technique was used by APT38 to create firewall exemptions on specific ports, and by threat actors exploiting Fortinet FortiGate vulnerabilities (CVE-2024-55591) to modify firewall rules before deploying LockBit ransomware.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1562 Impair Defenses
- Sub-technique
- T1562.013 Disable or Modify Network Device Firewall
- Canonical reference
- https://attack.mitre.org/techniques/T1562/013/
Sumo Detection Query
// Host-based firewall manipulation — Windows
(_sourceCategory=*endpoint* OR _sourceCategory=*sysmon* OR _sourceCategory=*winlogbeat*)
| where EventCode = 1 OR EventCode = 4688
| where CommandLine matches /(?i)(netsh\s+advfirewall|netsh\s+firewall|Set-NetFirewallProfile|New-NetFirewallRule|Remove-NetFirewallRule|Disable-NetFirewallRule|Set-NetFirewallRule)/
| eval IsFirewallDisable = if(CommandLine matches /(?i)(state\s+off|allprofiles\s+state\s+off|Enabled\s+False)/, 1, 0)
| eval IsRuleAdd = if(CommandLine matches /(?i)(add\s+rule|new-netfirewallrule)/, 1, 0)
| eval IsRuleDelete = if(CommandLine matches /(?i)(delete\s+rule|remove-netfirewallrule)/, 1, 0)
| eval AllowsAny = if(CommandLine matches /(?i)(action=allow|allow|permit)/, 1, 0)
| eval SeverityScore = (IsFirewallDisable * 3) + (IsRuleDelete * 2) + (IsRuleAdd * AllowsAny * 2) + IsRuleAdd
| eval DetectionType = "HostFirewallManipulation"
| fields _messageTime, _sourceHost, User, CommandLine, ParentCommandLine, ProcessName, IsFirewallDisable, IsRuleAdd, IsRuleDelete, AllowsAny, SeverityScore, DetectionType
// Linux firewall manipulation — run separately or union
// (_sourceCategory=*linux* OR _sourceCategory=*auditd*)
// | where _raw matches /(?i)(iptables\s+-[FPD]|ufw\s+disable|nft\s+flush|nft\s+delete|firewall-cmd.*--add-port)/
// | eval DetectionType = "LinuxFirewallManipulation"
// Network device policy changes — run separately or union
// (_sourceCategory=*fortigate* OR _sourceCategory=*cisco:asa* OR _sourceCategory=*paloalto*)
// | where _raw matches /(?i)(policy|rule|access-list|security-policy)/
// | where _raw matches /(?i)(delete|disable|modify|create|permit\s+any)/
// | eval DetectionType = "NetworkDeviceFirewallChange"
| sort by SeverityScore desc, _messageTime desc Detects host-based firewall manipulation via Windows Sysmon/Security event logs and Linux auditd, covering netsh advfirewall, PowerShell firewall cmdlets, iptables, ufw, and nft. Also covers network device firewall policy changes from Fortinet, Cisco, and Palo Alto log sources. Maps to T1562.013.
Data Sources
Required Tables
False Positives & Tuning
- IT automation tools (Ansible, Puppet, Terraform) modifying firewall rules as part of infrastructure-as-code deployments
- Security software installations opening ports for agent communication (CrowdStrike, Carbon Black, Qualys, Nessus)
- Network engineers running authorized ACL changes from jump hosts — these will appear in syslog as policy modifications with legitimate source IPs
Other platforms for T1562.013
Testing Methodology
Validate this detection against 4 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 via netsh
Expected signal: Sysmon Event ID 1: Process Create with Image=netsh.exe, CommandLine='advfirewall set allprofiles state off'. Windows Firewall Event ID 2003: Profile changed (all profiles disabled). Security Event ID 4688 with command line auditing. DeviceProcessEvents in MDE.
- Test 2Add Allow-Any Inbound Firewall Rule via netsh
Expected signal: Sysmon Event ID 1: Process Create with CommandLine containing 'add rule' and 'action=allow'. Windows Firewall Event ID 2004: New rule added. DeviceProcessEvents in MDE with full command line details.
- Test 3Flush Linux iptables Rules
Expected signal: Syslog and/or Sysmon for Linux process creation events for iptables with -F, -P INPUT ACCEPT, and -P FORWARD ACCEPT arguments. Linux audit events (SYSCALL) for the iptables binary execution. The network exposure is immediate.
- Test 4Disable UFW Firewall on Linux
Expected signal: Syslog entry for 'ufw disable' command. Process creation event for the ufw binary. Systemd journal entry for the ufw service state change. Sysmon for Linux (if installed) Event ID 1 for process creation.
References (7)
- https://attack.mitre.org/techniques/T1562/013/
- https://posts.inthecyber.com/exposed-fortinet-fortigate-firewall-interface-leads-to-lockbit-ransomware-cve-2024-55591-de8fcfb6c45c
- https://nvd.nist.gov/vuln/detail/CVE-2024-55591
- https://us-cert.cisa.gov/ncas/alerts/aa20-239a
- https://www.welivesecurity.com/2020/04/28/grandoreiro-how-engorged-can-exe-get/
- https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/
- https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-admin/monitoring/use-syslog-for-monitoring
Unlock Pro Content
Get the full detection package for T1562.013 including response playbook, investigation guide, and atomic red team tests.