deobfuscating-powershell-obfuscated-malware
Systematically deobfuscate multi-layer PowerShell malware using AST analysis, dynamic tracing, and tools like PSDecode and PowerDecode to reveal hidden…
Skill by adriannoes
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/adriannoes-deobfuscating-powershell-obfuscated-malware
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/deobfuscating-powershell-obfuscated-malware
What's inside
- Skill name
deobfuscating-powershell-obfuscated-malware- Description
- Systematically deobfuscate multi-layer PowerShell malware using AST analysis, dynamic tracing, and tools like PSDecode and PowerDecode to reveal hidden payloads and C2 infrastructure.
- License
- Apache-2.0
- Instructions
- 353 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (8)
- LICENSE
- SKILL.md
- template.md · assets/
- api-reference.md · references/
- standards.md · references/
- workflows.md · references/
- agent.py · scripts/
- process.py · scripts/
SKILL.md (first lines)
# Deobfuscating PowerShell Obfuscated Malware
## Overview
PowerShell is heavily abused by malware authors due to its deep Windows integration and powerful scripting capabilities. Obfuscation techniques include string concatenation, Base64 encoding, character substitution, Invoke-Expression layering, SecureString abuse, environment variable manipulation, and tick-mark insertion. Modern malware uses multiple obfuscation layers requiring iterative deobfuscation. Tools like PSDecode, PowerDecode, and PowerPeeler automate much of this process, while manual AST (Abstract Syntax Tree) analysis handles custom obfuscation. PowerPeeler achieves a 95% deobfuscation correctness rate using instruction-level dynamic analysis of expression-related AST nodes.
## When to Use
- When performing authorized security testing that involves deobfuscating powershell obfuscated malware
- When analyzing malware samples or attack artifacts in a controlled environment
- When conducting red team exercises or penetration testing engagements
- When building detection capabilities based on offensive technique understanding
## Prerequisites
- Python 3.9+ with `base64`, `re`, `subprocess` modules
- PowerShell 5.1+ or PowerShell 7+ (for AST access)
- PSDecode (`Install-Module PSDecode`)
- PowerDecode (https://github.com/Malandrone/PowerDecode)
- Isolated VM or sandbox for safe script execution
- CyberChef for manual encoding transformations
- Understanding of PowerShell AST and Invoke-Expression patterns
## Key Concepts
### Common Obfuscation Techniques
PowerShell malware employs layered obfuscation to evade static detection. String concatenation splits commands across variables (`$a='In'+'voke'`). Base64 encoding wraps entire scripts in `-EncodedCommand` parameters. Character code arrays use `[char]` casting (`[char[]](73,69,88)|%{$r+=$_}`). Environment variable abuse reads substrings from `$env:` paths. Tick-mark insertion adds backticks between characters that PowerShell ignores (`I`nv`oke-Exp`ression`). SecureString conversion encrypts strings using ConvertTo-SecureString with embedded keys.
### AST-Based Deobfuscation
PowerShell's Abstract Syntax Tree exposes the parsed structure of scripts regardless of surface-level obfuscation. By walking the AST and evaluating expression nodes, analysts can resolve concatenated strings, decode encoded values, and reconstruct the original commands. PowerPeeler uses this approach at the instruction level, monitoring the execution process to correlate AST nodes with their evaluated results.
### Dynamic Execution Tracing
By replacing `Invoke-Expression` (IEX) with `Write-Output`, analysts can safely capture the deobfuscated script content that would normally be executed. This technique works across multiple layers by iteratively replacing IEX calls until the final payload is revealed.
## Workflow
### Step 1: Identify Obfuscation Layers
```python
#!/usr/bin/env python3
"""Identify and classify PowerShell obfuscation techniques."""
import re
import base64
import sys
def analyze_obfuscation(script_content):
"""Identify obfuscation techniques used in PowerShell script."""
techniques = []
# Check for Base64 encoded command
b64_pattern = re.compile(
r'-[Ee](?:nc(?:odedcommand)?)\s+([A-Za-z0-9+/=]{20,})',
re.IGNORECASE
)
if b64_pattern.search(script_content):
techniques.append("Base64 EncodedCommand")
# Check for FromBase64String
if re.search(r'\[Convert\]::FromBase64String', script_content, re.IGNORECASE):
techniques.append("Base64 FromBase64String")
# Check for string concatenation
concat_count = script_content.count("'+'") + script_content.count('"+"')
if concat_count > 3:
techniques.append(f"String Concatenation ({concat_count} joins)")
# Check for char array construction
if re.search(r'\[char\]\s*\d+', script_content, re.IGNORECASE):
techniques.append("Character Code Array")
# Check for Invoke-Expression variants
iex_patterns = [
r'Invoke-Expression',
r'\bIEX\b',
r'\.\s*\(\s*\$',
r'&\s*\(\s*\$',
r'\|\s*IEX',
r'\|\s*Invoke-Expression',
]
for pattern in iex_patterns:
if re.search(pattern, script_content, re.IGNORECASE):
techniques.append(f"Invoke-Expression variant: {pattern}")
# Check for tick-mark obfuscation
tick_count = script_content.count('`')
if tick_count > 5:
techniques.append(f"Tick-mark Insertion ({tick_count} backticks)")
# Check for environment variable abuse
if re.search(r'\$env:', script_content, re.IGNORECASE):
env_refs = re.findall(r'\$env:\w+', script_content, re.IGNORECASE)
if len(env_refs) > 2:
techniques.append(f"Environment Variable Abuse ({len(env_refs)} refs)")
# Check for SecureString
if re.search(r'ConvertTo-SecureString', script_content, re.IGNORECASE):
techniques.append("SecureString Encryption")
# Check for compression
if re.search(r'IO\.Compression|DeflateStream|GZipStream',
script_content, re.IGNORECASE):
techniques.append("Compression (Deflate/GZip)")
# Check for XOR encoding
if re.search(r'-bxor\s+\d+', script_content, re.IGNORECASE):
techniques.append("XOR Encoding")
# Check for Replace chain
replace_count = len(re.findall(r'\.Replace\(', script_content))
if replace_count > 2:
techniques.append(f"Replace Chain ({replace_count} replacements)")
return techniquesFrom adriannoes/awesome-agentic-ai, Apache-2.0.
More from adriannoes/awesome-agentic-ai
- 0.674score
skill-security-auditor
adriannoes
Security audit and vulnerability scanner for AI agent skills before installation.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
deobfuscating-javascript-malware
adriannoes
Deobfuscates malicious JavaScript code used in web-based attacks, phishing pages, and dropper scripts by reversing encoding layers, eval chains, string…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
conducting-cloud-incident-response
adriannoes
Responds to security incidents in cloud environments (AWS, Azure, GCP) by performing identity-based containment, cloud-native log analysis, resource…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
detecting-ai-model-prompt-injection-attacks
adriannoes
Detects prompt injection attacks targeting LLM-based applications using a multi-layered defense combining regex pattern matching for known attack signatures…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
analyzing-cloud-storage-access-patterns
adriannoes
Detect abnormal access patterns in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
building-cloud-siem-with-sentinel
adriannoes
This skill covers deploying Microsoft Sentinel as a cloud-native SIEM and SOAR platform for centralized security operations.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
analyzing-bootkit-and-rootkit-samples
adriannoes
Analyzes bootkit and advanced rootkit malware that infects the Master Boot Record (MBR), Volume Boot Record (VBR), or UEFI firmware to gain persistence below…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
building-incident-response-playbook
adriannoes
Designs and documents structured incident response playbooks that define step-by-step procedures for specific incident types aligned with NIST SP 800-61r3 and…
SkillAFreshness: A★ 72Claude Code +9 - 0.671score
analyzing-ransomware-network-indicators
adriannoes
Identify ransomware network indicators including C2 beaconing patterns, TOR exit node connections, data exfiltration flows, and encryption key exchange via…
SkillAFreshness: A★ 72Claude Code +9 - 0.671score
building-devsecops-pipeline-with-gitlab-ci
adriannoes
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
SkillAFreshness: A★ 72Claude Code +9 - 0.671score
analyzing-browser-forensics-with-hindsight
adriannoes
Analyze Chromium-based browser artifacts using Hindsight to extract browsing history, downloads, cookies, cached content, autofill data, saved passwords, and…
SkillAFreshness: A★ 72Claude Code +9 - 0.671score
analyzing-persistence-mechanisms-in-linux
adriannoes
Detect and analyze Linux persistence mechanisms including crontab entries, systemd service units, LD_PRELOAD hijacking, bashrc modifications, and…
SkillAFreshness: A★ 72Claude Code +9
Signals
- Stars
- 72
- Forks
- 19
- Open issues
- 0
- Last commit (this folder)
- Aug 28, 2026 (2 months ago)
- Last release
- Oct 24, 2026 (5 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/adriannoes/awesome-agentic-ai
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from adriannoes
- 0.674score
building-cloud-siem-with-sentinel
adriannoes
This skill covers deploying Microsoft Sentinel as a cloud-native SIEM and SOAR platform for centralized security operations.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
building-incident-response-playbook
adriannoes
Designs and documents structured incident response playbooks that define step-by-step procedures for specific incident types aligned with NIST SP 800-61r3 and…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
skill-security-auditor
adriannoes
Security audit and vulnerability scanner for AI agent skills before installation.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
analyzing-cloud-storage-access-patterns
adriannoes
Detect abnormal access patterns in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
analyzing-bootkit-and-rootkit-samples
adriannoes
Analyzes bootkit and advanced rootkit malware that infects the Master Boot Record (MBR), Volume Boot Record (VBR), or UEFI firmware to gain persistence below…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
conducting-cloud-incident-response
adriannoes
Responds to security incidents in cloud environments (AWS, Azure, GCP) by performing identity-based containment, cloud-native log analysis, resource…
SkillAFreshness: A★ 72Claude Code +9
Cite this page
deobfuscating-powershell-obfuscated-malware skill. Agent Mart. https://agentmart.dev/skills/adriannoes-deobfuscating-powershell-obfuscated-malware (last updated 2026-10-24)