TL;DR
- 目的:Detect PowerShell Empire post-exploitation framework artifacts in Windows Script Block Logging (Event ID 4104) and Module Logging (Event ID…
- 适用:恶意软件分析/逆向
- 输入:目标组件/版本 + 漏洞 POC 标识
- 输出:可复现 POC + 利用步骤
- 红线:仅限授权范围内;破坏性 POC 先用只读变体;全 RCE 前明确批准
- 关联:上游:003-src-session-start → 下游:088-analyzing-active-directory-acl-abuse
Analyzing PowerShell Empire Artifacts
Quick Start
# PowerShell Empire 启动监听
uselistener http
set Port 80
execute
# 生成 stager
usestager windows/launcher_bat
execute
Overview
PowerShell Empire is a post-exploitation framework consisting of listeners, stagers, and agents. Its artifacts leave detectable traces in Windows event logs, particularly PowerShell Script Block Logging (Event ID 4104) and Module Logging (Event ID 4103). This skill analyzes event logs for Empire's default launcher string (powershell -noP -sta -w 1 -enc), Base64 encoded payloads containing System.Net.WebClient and FromBase64String, known module invocations (Invoke-Mimikatz, Invoke-Kerberoast, Invoke-TokenManipulation), and staging URL patterns.
When to Use
- When investigating security incidents that require analyzing powershell empire artifacts
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Python 3.9+ with access to Windows Event Log or exported EVTX files
- PowerShell Script Block Logging (Event ID 4104) enabled via Group Policy
- Module Logging (Event ID 4103) enabled for comprehensive coverage
Key Detection Patterns
- Default launcher —
powershell -noP -sta -w 1 -encfollowed by Base64 blob - Stager indicators —
System.Net.WebClient,DownloadData,DownloadString,FromBase64String - Module signatures — Invoke-Mimikatz, Invoke-Kerberoast, Invoke-TokenManipulation, Invoke-PSInject, Invoke-DCOM
- User agent strings — default Empire user agents in HTTP listener configuration
- Staging URLs —
/login/process.php,/admin/get.phpand similar default URI patterns
Output Format
JSON report with matched IOCs, decoded Base64 payloads, timeline of suspicious events, MITRE ATT&CK technique mappings, and severity scores.
Tools & Systems
- BloodHound — AD attack path graph
- Impacket — Python AD exploitation toolkit
- CrackMapExec — AD/SMB enumeration & exploitation
- Certipy — AD CS exploitation
- NetExec — Modern CrackMapExec fork
- evilginx2 — AiTM credential harvesting
- Mimikatz — Windows credential extraction
All tools require prior 002-src-session-start confirmation for A mode. B mode禁用所有攻击工具。
Workflow
- Recon — BloodHound collection via SharpHound or bloodhound-python
- Path analysis — Identify shortest path to DA via BloodHound UI
- Initial access — Phishing (evilginx) or valid creds (compromised)
- Lateral movement — CrackMapExec / Impacket / NetExec across hosts
- Privilege escalation — ADCS, Kerberoast, Shadow Credentials, etc.
- DA/DC compromise — DCSync or mimikatz sekurlsa::logonpasswords
- Cleanup — Remove artifacts, clear logs (if authorized)
Advanced Techniques
ACL Abuse Chains
GenericAll + WriteDACL combinations can yield DA in 3 hops. Use BloodHound's "Shortest Paths to Domain Admins" query.
Cross-Forest Attacks
SID filtering misconfigurations allow cross-forest privilege escalation via trust relationship abuse.