Detection rules › Sigma

HackTool - CrackMapExec Execution

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

This rule detect common flag combinations used by CrackMapExec in order to detect its use even if the binary has been replaced.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: HackTool - CrackMapExec Execution
id: 42a993dd-bb3e-48c8-b372-4d6684c4106c
status: test
description: This rule detect common flag combinations used by CrackMapExec in order to detect its use even if the binary has been replaced.
references:
    - https://mpgn.gitbook.io/crackmapexec/smb-protocol/authentication/checking-credentials-local
    - https://www.mandiant.com/resources/telegram-malware-iranian-espionage
    - https://www.infosecmatter.com/crackmapexec-module-library/?cmem=mssql-mimikatz
    - https://www.infosecmatter.com/crackmapexec-module-library/?cmem=smb-pe_inject
author: Florian Roth (Nextron Systems)
date: 2022-02-25
modified: 2023-03-08
tags:
    - attack.execution
    - attack.persistence
    - attack.privilege-escalation
    - attack.credential-access
    - attack.discovery
    - attack.t1047
    - attack.t1053
    - attack.t1059.003
    - attack.t1059.001
    - attack.t1110
    - attack.t1201
logsource:
    category: process_creation
    product: windows
detection:
    selection_binary:
        Image|endswith: '\crackmapexec.exe'
    selection_special:
        CommandLine|contains: ' -M pe_inject '
    selection_execute:
        CommandLine|contains|all:
            - ' --local-auth'
            - ' -u '
            - ' -x '
    selection_hash:
        CommandLine|contains|all:
            - ' --local-auth'
            - ' -u '
            - ' -p '
            - " -H 'NTHASH'"
    selection_module_mssql:
        CommandLine|contains|all:
            - ' mssql '
            - ' -u '
            - ' -p '
            - ' -M '
            - ' -d '
    selection_module_smb1:
        CommandLine|contains|all:
            - ' smb '
            - ' -u '
            - ' -H '
            - ' -M '
            - ' -o '
    selection_module_smb2:
        CommandLine|contains|all:
            - ' smb '
            - ' -u '
            - ' -p '
            - ' --local-auth'
    part_localauth_1:
        CommandLine|contains|all:
            - ' --local-auth'
            - ' -u '
            - ' -p '
    part_localauth_2:
        CommandLine|contains|all:
            - ' 10.'
            - ' 192.168.'
            - '/24 '
    condition: 1 of selection_* or all of part_localauth*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

1 of selection_* or all of part_localauth*

Stage 1: selection_binary

selection_binary:
    Image|endswith: '\crackmapexec.exe'

Stage 2: selection_special

selection_special:
    CommandLine|contains: ' -M pe_inject '

Stage 3: selection_execute

selection_execute:
    CommandLine|contains|all:
        - ' --local-auth'
        - ' -u '
        - ' -x '

Stage 4: selection_hash

selection_hash:
    CommandLine|contains|all:
        - ' --local-auth'
        - ' -u '
        - ' -p '
        - " -H 'NTHASH'"

Stage 5: selection_module_mssql

selection_module_mssql:
    CommandLine|contains|all:
        - ' mssql '
        - ' -u '
        - ' -p '
        - ' -M '
        - ' -d '

Stage 6: selection_module_smb1

selection_module_smb1:
    CommandLine|contains|all:
        - ' smb '
        - ' -u '
        - ' -H '
        - ' -M '
        - ' -o '

Stage 7: selection_module_smb2

selection_module_smb2:
    CommandLine|contains|all:
        - ' smb '
        - ' -u '
        - ' -p '
        - ' --local-auth'

Stage 8: part_localauth_1

part_localauth_1:
    CommandLine|contains|all:
        - ' --local-auth'
        - ' -u '
        - ' -p '

Stage 9: part_localauth_2

part_localauth_2:
    CommandLine|contains|all:
        - ' 10.'
        - ' 192.168.'
        - '/24 '

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
  • --local-auth
  • -H
  • -H 'NTHASH'
  • -M
  • -M pe_inject
  • -d corpus 8 (sigma 7, splunk 1)
  • -o corpus 3 (sigma 3)
  • -p corpus 10 (sigma 7, splunk 3)
  • -u corpus 8 (sigma 5, chronicle 2, splunk 1)
  • -x corpus 2 (sigma 2)
  • 10. corpus 3 (sigma 3)
  • 192.168. corpus 3 (sigma 3)
  • mssql corpus 2 (sigma 2)
  • smb corpus 2 (sigma 2)
  • /24
Imageends_with
  • \crackmapexec.exe corpus 2 (sigma 2)