Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Static and dynamic malware analysis, YARA rule generation, sandbox configuration, behavioral profiling, and malware family classification
.claude/skills/masriyan-malware-analysis-sandboxing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 164% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 889% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 1039% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 245% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 90% | 0% |
Enable Claude to assist with malware analysis workflows including static analysis of file properties and code, dynamic behavioral analysis interpretation, YARA rule generation, sandbox configuration, and malware family identification. Claude analyzes provided artifacts directly and orchestrates scripts for automated processing.
> Safety Warning: Never execute suspicious files outside of isolated, controlled environments. Use dedicated VMs or sandboxes with network isolation and snapshot capability.
This skill activates when the user asks about:
bashpip install yara-python pefile python-magic requests ssdeep
Recommended analysis tools:
Cuckoo Sandbox / CAPE — Automated dynamic analysisVirusTotal API — Multi-engine scanning and intelYARA — Pattern matching engineGhidra / IDA Pro — Deep binary analysis (→ Skill 04)Volatility 3 — Memory forensicsDIE (Detect-It-Easy) — Packer/compiler detectionPestudio — Windows PE static analysisWhen the user provides a suspicious file or hash for analysis:
Claude performs analysis in this order:
Step 1 — File Identification:
bashfile malware.exe # File type from magic bytes md5sum malware.exe # MD5 hash (legacy, for lookups) sha256sum malware.exe # SHA-256 (primary identifier) python scripts/static_analyzer.py --file malware.exe --hashes
Step 2 — Threat Intelligence Lookup:
bash# VirusTotal hash lookup via API curl "https://www.virustotal.com/api/v3/files/<sha256>" -H "x-apikey: YOUR_KEY"
Step 3 — PE Analysis (Windows executables):
bashpython scripts/static_analyzer.py --file malware.exe --strings --imports --output report.json
Look for these indicators in the output:
Suspicious Import Functions: | Category | Suspicious APIs | |----------|----------------| | Process Injection | CreateRemoteThread, WriteProcessMemory, VirtualAllocEx, NtMapViewOfSection, RtlCreateUserThread | | Persistence | RegSetValueEx, CreateService, SHFileOperation, ITaskScheduler | | Anti-Analysis | IsDebuggerPresent, CheckRemoteDebuggerPresent, GetTickCount, QueryPerformanceCounter, GetSystemInfo | | Network C2 | InternetOpenUrl, HttpSendRequest, WSAStartup, socket, URLDownloadToFile, WinHttpOpen | | Crypto Operations | CryptEncrypt, CryptDecrypt, BCryptEncrypt, CryptHashData | | Credential Access | SamOpenDatabase, LsaOpenPolicy, NtlmGetUserInfo | | Keylogging | SetWindowsHookEx, GetAsyncKeyState, GetKeyboardState | | Defense Evasion | VirtualProtect, NtSetInformationProcess, Wow64DisableWow64FsRedirection |
Step 4 — String Extraction & Analysis:
bashstrings -a malware.exe | grep -E "(http|ftp|/[a-z]|[0-9]{1,3}\.[0-9]{1,3}|HKEY|reg|cmd|powershell)"
Categorize extracted strings:
Step 5 — Entropy Analysis:
bashpython scripts/static_analyzer.py --file malware.exe --entropy
| Entropy Range | Interpretation | |---------------|---------------| | 0.0 – 1.0 | Near-empty or all-zeros section | | 1.0 – 5.0 | Normal code/data section | | 5.0 – 7.0 | Compressed data or code | | 7.0 – 8.0 | Encrypted or packed data — investigate | | 7.9 – 8.0 | Highly suspicious — likely encrypted payload |
When the user asks to create YARA rules from a sample or indicators:
Claude generates YARA rules following this methodology:
YARA Rule Templates:
yara// Tier 1: Specific sample (hash-based) rule MalwareFamily_Variant_Hash { meta: author = "Analyst Name" date = "2025-05-28" description = "Detects [MalwareFamily] [Variant] — specific sample" sha256 = "aabbcc..." tlp = "GREEN" reference = "https://example.com/analysis" condition: hash.sha256(0, filesize) == "aabbcc..." } // Tier 2: Family-level detection (behavioral strings) rule MalwareFamily_Generic { meta: author = "Analyst Name" date = "2025-05-28" description = "Detects [MalwareFamily] family by strings and structure" tlp = "GREEN" strings: // C2 patterns $c2_ua = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" ascii $c2_uri = "/gate.php?id=" ascii // Crypto constants $rc4_key = { 52 43 34 5F 4B 45 59 } // "RC4_KEY" hex // Mutex $mutex = "Global\\MSDTC_MUTEX_" ascii wide // Registry persistence key $reg_key = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" ascii wide nocase // Anti-analysis check $vm_check = "VBOX" ascii wide nocase condition: uint16(0) == 0x5A4D and // MZ header (PE file) filesize < 2MB and ( (2 of ($c2_*)) or ($mutex and 1 of ($reg_key, $rc4_key)) ) and not $vm_check // Exclude sandbox-aware variants } // Tier 3: Network IOC detection (for NIDS integration) rule MalwareFamily_Network_C2 { meta: description = "Detects [MalwareFamily] C2 communication patterns" type = "network" strings: $beacon_path = "/api/v1/ping?uid=" ascii $beacon_ua = "MalBot/1.0" ascii $checkin_hdr = "X-Command-Key: " ascii condition: any of them }
bash# Generate YARA rules using the script python scripts/yara_generator.py --samples ./malware_samples/ --output rules.yar python scripts/yara_generator.py --file single_sample.exe --rule-name "MalwareFamily" --output rule.yar # Test rules against benign files yara -r generated_rule.yar /usr/bin/ 2>/dev/null | wc -l # Should be 0 yara generated_rule.yar malware.exe # Should match
When the user provides sandbox analysis output or asks about dynamic analysis:
Interpreting Cuckoo/CAPE Sandbox Reports:
Claude analyzes behavioral reports looking for:
vssadmin delete shadows → ransomware indicator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunHKLM\SYSTEM\CurrentControlSet\Services\| Observed Behavior | MITRE Technique | |-------------------|----------------| | PowerShell download cradle | T1059.001 — PowerShell | | cmd /c vssadmin delete shadows | T1490 — Inhibit System Recovery | | Registry Run key persistence | T1547.001 — Registry Run Keys | | CreateRemoteThread injection | T1055.001 — DLL Injection | | Scheduled task creation | T1053.005 — Scheduled Task | | netsh advfirewall set allprofiles state off | T1562.004 — Disable Host Firewall | | UAC bypass (fodhelper.exe) | T1548.002 — Bypass UAC | | LSASS memory access | T1003.001 — LSASS Memory |
When the user asks to identify or classify a malware sample:
Classification by behavioral patterns:
| Family Indicators | Likely Family Category | |------------------|----------------------| | Shadow copies deleted + file encryption + ransom note | Ransomware | | Regular HTTP beaconing + command execution + lateral movement | RAT/Botnet | | Browser credential theft + banking overlay | Banking Trojan | | Keylogging + screenshot capture + data exfiltration | Spyware/Infostealer | | Process hollowing + covert persistence | Rootkit/Backdoor | | Cryptocurrency mining process spawning | Cryptominer | | Worm propagation via network shares | Worm | | Document with macro downloading payload | Dropper/Downloader |
Similarity analysis:
bash# SSDeep fuzzy hash comparison ssdeep -l malware.exe > hash.txt ssdeep -m hash.txt similar_sample.exe # Similarity > 70% → likely same family/variant
When the user asks to set up a malware analysis environment:
Minimum isolation requirements:
Recommended sandbox stack:
Analysis VM (Windows 10/11 or Ubuntu):
├── FakeNet-NG or INetSim — Simulate network services
├── Wireshark — Capture network traffic
├── ProcessMonitor (Windows) / strace (Linux) — Monitor syscalls
├── Regshot (Windows) — Compare registry before/after
├── Autoruns (Windows) — Monitor persistence locations
└── Cuckoo/CAPE Agent — Automated collection
Network Layer:
└── Host-only adapter → no real internet → INetSim captures C2 attemptsAnti-anti-VM measures:
For every analyzed sample, produce:
markdown## Malware Analysis Report — [Sample Name] **Hashes:** - MD5: [hash] - SHA1: [hash] - SHA256: [hash] - SSDeep: [fuzzy hash] **Classification:** [Ransomware / RAT / Infostealer / etc.] **Confidence:** [High / Medium / Low] **Family:** [Family Name, if identified] **First Seen:** [Date from TI sources] **Network IOCs:** - IPs: [list] - Domains: [list] - URLs: [list] - User-Agent: [string] **Host IOCs:** - File Paths: [list] - Registry Keys: [list] - Mutex Names: [list] - Services: [list] **MITRE ATT&CK Mapping:** - [Tactic]: [Technique ID] — [Technique Name] **YARA Rules:** [Attached] **Sigma Rules:** [Attached, for Skill 12]
static_analyzer.pybashpython scripts/static_analyzer.py --file malware.exe --output report.json python scripts/static_analyzer.py --file sample.dll --hashes --strings --imports --entropy
yara_generator.pybashpython scripts/yara_generator.py --samples ./malware_samples/ --output rules.yar python scripts/yara_generator.py --file single_sample.exe --rule-name "MyMalware" --output rule.yar
| Condition | Adjacent Skill | |-----------|---------------| | Needs deeper disassembly | → Skill 04 (Reverse Engineering) | | IOCs ready for environment-wide hunting | → Skill 06 (Threat Hunting) | | Malware collected during IR | ← Skill 07 (Incident Response) | | Create detection signatures | → Skill 15 (Blue Team Defense) |
Aligned to the current threat landscape:
rundll32, mshta, regsvr32, msbuild) and PowerShell/.NET reflective loads.Safety rule: detonate only in an isolated, snapshot-restored VM with no production network reachability; document the sandbox config in the report.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 19,400 | 29,660 | +53% | 1 | 1 | 0% | 3,388 | 7,812 | +131% | 0 | 0 | — |
case-02 | fail→fail | 16,017 | 10,660 | -33% | 1 | 1 | 0% | 2,833 | 5,754 | +103% | 0 | 0 | — |
case-03 | fail→pass | 14,733 | 14,055 | -5% | 1 | 1 | 0% | 2,397 | 6,326 | +164% | 0 | 0 | — |
case-04 | pass→pass | 9,779 | 10,342 | +6% | 1 | 1 | 0% | 1,611 | 5,619 | +249% | 0 | 0 | — |
case-05 | pass→pass | 5,279 | 8,631 | +63% | 1 | 1 | 0% | 925 | 5,488 | +493% | 0 | 0 | — |
case-06 | pass→pass | 5,756 | 5,568 | -3% | 1 | 1 | 0% | 1,017 | 4,813 | +373% | 0 | 0 | — |
case-07 | pass→pass | 6,146 | 6,231 | +1% | 1 | 1 | 0% | 1,130 | 4,963 | +339% | 0 | 0 | — |
case-08 | pass→pass | 4,382 | 6,852 | +56% | 1 | 1 | 0% | 701 | 4,572 | +552% | 0 | 0 | — |
case-09 | pass→pass | 14,035 | 15,483 | +10% | 1 | 1 | 0% | 2,142 | 6,460 | +202% | 0 | 0 | — |
case-10 | pass→pass | 3,699 | 5,496 | +49% | 1 | 1 | 0% | 601 | 4,801 | +699% | 0 | 0 | — |
case-11 | pass→pass | 5,679 | 5,885 | +4% | 1 | 1 | 0% | 982 | 4,847 | +394% | 0 | 0 | — |
case-12 | fail→pass | 40,981 | 13,069 | -68% | 1 | 1 | 0% | 622 | 6,149 | +889% | 0 | 0 | — |
case-13 | pass→pass | 14,731 | 18,731 | +27% | 1 | 1 | 0% | 2,270 | 6,924 | +205% | 0 | 0 | — |
case-14 | pass→pass | 9,064 | 10,409 | +15% | 1 | 1 | 0% | 1,405 | 5,360 | +281% | 0 | 0 | — |
case-15 | fail→pass | 3,088 | 6,741 | +118% | 1 | 1 | 0% | 439 | 4,999 | +1039% | 0 | 0 | — |
case-16 | pass→pass | 16,826 | 13,728 | -18% | 1 | 1 | 0% | 2,936 | 6,340 | +116% | 0 | 0 | — |
case-17 | pass→pass | 9,419 | 8,927 | -5% | 1 | 1 | 0% | 1,389 | 5,335 | +284% | 0 | 0 | — |
case-18 | pass→pass | 4,241 | 8,458 | +99% | 1 | 1 | 0% | 659 | 5,212 | +691% | 0 | 0 | — |
case-19 | fail→pass | 9,571 | 6,696 | -30% | 1 | 1 | 0% | 1,439 | 4,970 | +245% | 0 | 0 | — |
case-20 | pass→fail | 16,858 | 21,408 | +27% | 1 | 1 | 0% | 3,381 | 6,426 | +90% | 0 | 0 | — |
case-21 | fail→fail | 15,263 | 25,144 | +65% | 1 | 1 | 0% | 2,714 | 8,517 | +214% | 0 | 0 | — |
case-22 | pass→pass | 15,242 | 14,129 | -7% | 1 | 1 | 0% | 2,464 | 6,266 | +154% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +14 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.