PowerShell Write-Hijack HackTool Creates .bat for DLL Hijack Execution (Windows)
Flags PowerShell creating .bat files consistent with PowerUp Write-Hijack DLL abuse on Windows.
- Product
- windows
- Category
- file_event
- Author
- Subhash Popuri (@pbssubhash) (SigmaHQ), DRL 1.1
- Published
- 2021-08-21
- Updated
- 2026-07-31
ATT&CK techniques
Execution → Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags PowerShell or PowerShell Core processes that create a .bat file. The behavior aligns with using the Powerup Write-Hijack DLL capability, which in its default mode builds a self-deleting batch file (debug.bat by default) to execute malicious commands. Detection relies on file creation telemetry capturing the .bat creation event associated with the invoking PowerShell process.
Reporting behind it
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: PowerShell Write-Hijack HackTool Creates .bat for DLL Hijack Execution (Windows)
id: eb4ba970-33fa-45b7-811c-df346c394bec
status: test
description: This rule flags PowerShell or PowerShell Core processes that create a .bat file. The behavior aligns with using the Powerup Write-Hijack DLL capability, which in its default mode builds a self-deleting batch file (debug.bat by default) to execute malicious commands. Detection relies on file creation telemetry capturing the .bat creation event associated with the invoking PowerShell process.
references:
- https://powersploit.readthedocs.io/en/latest/Privesc/Write-HijackDll/
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_hktl_powerup_dllhijacking.yml
author: Subhash Popuri (@pbssubhash), Huntrule Team
date: 2021-08-21
modified: 2024-06-27
tags:
- attack.persistence
- attack.privilege-escalation
- attack.execution
- attack.stealth
- attack.t1574.001
logsource:
category: file_event
product: windows
detection:
selection:
Image|endswith:
- \powershell.exe
- \pwsh.exe
TargetFilename|endswith: .bat
condition: selection
falsepositives:
- Any powershell script that creates bat files
level: high
license: DRL-1.1
related:
- id: 602a1f13-c640-4d73-b053-be9a2fa58b96
type: derived