CmdID

CmdID / Rules / Windows

New Firewall Rule Added Via Netsh.EXE

A Sigma rule for process creation on Windows, by Markus Neis, Sander Wiebing.

medium 1 ATT&CK technique 2 programs it names 3 everyday examples trip it

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_optional_dropbox:
    CommandLine|contains:
      - 'advfirewall firewall add rule name=Dropbox dir=in action=allow "program=?:\Program Files (x86)\Dropbox\Client\Dropbox.exe" enable=yes profile=Any'
      - 'advfirewall firewall add rule name=Dropbox dir=in action=allow "program=?:\Program Files\Dropbox\Client\Dropbox.exe" enable=yes profile=Any'
  selection_cli:
    CommandLine|contains|all:
      - ' firewall '
      - ' add '
  selection_img:
    - Image|endswith: '\netsh.exe'
    - OriginalFileName: 'netsh.exe'
  condition: all of selection_* and not 1 of filter_optional_*

The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Markus Neis, Sander Wiebing, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.

Command lines that trip it

everyday examples from tldr-pages, CC BY 4.0, each read by CmdID

To add a rule allowing inbound traffic on port 8080, run the following command on the page for netsh advfirewall

netsh advfirewall firewall add rule name="Allow8080" protocol=TCP dir=in localport=8080 action=allowIdentify

To block outgoing traffic to a specific IP, run the following command on the page for netsh advfirewall

netsh advfirewall firewall add rule name="BlockOutIP" protocol=TCP dir=out remoteip=192.168.1.100 action=blockIdentify

To find out syntax details for adding a firewall rule, run the following command on the page for netsh advfirewall

netsh advfirewall firewall add rule ?Identify

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1686.003Disable or Modify System Firewall: Windows Host Firewall