Detection rules › Sigma

HackTool - SharpLdapWhoami Execution

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

Detects SharpLdapWhoami, a whoami alternative that queries the LDAP service on a domain controller

Known false positives

  • Programs that use the same command line flags

MITRE ATT&CK coverage

TacticTechniques
Discovery

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: HackTool - SharpLdapWhoami Execution
id: d9367cbb-c2e0-47ce-bdc0-128cb6da898d
status: test
description: Detects SharpLdapWhoami, a whoami alternative that queries the LDAP service on a domain controller
references:
    - https://github.com/bugch3ck/SharpLdapWhoami
author: Florian Roth (Nextron Systems)
date: 2022-08-29
modified: 2023-02-04
tags:
    - attack.discovery
    - attack.t1033
    - car.2016-03-001
logsource:
    category: process_creation
    product: windows
detection:
    selection_name:
        Image|endswith: '\SharpLdapWhoami.exe'
    selection_pe: # in case the file has been renamed after compilation
        - OriginalFileName|contains: 'SharpLdapWhoami'
        - Product: 'SharpLdapWhoami'
    selection_flags1:
        CommandLine|endswith:
            - ' /method:ntlm'
            - ' /method:kerb'
            - ' /method:nego'
            - ' /m:nego'
            - ' /m:ntlm'
            - ' /m:kerb'
    condition: 1 of selection*
falsepositives:
    - Programs that use the same command line flags
level: high

Stages and Predicates

Stage 0: condition

1 of selection*

Stage 1: selection_name

selection_name:
    Image|endswith: '\SharpLdapWhoami.exe'

Stage 2: selection_pe

selection_pe:
    - OriginalFileName|contains: 'SharpLdapWhoami'
    - Product: 'SharpLdapWhoami'

Stage 3: selection_flags1

selection_flags1:
    CommandLine|endswith:
        - ' /method:ntlm'
        - ' /method:kerb'
        - ' /method:nego'
        - ' /m:nego'
        - ' /m:ntlm'
        - ' /m:kerb'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLineends_with
  • /m:kerb
  • /m:nego
  • /m:ntlm
  • /method:kerb
  • /method:nego
  • /method:ntlm
field:"CommandLine" kind:ends_with
Imageends_with
  • \SharpLdapWhoami.exe
field:"Image" kind:ends_with value:"\SharpLdapWhoami.exe"
OriginalFileNamematch
  • SharpLdapWhoami
field:"OriginalFileName" kind:match value:"SharpLdapWhoami"
Producteq
  • SharpLdapWhoami
field:"Product" kind:eq value:"SharpLdapWhoami"