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 event4 logs by identifying Base64 encoded launcher patterns, default user agents, staging5 URL structures, stager IOCs, and known Empire module signatures in Script Block6 Logging events. Use when detecting powershell empire framework artifacts in windows7 event logs by.8domain: cybersecurity9subdomain: threat-hunting10tags:11- PowerShell-Empire12- threat-hunting13- Script-Block-Logging14- base6415- stager16- C217- MITRE-ATT&CK18- T1059.00119- forensics20version: '1.0'21author: oyi7722license: Apache-2.023d3fend_techniques:24- Executable Denylisting25- Execution Isolation26- File Metadata Consistency Validation27- Content Format Conversion28- File Content Analysis29nist_ai_rmf:30- GOVERN-1.131- MEASURE-2.732- MANAGE-3.133nist_csf:34- DE.CM-0135- DE.AE-0236- DE.AE-0737- ID.RA-0538category: cybersecurity39metadata:40 source: https://skillmd.com/skills/oyi77/analyzing-powershell-empire-artifacts41---424344# Analyzing PowerShell Empire Artifacts4546## Overview4748PowerShell 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.495051## When to Use52**Trigger phrases:**53- "analyzing powershell empire artifacts"54- "Detect PowerShell Empire framework artifacts in Windows event logs by identifyin"555657- When investigating security incidents that require analyzing powershell empire artifacts58- When building detection rules or threat hunting queries for this domain59- When SOC analysts need structured procedures for this analysis type60- When validating security monitoring coverage for related attack techniques6162## Prerequisites6364- Python 3.9+ with access to Windows Event Log or exported EVTX files65- PowerShell Script Block Logging (Event ID 4104) enabled via Group Policy66- Module Logging (Event ID 4103) enabled for comprehensive coverage6768## Key Detection Patterns69701. **Default launcher** — `powershell -noP -sta -w 1 -enc` followed by Base64 blob712. **Stager indicators** — `System.Net.WebClient`, `DownloadData`, `DownloadString`, `FromBase64String`723. **Module signatures** — Invoke-Mimikatz, Invoke-Kerberoast, Invoke-TokenManipulation, Invoke-PSInject, Invoke-DCOM734. **User agent strings** — default Empire user agents in HTTP listener configuration745. **Staging URLs** — `/login/process.php`, `/admin/get.php` and similar default URI patterns7576## When NOT to Use7778- You need to perform the attack, not analyze it (use performing-* skills)79- Task is about detection, not analysis (use detecting-* skills)80- You need to implement controls (use implementing-* skills)81- Task is about threat hunting, not post-incident analysis (use hunting-* skills)82- You don't have access to the artifacts/logs to analyze83- Task requires real-time monitoring (use SOC tools)848586## Red Flags8788- Performing actions without explicit written authorization from the asset owner89- Testing against production systems without a defined scope and rules of engagement90- Exceeding the authorized scope of the engagement91- Leaving persistent access mechanisms without explicit approval92- Causing denial-of-service on production systems during testing9394## Verification9596- All steps executed successfully against a test environment before production use97- Output documented with screenshots or logs demonstrating expected behavior98- Results validated against known-good baselines or reference implementations99- Documentation complete enough for another analyst to reproduce findings100101## Output102103JSON report with matched IOCs, decoded Base64 payloads, timeline of suspicious events, MITRE ATT&CK technique mappings, and severity scores.104105## Process106107```python108# Example: IOC detection109import re110111IOC_PATTERNS = {112 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",113 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",114 "hash_md5": r"\b[a-f0-9]{32}\b",115 "hash_sha256": r"\b[a-f0-9]{64}\b",116}117118def extract_iocs(text: str) -> dict:119 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}120```1211221. Analyze the task requirements1232. Apply domain expertise1243. Verify output quality125126## Anti-Rationalization Table127128| Rationalization | Reality |129|---|---|130| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |131| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |132| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |