Detection rules › Sigma

Firewall Disabled via Netsh.EXE

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Fatih Sirin
Source
github.com/SigmaHQ/sigma

Detects netsh commands that turns off the Windows firewall

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Firewall Disabled via Netsh.EXE
id: 57c4bf16-227f-4394-8ec7-1b745ee061c3
status: test
description: Detects netsh commands that turns off the Windows firewall
references:
    - https://www.winhelponline.com/blog/enable-and-disable-windows-firewall-quickly-using-command-line/
    - https://app.any.run/tasks/210244b9-0b6b-4a2c-83a3-04bd3175d017/
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1562.004/T1562.004.md#atomic-test-1---disable-microsoft-defender-firewall
author: Fatih Sirin
date: 2019-11-01
modified: 2023-02-13
tags:
    - attack.defense-impairment
    - attack.t1686.003
    - attack.s0108
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\netsh.exe'
        - OriginalFileName: 'netsh.exe'
    selection_cli_1:
        # Example: netsh firewall set opmode disable
        CommandLine|contains|all:
            - 'firewall'
            - 'set'
            - 'opmode'
            - 'disable'
    selection_cli_2:
        # Example: netsh advfirewall set currentprofile state off
        CommandLine|contains|all:
            - 'advfirewall'
            - 'set'
            - 'state'
            - 'off'
    condition: selection_img and 1 of selection_cli_*
falsepositives:
    - Legitimate administration activity
level: medium

Stages and Predicates

Stage 0: condition

selection_img and 1 of selection_cli_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\netsh.exe'
    - OriginalFileName: 'netsh.exe'

Stage 2: selection_cli_1

selection_cli_1:
    CommandLine|contains|all:
        - 'firewall'
        - 'set'
        - 'opmode'
        - 'disable'

Stage 3: selection_cli_2

selection_cli_2:
    CommandLine|contains|all:
        - 'advfirewall'
        - 'set'
        - 'state'
        - 'off'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • advfirewall corpus 7 (sigma 6, kusto 1)
  • disable corpus 13 (sigma 10, splunk 3)
  • firewall corpus 13 (sigma 7, splunk 6)
  • off corpus 4 (sigma 3, splunk 1)
  • opmode corpus 2 (sigma 2)
  • set corpus 11 (sigma 10, splunk 1)
  • state corpus 2 (sigma 2)
Imageends_with
  • \netsh.exe corpus 28 (sigma 28)
OriginalFileNameeq
  • netsh.exe corpus 23 (sigma 14, splunk 7, elastic 2)