Detection rules › Sigma

CrackMaxpExec share permission enumeration

Status
experimental
Severity
medium
Time window
15m
Log source
product windows, service security
Author
mdecrevoisier
Source
github.com/mdecrevoisier/SIGMA-detection-rules

Detects scenarios where an attacker would perform share permission enumeration using CrackMaxExec SMBmodule.

Event coverage

Rule body yaml

title: CrackMaxpExec share permission enumeration
description: Detects scenarios where an attacker would perform share permission enumeration using CrackMaxExec SMBmodule.
correlation: correlate TargetLogonId from ID 4624 with SubjectLogonId from ID 5145 to identify the source of the enumeration.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0005-Defense%20Evasion/T1222.001-File%20and%20Directory%20Permissions%20Modification
- https://hideandsec.sh/books/cheatsheets/page/crackmapexec
- https://www.infosecmatter.com/crackmapexec-module-library/
- https://mpgn.gitbook.io/crackmapexec/smb-protocol/enumeration/enumerate-shares-and-access
tags:
- attack.
- attack.t
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  service: security
detection: # full command: cme smb -u user -p password --shares
  selection_baseline:
    EventID: 5145

  selection_pipes:
    ShareName: '\\*\IPC$'
    RelativeTargetName:
      - srvsvc # May also be triggered by other tools like SharpHound, DonPapi, ...
      - svcctl # May also be triggered by other tools like Tchopper

  selection_admin_share:
    ShareName: '\\*\ADMIN$'
    RelativeTargetName: # RelativeNames with high entropy (eg: nESNaYmfIO, srnCKoBLQW...)

  filter:
    IpAddress: '%administration_hosts%' # List of IPs of your administration host to reduce false positive

  condition: selection_baseline and not filter and (selection_pipes or selection_admin_share) | count(Computer) by IpAddress > 20
  timeframe: 15m
falsepositives:
- Administrator activity, backup solutions, Windows Server Manager
level: medium

Stages and Predicates

Stage 0: condition

selection_baseline and not filter and (selection_pipes or selection_admin_share) | count(Computer) by IpAddress > 20

Stage 1: selection_baseline

selection_baseline:
  EventID: 5145
Threshold
> 20

Stage 2: not filter

filter:
  IpAddress: '%administration_hosts%'

Stage 3: selection_pipes

selection_pipes:
  ShareName: '\\*\IPC$'
  RelativeTargetName:
    - srvsvc
    - svcctl

Stage 4: selection_admin_share

selection_admin_share:
  ShareName: '\\*\ADMIN$'
  RelativeTargetName:

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
IpAddresseq%administration_hosts%

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
RelativeTargetNameeq
  • srvsvc corpus 2 (sigma 2)
  • svcctl corpus 6 (sigma 5, kusto 1)
RelativeTargetNameis_null
  • (no value, null check)
ShareNamewildcard
  • \\*\ADMIN$ corpus 6 (sigma 6)
  • \\*\IPC$ corpus 11 (sigma 11)