Detection rules › Sigma

Private Keys Reconnaissance Via CommandLine Tools

Severity
medium
Author
frack113, Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Adversaries may search for private key certificate files on compromised systems for insecurely stored credential

MITRE ATT&CK coverage

TacticTechniques
Credential AccessT1552.004 Unsecured Credentials: Private Keys

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: selection_ext

or:
CommandLine|contains: .asc
CommandLine|contains: .cer
CommandLine|contains: .gpg
CommandLine|contains: .key
CommandLine|contains: .p12
CommandLine|contains: .p7b
CommandLine|contains: .pem
CommandLine|contains: .pfx
CommandLine|contains: .pgp
CommandLine|contains: .ppk

Stage 2: all of selection_cmd_img

or:
Image|endswith: '\cmd.exe'
OriginalFileName: Cmd.Exe

Stage 3: all of selection_cmd_cli

CommandLine|contains: 'dir '

Stage 4: all of selection_pwsh_img

or:
Image|endswith: '\powershell.exe'
Image|endswith: '\pwsh.exe'
OriginalFileName: PowerShell.EXE
OriginalFileName: pwsh.dll

Stage 5: all of selection_pwsh_cli

CommandLine|contains: 'Get-ChildItem '

Stage 6: selection_findstr

or:
Image|endswith: '\findstr.exe'
OriginalFileName: FINDSTR.EXE

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
  • .asc
  • .cer
  • .gpg
  • .key
  • .p12
  • .p7b
  • .pem
  • .pfx
  • .pgp
  • .ppk
  • Get-ChildItem corpus 2 (sigma 2)
  • dir corpus 4 (sigma 4)
Imageends_with
  • \cmd.exe corpus 92 (sigma 92)
  • \findstr.exe corpus 11 (sigma 11)
  • \powershell.exe corpus 143 (sigma 143)
  • \pwsh.exe corpus 140 (sigma 140)
OriginalFileNameeq
  • Cmd.Exe corpus 32 (sigma 30, splunk 2)
  • FINDSTR.EXE corpus 10 (sigma 10)
  • PowerShell.EXE corpus 64 (sigma 60, splunk 4)
  • pwsh.dll corpus 72 (sigma 68, splunk 4)