Detection rules › Sigma

Windows Shell/Scripting Application File Write to Suspicious Folder

Severity
high
Author
Florian Roth (Nextron Systems)
Source
upstream

Detects Windows shells and scripting applications that write files to suspicious folders

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1059 Command and Scripting Interpreter

Event coverage

ProviderEvent IDTitle
Sysmon11FileCreate

Stages and Predicates

Stage 1: 1 of selection_1

or:
Image|endswith: '\bash.exe'
Image|endswith: '\cmd.exe'
Image|endswith: '\cscript.exe'
Image|endswith: '\msbuild.exe'
Image|endswith: '\powershell.exe'
Image|endswith: '\pwsh.exe'
Image|endswith: '\sh.exe'
Image|endswith: '\wscript.exe'
or:
TargetFilename|startswith: 'C:\PerfLogs\'
TargetFilename|startswith: 'C:\Users\Public\'

Stage 2: 1 of selection_2

or:
Image|endswith: '\certutil.exe'
Image|endswith: '\forfiles.exe'
Image|endswith: '\mshta.exe'
Image|endswith: '\schtasks.exe'
Image|endswith: '\scriptrunner.exe'
Image|endswith: '\wmic.exe'
or:
TargetFilename|contains: 'C:\PerfLogs\'
TargetFilename|contains: 'C:\Users\Public\'
TargetFilename|contains: 'C:\Windows\Temp\'

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
Imageends_with
  • \bash.exe corpus 17 (sigma 17)
  • \certutil.exe corpus 34 (sigma 34)
  • \cmd.exe corpus 92 (sigma 92)
  • \cscript.exe corpus 64 (sigma 64)
  • \forfiles.exe corpus 11 (sigma 11)
  • \msbuild.exe corpus 7 (sigma 7)
  • \mshta.exe corpus 57 (sigma 57)
  • \powershell.exe corpus 143 (sigma 143)
  • \pwsh.exe corpus 140 (sigma 140)
  • \schtasks.exe corpus 45 (sigma 45)
  • \scriptrunner.exe corpus 8 (sigma 8)
  • \sh.exe corpus 13 (sigma 13)
  • \wmic.exe corpus 37 (sigma 37)
  • \wscript.exe corpus 64 (sigma 64)
TargetFilenamematch
  • C:\PerfLogs\ corpus 2 (sigma 2)
  • C:\Users\Public\ corpus 2 (sigma 2)
  • C:\Windows\Temp\
TargetFilenamestarts_with
  • C:\PerfLogs\ corpus 2 (sigma 2)
  • C:\Users\Public\