Detection rules › Sigma

HackTool - Typical HiveNightmare SAM File Export

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

Detects files written by the different tools that exploit HiveNightmare

Known false positives

  • Files that accidentally contain these strings

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 11: FileCreate

Rule body

title: HackTool - Typical HiveNightmare SAM File Export
id: 6ea858a8-ba71-4a12-b2cc-5d83312404c7
status: test
description: Detects files written by the different tools that exploit HiveNightmare
references:
    - https://github.com/GossiTheDog/HiveNightmare
    - https://github.com/FireFart/hivenightmare/
    - https://github.com/WiredPulse/Invoke-HiveNightmare
    - https://twitter.com/cube0x0/status/1418920190759378944
author: Florian Roth (Nextron Systems)
date: 2021-07-23
modified: 2024-06-27
tags:
    - attack.credential-access
    - attack.t1552.001
    - cve.2021-36934
logsource:
    product: windows
    category: file_event
detection:
    selection:
        - TargetFilename|contains:
              - '\hive_sam_'  # Go version
              - '\SAM-2021-'  # C++ version
              - '\SAM-2022-'  # C++ version
              - '\SAM-2023-'  # C++ version
              - '\SAM-haxx'   # Early C++ versions
              - '\Sam.save'   # PowerShell version
        - TargetFilename: 'C:\windows\temp\sam'  # C# version of HiveNightmare
    condition: selection
falsepositives:
    - Files that accidentally contain these strings
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    - TargetFilename|contains:
          - '\hive_sam_'
          - '\SAM-2021-'
          - '\SAM-2022-'
          - '\SAM-2023-'
          - '\SAM-haxx'
          - '\Sam.save'
    - TargetFilename: 'C:\windows\temp\sam'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
TargetFilenameeq
  • C:\windows\temp\sam
field:"TargetFilename" kind:eq value:"C:\windows\temp\sam"
TargetFilenamematch
  • \SAM-2021-
  • \SAM-2022-
  • \SAM-2023-
  • \SAM-haxx
  • \Sam.save corpus 2 (sigma 2)
  • \hive_sam_ corpus 2 (sigma 2)
field:"TargetFilename" kind:match