PowerShell SAM Copy


Description

Detects suspicious PowerShell scripts accessing SAM hives

Query · sigma

selection_1:
  CommandLine|contains|all:
  - \HarddiskVolumeShadowCopy
  - System32\config\sam
selection_2:
  CommandLine|contains:
  - Copy-Item
  - cp $_.
  - cpi $_.
  - copy $_.
  - .File]::Copy(
condition: all of selection*

Known false positives

  • Some rare backup scenarios
  • PowerShell scripts fixing HiveNightmare / SeriousSAM ACLs
Raw source PowerShell SAM Copy · Sigma
Esc
Published by SigmaHQ/sigma ↗, licensed under Detection Rule License 1.1 ↗. Reproduced here unmodified.
title: PowerShell SAM Copy
id: 1af57a4b-460a-4738-9034-db68b880c665
status: test
description: Detects suspicious PowerShell scripts accessing SAM hives
references:
    - https://twitter.com/splinter_code/status/1420546784250769408
author: Florian Roth (Nextron Systems)
date: 2021-07-29
modified: 2023-01-06
tags:
    - attack.credential-access
    - attack.t1003.002
logsource:
    category: process_creation
    product: windows
detection:
    selection_1:
        CommandLine|contains|all:
            - '\HarddiskVolumeShadowCopy'
            - 'System32\config\sam'
    selection_2:
        CommandLine|contains:
            - 'Copy-Item'
            - 'cp $_.'
            - 'cpi $_.'
            - 'copy $_.'
            - '.File]::Copy('
    condition: all of selection*
falsepositives:
    - Some rare backup scenarios
    - PowerShell scripts fixing HiveNightmare / SeriousSAM ACLs
level: high

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.