Windows PowerShell Copies a DLL into System32 or SysWOW64
Flags PowerShell Copy-Item targeting Windows\System32 or Windows\SysWOW64 for file placement.
- Product
- windows
- Category
- ps_script
- Author
- frack113, Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2021-12-27
- Updated
- 2026-07-31
ATT&CK techniques
Persistence → Cred AccessRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule matches PowerShell script block content where a file copy command (e.g., Copy-Item/cpi) copies a DLL into a Windows system directory, specifically paths under \Windows\System32 or \Windows\SysWOW64. Attackers may use this to place malicious or unwanted DLLs where they can later be loaded by legitimate processes, supporting persistence or defense impairment. Telemetry relies on script block logging that captures the executed PowerShell text and its destination path.
Reporting behind it
- github.comhttps://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1556.002/T1556.002.md#atomic-test-1---install-and-register-password-filter-dll
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_copy_item_system_directory.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows PowerShell Copies a DLL into System32 or SysWOW64
id: 0fc2ca50-bd18-4a37-8612-fd8dfa2212e9
status: test
description: This rule matches PowerShell script block content where a file copy command (e.g., Copy-Item/cpi) copies a DLL into a Windows system directory, specifically paths under \Windows\System32 or \Windows\SysWOW64. Attackers may use this to place malicious or unwanted DLLs where they can later be loaded by legitimate processes, supporting persistence or defense impairment. Telemetry relies on script block logging that captures the executed PowerShell text and its destination path.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1556.002/T1556.002.md#atomic-test-1---install-and-register-password-filter-dll
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_copy_item_system_directory.yml
author: frack113, Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2021-12-27
modified: 2024-01-22
tags:
- attack.persistence
- attack.credential-access
- attack.defense-impairment
- attack.t1556.002
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection:
ScriptBlockText|re: (Copy-Item|cpi) .{2,128} -Destination .{1,32}\\Windows\\(System32|SysWOW64)
condition: selection
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 63bf8794-9917-45bc-88dd-e1b5abc0ecfd
type: derived