Analyzing PowerShell Empire Artifacts
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
Trigger phrases:
"analyzing powershell empire artifacts"
"Detect PowerShell Empire framework artifacts in Windows event logs by identifyin"
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 -enc followed 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.php and similar default URI patterns
When NOT to Use
- You need to perform the attack, not analyze it (use performing-* skills)
- Task is about detection, not analysis (use detecting-* skills)
- You need to implement controls (use implementing-* skills)
- Task is about threat hunting, not post-incident analysis (use hunting-* skills)
- You don't have access to the artifacts/logs to analyze
- Task requires real-time monitoring (use SOC tools)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Exceeding the authorized scope of the engagement
- Leaving persistent access mechanisms without explicit approval
- Causing denial-of-service on production systems during testing
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- Results validated against known-good baselines or reference implementations
- Documentation complete enough for another analyst to reproduce findings
Output
JSON report with matched IOCs, decoded Base64 payloads, timeline of suspicious events, MITRE ATT&CK technique mappings, and severity scores.
Process
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: analyzing-powershell-empire-artifacts3description: Use when detect PowerShell Empire framework artifacts in Windows event logs by identifying Base64 encoded launcher patterns, default user agents, staging URL structures, stager IOCs, and known Empire module signatures in Script Block Logging events. Use when detecting powershell empire framework artifacts in windows event logs by.4license: Apache-2.05---678# Analyzing PowerShell Empire Artifacts910## Overview1112PowerShell 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.131415## When to Use16**Trigger phrases:**17- "analyzing powershell empire artifacts"18- "Detect PowerShell Empire framework artifacts in Windows event logs by identifyin"192021- When investigating security incidents that require analyzing powershell empire artifacts22- When building detection rules or threat hunting queries for this domain23- When SOC analysts need structured procedures for this analysis type24- When validating security monitoring coverage for related attack techniques2526## Prerequisites2728- Python 3.9+ with access to Windows Event Log or exported EVTX files29- PowerShell Script Block Logging (Event ID 4104) enabled via Group Policy30- Module Logging (Event ID 4103) enabled for comprehensive coverage3132## Key Detection Patterns33341. **Default launcher** — `powershell -noP -sta -w 1 -enc` followed by Base64 blob352. **Stager indicators** — `System.Net.WebClient`, `DownloadData`, `DownloadString`, `FromBase64String`363. **Module signatures** — Invoke-Mimikatz, Invoke-Kerberoast, Invoke-TokenManipulation, Invoke-PSInject, Invoke-DCOM374. **User agent strings** — default Empire user agents in HTTP listener configuration385. **Staging URLs** — `/login/process.php`, `/admin/get.php` and similar default URI patterns3940## When NOT to Use4142- You need to perform the attack, not analyze it (use performing-* skills)43- Task is about detection, not analysis (use detecting-* skills)44- You need to implement controls (use implementing-* skills)45- Task is about threat hunting, not post-incident analysis (use hunting-* skills)46- You don't have access to the artifacts/logs to analyze47- Task requires real-time monitoring (use SOC tools)484950## Red Flags5152- Performing actions without explicit written authorization from the asset owner53- Testing against production systems without a defined scope and rules of engagement54- Exceeding the authorized scope of the engagement55- Leaving persistent access mechanisms without explicit approval56- Causing denial-of-service on production systems during testing5758## Verification5960- All steps executed successfully against a test environment before production use61- Output documented with screenshots or logs demonstrating expected behavior62- Results validated against known-good baselines or reference implementations63- Documentation complete enough for another analyst to reproduce findings6465## Output6667JSON report with matched IOCs, decoded Base64 payloads, timeline of suspicious events, MITRE ATT&CK technique mappings, and severity scores.6869## Process7071```python72# Example: IOC detection73import re7475IOC_PATTERNS = {76 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",77 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",78 "hash_md5": r"\b[a-f0-9]{32}\b",79 "hash_sha256": r"\b[a-f0-9]{64}\b",80}8182def extract_iocs(text: str) -> dict:83 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}84```85861. Analyze the task requirements872. Apply domain expertise883. Verify output quality8990## Anti-Rationalization Table9192| Rationalization | Reality |93|---|---|94| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |95| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |96| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |