File or Folder Permissions Modifications
A Sigma rule for process creation on Windows, from SigmaHQ’s threat hunting rules, by Jakob Weinzettl, oscd.community, Nasreddine Bencherchali (Nextron Systems).
medium 1 ATT&CK technique 11 programs it names 9 everyday examples trip it
What it looks for
detection:
filter_optional_avira:
CommandLine|contains:
- ':\Program Files (x86)\Avira'
- ':\Program Files\Avira'
filter_optional_dynatrace_1:
CommandLine|endswith: 'ICACLS C:\ProgramData\dynatrace\gateway\config\connectivity.history /reset'
filter_optional_dynatrace_2:
CommandLine|contains|all:
- 'ICACLS C:\ProgramData\dynatrace\gateway\config\config.properties /grant :r '
- 'S-1-5-19:F'
filter_optional_vscode:
CommandLine|contains:
- '\AppData\Local\Programs\Microsoft VS Code'
- ':\Program Files\Microsoft VS Code'
selection_1:
CommandLine|contains:
- '/grant'
- '/setowner'
- '/inheritance:r'
Image|endswith:
- '\cacls.exe'
- '\icacls.exe'
- '\net.exe'
- '\net1.exe'
selection_2:
CommandLine|contains: '-r'
Image|endswith: '\attrib.exe'
selection_3:
Image|endswith: '\takeown.exe'
condition: 1 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 Jakob Weinzettl, oscd.community, Nasreddine Bencherchali (Nextron Systems), 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 remove the Read-only attribute from files in the public directory and its subdirectories on a disk in drive b:, type on the page for attrib
attrib -r b:\public\*.* /sIdentifyRemove a specific attribute of files or directories on the page for attrib
attrib -r path\to\file_or_directory1 path\to\file_or_directory2 ...IdentifyTo grant the user User1 Delete and Write DAC permissions to a file named Test1, type on the page for icacls
icacls test1 /grant User1:(d,wdac)IdentifyTo grant the user defined by SID S-1-1-0 Delete and Write DAC permissions to a file named TestFile, type on the page for icacls
icacls TestFile /grant *S-1-1-0:(d,wdac)IdentifyTake ownership of the specified directory on the page for takeown
takeown /d path\to\directoryIdentify