reverser-dotnet-malware
하는 일
이 스킬은 .NET 악성코드를 검토하는 방법을 설명합니다. 파일 식별부터 디코딩된 코드 읽기와 설정 추출까지 다룹니다. .NET 샘플을 분석하는 악성코드 분석가를 위한 스킬입니다.
사용하는 경우
- ✓분석가가 .NET으로 작성된 의심스러운 Windows 프로그램을 받아 소스가 필요할 때.
- ✓연구자가 읽기 전에 .NET 파일의 난독화를 제거해야 하는 경우.
- ✓팀이 .NET 샘플에서 숨겨진 설정 값을 꺼내려는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/dotnet-malware/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 .NET 파일은 난독화가 심합니다. 무엇을 하는지 어떻게 읽을 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 파일을 식별하고, 난독화를 정리하고, 읽을 수 있는 코드로 디컴파일하고, 설정을 추출하는 단계를 제공합니다. 각 단계는 드러난 내용을 기록합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
.NET Malware Analysis
Analyze .NET malware from initial triage through full decompilation, de-obfuscation, config extraction, and behavioral mapping.
Quick Reference
# Identify .NET assembly
file <TARGET>
python3 -c "import pefile; pe=pefile.PE('<TARGET>'); print('CLR:', pe.OPTIONAL_HEADER.DATA_DIRECTORY[14].VirtualAddress)"
# Fast metadata check
monodis --assembly <TARGET>
strings -n 10 <TARGET> | grep -iE 'System\.Reflection|Assembly\.Load|FromBase64|Invoke|WebClient|DownloadString'
# De-obfuscate with de4dot
de4dot <TARGET> -o <TARGET>.cleaned.exe
# Decompile to C# project
ilspycmd -p -o ./decompiled/ <TARGET>
# Extract embedded resources
python3 -c "
import dnfile
dn = dnfile.dnPE('<TARGET>')
for r in dn.net.resources:
print(f'{r.name} offset={r.offset} size={r.size}')
"
MITRE ATT&CK Mapping
| Technique | ID | How It Appears |
|---|---|---|
| Software Packing | T1027.002 | ConfuserEx, .NET Reactor, SmartAssembly, Babel packing |
| Deobfuscate/Decode | T1140 | Base64 decode + Assembly.Load, XOR decryption of payloads |
| PowerShell | T1059.001 | Cradle execution: powershell -enc <base64> from managed code |
| Obfuscated Files | T1027 | String encryption, control flow flattening, anti-tamper |
| Reflective Code Loading | T1620 | Assembly.Load(byte[]) for in-memory stage loading |
1. Identify .NET Assembly
Confirm the sample is managed code before committing to .NET tooling.
# Check PE headers for CLR data directory (index 14)
python3 << 'EOF'
import pefile, sys
pe = pefile.PE("<TARGET>")
clr_dir = pe.OPTIONAL_HEADER.DATA_DIRECTORY[14]
if clr_dir.VirtualAddress > 0:
print(f"[+] .NET assembly confirmed — CLR RVA: {hex(clr_dir.VirtualAddress)}")
# Check runtime version
import struct
clr_offset = pe.get_offset_from_rva(clr_dir.VirtualAddress)
pe.__data__.seek(clr_offset + 8)
major, minor = struct.unpack('<HH', pe.__data__.read(4))
print(f" Runtime: v{major}.{minor}")
else:
print("[-] Not a .NET assembly")
sys.exit(1)
EOF
# Alternative quick checks
file <TARGET> # Look for "Mono/.Net assembly"
exiftool <TARGET> | grep -i "assembly\|\.net\|framework"
2. Detect Obfuscator
Identify what protection was applied before attempting decompilation.
# de4dot auto-detects most obfuscators
de4dot --detect-only <TARGET>
# Output example: "Detected .NET Reactor 6.x"
# Detect It Easy (DIE) for packer/protector identification
diec <TARGET>
# Manual signature checks
strings <TARGET> | grep -iE 'ConfuserEx|Reactor|SmartAssembly|Babel|Crypto Obfuscator|Dotfuscator|Eazfuscator|AgileDotNet'
# Check for anti-tamper / anti-debug module initializers
monodis --method <TARGET> | grep -i "cctor\|InitializeComponent\|Module"
# Entropy per section — high entropy in .text = packed/encrypted
python3 << 'EOF'
import pefile, math
pe = pefile.PE("<TARGET>")
for s in pe.sections:
data = s.get_data()
if len(data) == 0: continue
counts = [data.count(bytes([b])) for b in range(256)]
total = len(data)
ent = -sum((c/total)*math.log2(c/total) for c in counts if c)
name = s.Name.decode().rstrip('\x00')
print(f" {name:10s} entropy={ent:.2f} {'PACKED' if ent > 7.2 else 'normal'}")
EOF
3. De-obfuscate
Strip protections layer by layer.
# de4dot — handles ConfuserEx, .NET Reactor, SmartAssembly, Babel, etc.
de4dot <TARGET> -o <TARGET>.cleaned.exe
# If de4dot detects "Unknown obfuscator", try force mode:
de4dot <TARGET> --strtyp delegate --strtok 0x06000042 -o <TARGET>.cleaned.exe
# For ConfuserEx specifically:
# 1. Remove anti-tamper first (patches module cctor)
de4dot <TARGET> --un-name "!^<Module>$&!^<" -o step1.exe
# 2. Then full clean
de4dot step1.exe -o <TARGET>.cleaned.exe
# For .NET Reactor:
# Use .NET Reactor Slayer or NETReactorSlayer
NETReactorSlayer.CLI <TARGET>
# Verify result decompiles cleanly
ilspycmd <TARGET>.cleaned.exe | head -50
4. Decompile and Analyze
Full source recovery from cleaned assembly.
# ILSpy command-line — full project decompilation
ilspycmd -p -o ./decompiled/ <TARGET>.cleaned.exe
# Search decompiled source for key behaviors
grep -rn "WebClient\|HttpClient\|WebRequest" ./decompiled/
grep -rn "Registry\|RegistryKey\|SetValue" ./decompiled/
grep -rn "Process\.Start\|ProcessStartInfo" ./decompiled/
grep -rn "Assembly\.Load\|Activator\.CreateInstance" ./decompiled/
grep -rn "FromBase64String\|Convert\.FromBase64" ./decompiled/
grep -rn "R
자주 묻는 질문
.NET이란 무엇인가요?
Microsoft의 소프트웨어 프레임워크이며, 많은 Windows 프로그램이 이것으로 만들어집니다.
난독화된 코드도 다루나요?
네. 흔한 난독화 도구가 추가한 보호를 읽기 전에 제거하는 방법을 설명합니다.
누가 쓰나요?
.NET 샘플을 연구하는 악성코드 분석가와 보안 팀입니다.
상세 정보
작성자의 원본 설명
.NET malware analysis — dnSpy/ILSpy decompilation, de-obfuscation (ConfuserEx, .NET Reactor, Babel, Crypto Obfuscator), behavioral analysis of managed assemblies, PowerShell cradle extraction, and config decryption for common .NET RAT families.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14164
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.