T1562.004
Disable or Modify System Firewall
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.
Microsoft Sentinel / Defender
kusto
let FirewallCommands = dynamic(["netsh advfirewall set", "netsh advfirewall firewall add", "netsh advfirewall firewall delete", "netsh firewall set opmode disable", "Set-NetFirewallProfile -Enabled False", "Set-NetFirewallProfile -All -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"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (FirewallCommands)
| extend FirewallAction = case(
ProcessCommandLine has "set allprofiles state off" or ProcessCommandLine has "opmode disable" or ProcessCommandLine has "-Enabled False" or ProcessCommandLine has "ufw disable" or ProcessCommandLine has "pfctl -d", "Firewall Disabled",
ProcessCommandLine has "firewall add" or ProcessCommandLine has "New-NetFirewallRule", "Rule Added",
ProcessCommandLine has "firewall delete" or ProcessCommandLine has "Remove-NetFirewallRule", "Rule Deleted",
ProcessCommandLine has "iptables -F" or ProcessCommandLine has "iptables -X", "IPTables Flushed",
ProcessCommandLine has "iptables -P" and ProcessCommandLine has "ACCEPT", "IPTables Policy Set to ACCEPT",
"Other Modification")
| extend RuleDetail = extract(@"(?:rule\s+name=|--dport\s+)(\"?[^\"\s]+\"?)", 1, ProcessCommandLine)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, FirewallAction, RuleDetail, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc high severity
high confidence
Data Sources
Process: Process Creation Command: Command Execution Firewall: Firewall Rule Modification Firewall: Firewall Disable
Required Tables
DeviceProcessEvents
False Positives
- System administrators legitimately configuring firewall rules for new application deployments
- Automated deployment tools (Ansible, Puppet, Chef) that manage firewall rules as part of infrastructure-as-code
- Network troubleshooting where firewall is temporarily disabled and re-enabled within a change window
- Application installers that add firewall exceptions during setup (e.g., SQL Server, IIS)
Last updated: 2026-04-20 Research depth: deep
References (4)
- https://attack.mitre.org/techniques/T1562/004/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1562.004/T1562.004.md
- https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-firewall-service
- https://www.huntress.com/blog/blackcat-ransomware-affiliate-ttps
Unlock Pro Content
Get the full detection package for T1562.004 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance
Related Detections
Parent Technique
T1562Impair DefensesRelated Sub-techniques
T1562.001Disable or Modify ToolsT1562.002Disable Windows Event LoggingT1562.003Impair Command History LoggingT1562.006Indicator BlockingT1562.007Disable or Modify Cloud FirewallT1562.008Disable or Modify Cloud LogsT1562.009Safe Mode BootT1562.010Downgrade AttackT1562.011Spoof Security AlertingT1562.012Disable or Modify Linux Audit SystemT1562.013Disable or Modify Network Device Firewall