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
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
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=allowIdentifyTo 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=blockIdentifyTo 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