Disable Windows Firewall Rules via Netsh

Identifies use of the netsh.exe to disable or weaken the local firewall. Attackers will use this command line tool to disable the firewall during troubleshooting or to enable network mobility.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/02/18"
  3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
  4maturity = "production"
  5updated_date = "2024/10/31"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies use of the netsh.exe to disable or weaken the local firewall. Attackers will use this command line tool to
 13disable the firewall during troubleshooting or to enable network mobility.
 14"""
 15from = "now-9m"
 16index = [
 17    "winlogbeat-*",
 18    "logs-endpoint.events.process-*",
 19    "logs-windows.forwarded*",
 20    "logs-windows.sysmon_operational-*",
 21    "endgame-*",
 22    "logs-system.security*",
 23    "logs-m365_defender.event-*",
 24    "logs-sentinel_one_cloud_funnel.*",
 25    "logs-crowdstrike.fdr*",
 26]
 27language = "eql"
 28license = "Elastic License v2"
 29name = "Disable Windows Firewall Rules via Netsh"
 30note = """## Triage and analysis
 31
 32### Investigating Disable Windows Firewall Rules via Netsh
 33
 34The Windows Defender Firewall is a native component which provides host-based, two-way network traffic filtering for a device, and blocks unauthorized network traffic flowing into or out of the local device.
 35
 36Attackers can disable the Windows firewall or its rules to enable lateral movement and command and control activity.
 37
 38This rule identifies patterns related to disabling the Windows firewall or its rules using the `netsh.exe` utility.
 39
 40#### Possible investigation steps
 41
 42- Identify the user account that performed the action and whether it should perform this kind of action.
 43- Contact the user to check if they are aware of the operation.
 44- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 45- Investigate other alerts associated with the user/host during the past 48 hours.
 46
 47### False positive analysis
 48
 49- This mechanism can be used legitimately. Check whether the user is an administrator and is legitimately performing troubleshooting.
 50- In case of an allowed benign true positive (B-TP), assess adding rules to allow needed traffic and re-enable the firewall.
 51
 52### Response and remediation
 53
 54- Initiate the incident response process based on the outcome of the triage.
 55- Isolate the involved hosts to prevent further post-compromise behavior.
 56- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
 57- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 58- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 59"""
 60risk_score = 47
 61rule_id = "4b438734-3793-4fda-bd42-ceeada0be8f9"
 62severity = "medium"
 63tags = [
 64    "Domain: Endpoint",
 65    "OS: Windows",
 66    "Use Case: Threat Detection",
 67    "Tactic: Defense Evasion",
 68    "Resources: Investigation Guide",
 69    "Data Source: Elastic Endgame",
 70    "Data Source: Elastic Defend",
 71    "Data Source: System",
 72    "Data Source: Microsoft Defender for Endpoint",
 73    "Data Source: Sysmon",
 74    "Data Source: SentinelOne",
 75    "Data Source: Crowdstrike",
 76]
 77timestamp_override = "event.ingested"
 78type = "eql"
 79
 80query = '''
 81process where host.os.type == "windows" and event.type == "start" and
 82  process.name : "netsh.exe" and
 83  (
 84    (process.args : "disable" and process.args : "firewall" and process.args : "set") or
 85    (process.args : "advfirewall" and process.args : "off" and process.args : "state")
 86  )
 87'''
 88
 89
 90[[rule.threat]]
 91framework = "MITRE ATT&CK"
 92[[rule.threat.technique]]
 93id = "T1562"
 94name = "Impair Defenses"
 95reference = "https://attack.mitre.org/techniques/T1562/"
 96[[rule.threat.technique.subtechnique]]
 97id = "T1562.004"
 98name = "Disable or Modify System Firewall"
 99reference = "https://attack.mitre.org/techniques/T1562/004/"
100
101
102
103[rule.threat.tactic]
104id = "TA0005"
105name = "Defense Evasion"
106reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Disable Windows Firewall Rules via Netsh

The Windows Defender Firewall is a native component which provides host-based, two-way network traffic filtering for a device, and blocks unauthorized network traffic flowing into or out of the local device.

Attackers can disable the Windows firewall or its rules to enable lateral movement and command and control activity.

This rule identifies patterns related to disabling the Windows firewall or its rules using the netsh.exe utility.

Possible investigation steps

  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the user to check if they are aware of the operation.
  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate other alerts associated with the user/host during the past 48 hours.

False positive analysis

  • This mechanism can be used legitimately. Check whether the user is an administrator and is legitimately performing troubleshooting.
  • In case of an allowed benign true positive (B-TP), assess adding rules to allow needed traffic and re-enable the firewall.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top