yoraexe/ceobe/ctf-malware-pe-dotnet

Claude Code and agent skill by yoraexe/ceobe

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

CTF PE and .NET malware analysis. PE static triage with peframe/pestudio, sandbox evasion detection (VM artifacts, debugger checks, timing), .NET assembly analysis with dnSpy/ILSpy, LimeRAT C2 extraction via AES-256-ECB with MD5 key derivation, PyInstaller extraction with pyinstxtractor, PyArmor unpacking, malware config extraction from .data/.rdata sections, DotNet AsmResolver programmatic analysis. Triggers: 'pe analysis', '.net malware', 'dnspy', 'ilspy', 'dotnet reverse', 'limerat', 'malware config extraction', 'pyinstaller extract', 'pyarmor unpack', 'sandbox evasion detection', 'pe triage', 'wrestling resources'.

Install

npx vskill@latest install yoraexe/ceobe/ctf-malware-pe-dotnet

SKILL.md

The same SKILL.md was published earlier as yoraexe/ceobe/ctf-malware-pe-dotnet.

CTF Malware — PE, .NET & Binary Analysis

PE triage, .NET reversal, PyInstaller unpacking, config extraction.

Install

bash
apt-get install python3-pefile
pip install peframe dnspy oletools --break-system-packages
# ILSpy (cross-platform): https://github.com/icsharpcode/ILSpy
# dnSpy: https://github.com/dnSpy/dnSpy/releases

Phase 1: PE Static Triage

bash
# Quick triage:
peframe malware.exe
pestudio malware.exe # Windows GUI tool
# PE resource extraction:
wrestool -x -t 10 malware.exe -o config.bin
# String extraction from sections:
objdump -s -j .rdata malware.exe
objdump -s -j .data malware.exe
strings -a malware.exe | grep -E '(http|ftp|[0-9]{1,3}\.[0-9]+|password|key)'
# Runtime analysis:
pe-sieve /pid <PID> # detect injected code

Phase 2: Sandbox Evasion Detection

bash
# In Ghidra/IDA, look for:
# VM detection: VMware artifacts (registry keys, mutex names, hardware IDs)
# Debugger check: IsDebuggerPresent, NtQueryInformationProcess
# Timing: GetTickCount before/after sleep (detect sleep acceleration)
# Environment: GetUserName, GetComputerName, GetEnvironmentVariable
# Anti-analysis tools: check for wireshark.exe, processhacker.exe, etc.
# Common VM artifact strings to search:
# "vmware" "vbox" "VBOX" "VirtualBox" "vmtoolsd" "vmusr"
strings malware.exe | grep -i "vmware\|vbox\|virtual"

Phase 3: .NET Analysis with dnSpy

bash
# Open .NET binary in dnSpy → Assembly Explorer → navigate types/methods
# Look for:
# 1. Network functions: TcpClient, DnsClient, HttpClient, WebClient
# 2. Encryption wrappers around System.Security.Cryptography
# 3. Command dispatch: switch on opcode/command string
# 4. Configuration class with Base64 encoded strings
# .NET resource extraction:
monodis --mresources malware.dll
python
# LimeRAT C2 extraction pattern:
from Crypto.Cipher import AES
import hashlib, base64
# Step 1: Find configuration class in dnSpy with Base64 encoded string
# Step 2: Find decryption method (AES-256-ECB with MD5 key derivation)
# Key derivation: MD5 of hardcoded string → first 15 + full 16 bytes + null = 32-byte key
key_source = '${8\',`d0}n,~@J;oZ"9a'
md5 = hashlib.md5(key_source.encode()).hexdigest()
key = bytes.fromhex(md5[:30] + md5 + '00')[:32]
cipher = AES.new(key, AES.MODE_ECB)
plaintext = cipher.decrypt(base64.b64decode(encrypted_b64))
print(plaintext) # reveals C2 IP/domain

Phase 4: .NET Programmatic Analysis (AsmResolver)

csharp
using AsmResolver.DotNet;
var module = ModuleDefinition.FromFile("malware.dll");
foreach (var type in module.GetAllTypes()) {
foreach (var method in type.Methods) {
// method.Name, method.FullName
// method.CilMethodBody.Instructions → analyze IL instructions
foreach (var instr in method.CilMethodBody?.Instructions ?? []) {
// instr.OpCode, instr.Operand → find crypto patterns
}
}
}

Phase 5: PyInstaller + PyArmor Unpacking

bash
# Step 1: Extract PyInstaller archive
python pyinstxtractor.py malware.exe
# Files in malware.exe_extracted/
# Main module = largest .pyc file (or filename from MANIFEST)
# Step 2: Decompile .pyc
pip install uncompyle6 decompile3
uncompyle6 main_module.pyc > decompiled.py
# Step 3: PyArmor protected → use unpacker
# https://github.com/Svenskithesource/PyArmor-Unpacker
# Three methods available (choose based on PyArmor version detected)
# Step 4: Clean up deobfuscated source
# Remove dead-code functions (confusion code)
# Identify core crypto/exfiltration logic

Phase 6: Malware Configuration Extraction

bash
# Common config storage locations:
# 1. .data section (hardcoded constants)
# 2. PE resources (type 10 = RCDATA)
# 3. Registry keys written at install
# 4. Encrypted config file dropped to disk
# .data hardcoded:
python3 -c "
import pefile
pe = pefile.PE('malware.exe')
for s in pe.sections:
name = s.Name.decode().strip('\x00')
if name in ('.data', '.rdata'):
data = s.get_data()
print(f'Section {name}: {len(data)} bytes')
# Look for config patterns: IPs, URLs, base64 blobs
"
# PE resources:
wrestool -l malware.exe # list resources
wrestool -x -t 10 -n 1 malware.exe -o config.bin # extract resource
xxd config.bin | head -20

Phase 7: Common C2 Extraction Patterns

python
# Pattern 1: XOR-encoded config in .data section
import pefile
pe = pefile.PE('malware.exe')
data_section = next(s for s in pe.sections if b'.data' in s.Name)
raw = data_section.get_data()
xor_key = 0x4D # found from disassembly
decoded = bytes(b ^ xor_key for b in raw)
print(decoded.split(b'\x00'))
# Pattern 2: Base64 encoded string + custom decryption
import base64, hashlib
from Crypto.Cipher import AES
b64_config = "ENCODED_STRING_FROM_DNSPY"
key = hashlib.sha256(b"hardcoded_seed").digest()
cipher = AES.new(key[:16], AES.MODE_ECB)
config = cipher.decrypt(base64.b64decode(b64_config))
print(config)

Output

Save to .omop/engagement/ctf/malware/:

  • config_extracted.json — C2 addresses, keys, config
  • decompiled.py — decompiled Python malware
  • flag.txt — found flag

Next Phase

→ ctf-malware-c2-protocols for network traffic decryption → ctf-malware-scripts for script/macro obfuscation → ctf-reverse-tools-advanced for VMProtect/Themida analysis

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/yoraexe/ceobe/ctf-malware-pe-dotnet/badge)](https://verified-skill.com/skills/yoraexe/ceobe/ctf-malware-pe-dotnet)

Something wrong with this skill or its page? Tell us.