/secskills-defense:analyzing-malwarefrom secskills-defense
Safely analyze suspected malware through containment, static triage, sandboxed detonation, unpacking, capability/C2 extraction, IOC production, and YARA rule authoring.
Ships in secskills-defense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The analysis is the easy part. The part that goes wrong is containment: a sample detonated on a machine that can reach production, or an IOC published that burns an active investigation. Get the environment right first.
analyzing-binariesanalyzing-shellcodeanalyzing-network-traffichunting-web-backdoorswriting-yara-rulesresponding-to-incidentsengineering-detectionsproducing-threat-intelligence| Control | Requirement |
|---|---|
| Host | Disposable VM or dedicated bare-metal, snapshot taken before execution |
| Network | Isolated segment; simulated services (INetSim/FakeNet-NG) by default |
| Shares | No host folder sharing, no clipboard sharing, no mounted host drives |
| Credentials | No real accounts, no domain join, no password manager |
| Handling | Sample stored in a password-protected archive, extension neutered (.bin, .mal) |
| Egress | Real internet only with an explicit decision and a plan for attribution leakage |
Live C2 contact tells the operator you are looking. On an active incident, do not resolve the C2 domain, submit the hash publicly, or upload the sample to a multi-scanner service until the incident lead approves it — public submission is a disclosure.
# Identity, always first
sha256sum sample && file sample && du -h sample
# Fuzzy and import hashes for clustering against known families
ssdeep sample; tlsh sample # Debian tlsh-tools ships /usr/bin/tlsh;
# built from upstream it is tlsh_unittest
python3 -c "import pefile;print(pefile.PE('sample').get_imphash())"
# Structure
pecheck sample # or: rabin2 -I / readelf -h
capa -v sample # capability detection mapped to ATT&CK — start here
floss sample # deobfuscated + stack strings, better than `strings`
# Packing and embedded content
binwalk -E sample # entropy
binwalk -Me sample # extract embedded objects
capa is the highest-value single command in this workflow: it turns a binary
into a list of behaviours mapped to MITRE ATT&CK and MBC, which tells you
whether deeper analysis is warranted at all.
Document-borne and script-borne samples:
oleid doc.xls && olevba --deobf doc.xls # OLE macros
oledump.py doc.doc # stream-level inspection
msodde doc.docx # DDE payloads
rtfobj doc.rtf # embedded objects in RTF
pdfid file.pdf && pdf-parser -a file.pdf # /JS /OpenAction /Launch
# Obfuscated scripts: normalize before reading
box-js payload.js
# PowerShell: decode -EncodedCommand, then unwrap the layers
echo '<base64>' | base64 -d | iconv -f UTF-16LE -t UTF-8
Most script malware is three layers of encoding around ten lines of logic. Deobfuscate mechanically rather than reading the obfuscated form.
Snapshot, detonate, observe, revert. Never analyze twice from a dirty state.
Baseline snapshot
→ start Procmon / Sysmon / inotify + tcpdump + INetSim
→ detonate with the right launcher (rundll32, wscript, mshta, Office)
→ observe 3-5 minutes, then interact (click, wait past sleep timers)
→ collect artifacts and memory
→ revert
What to collect and what each answers:
| Artifact | Tool | Answers |
|---|---|---|
| Process tree | Sysmon E1, Procmon, execsnoop | Injection, LOLBin abuse, child spawns |
| File and registry writes | Procmon, inotifywait | Drops, persistence, config |
| Network | tcpdump, Wireshark, INetSim logs, mitmproxy | C2 endpoints, beacon interval, protocol |
| Memory | DumpIt / procdump, then Volatility | Unpacked payload, injected code, keys |
| Persistence | Autoruns, systemctl list-units, cron, LaunchAgents | Survival mechanism |
Recover the unpacked payload from memory rather than fighting the packer:
# After the sample unpacks itself, dump and carve
vol -f mem.raw windows.malfind # injected/RWX regions
vol -f mem.raw windows.dumpfiles --pid <pid>
Watch for sleep and evasion gates: many samples idle for minutes, check for
a domain-joined host, count CPU cores, or look for analysis processes. If
nothing happens, patch the check or hook Sleep/NtDelayExecution with Frida
before concluding the sample is inert.
Structure findings against ATT&CK rather than as a narrative:
For each, record the concrete evidence (address, API call, artifact) that supports the claim. A capability asserted without evidence is a guess, and guesses in a malware report drive bad response decisions.
The config is the most valuable output — it feeds blocking, hunting, and attribution.
# Known families: use the community extractors first
python3 -m maco.extract sample # MACO / CAPE / RATDecoders ecosystems
# Unknown: find the decode routine, then emulate it over the encrypted blob
Typical config contents: C2 URLs and fallbacks, campaign or botnet ID, RC4/AES key, mutex, sleep interval and jitter, install path, kill date. Extract all of them — campaign IDs and mutexes are often better hunting pivots than the C2, which rotates.
Rank indicators by how long they survive and how specific they are:
Hash → precise, dies immediately (recompile)
C2 IP/domain → useful now, rotates in days
Mutex / config → survives rotation, family-specific
Behaviour/TTP → survives redevelopment; write these
Write YARA against structure and code, not incidental strings:
rule Family_Loader_ConfigDecode
{
meta:
author = "analyst"
date = "2026-07-26"
description = "Loader config RC4 decode stub"
hash = "<sha256>"
reference = "<internal case id>"
strings:
// The decode loop's constants, not a filename it happens to drop
$decode = { 8A 04 0? 32 0? 88 0? 4? 3B ?? 72 }
$mutex = "Global\\<family-specific>" ascii
condition:
uint16(0) == 0x5A4D and filesize < 2MB and all of them
}
Validate every rule before it ships:
yara -w rule.yar ./samples/family/ # must hit all known-true samples
yara -w rule.yar ./corpus/goodware/ # must produce zero hits — this step is not optional
Hand behavioural detections to engineering-detections for Sigma/EDR
conversion and tuning.
Generated from secskills-core/ttp-index.json — edit that file, then run
python3 scripts/sync_attack.py --write. Re-verify IDs against the
current ATT&CK release before citing them in a report.
Resource Development (TA0042)
Initial Access (TA0001)
performing-social-engineering, analyzing-phishing-emailsExecution (TA0002)
escalating-windows-privilegesperforming-social-engineering, exploiting-memory-corruptionPrivilege Escalation (TA0004)
escalating-windows-privilegesDefense Evasion (TA0005)
analyzing-binaries, analyzing-shellcodeanalyzing-binariesanalyzing-binaries, analyzing-shellcodehunting-threatsanalyzing-binariesauditing-supply-chainanalyzing-shellcodeanalyzing-binariesCollection (TA0009)
Command and Control (TA0011)
engineering-detections, analyzing-network-traffictransferring-files, analyzing-network-traffichunting-threats, analyzing-network-trafficengineering-detections, analyzing-network-trafficImpact (TA0040)
responding-to-incidentsDetection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.
Fetch public advisories, specifications, and vendor reports as Markdown:
curl -sL "https://defuddle.md/<url>" # scheme in the path is optional
This strips page boilerplate — roughly 78% fewer tokens on a prose page — and returns the full text rather than a summary, so you can grep it and trust a negative result.
Three things it is not for. Fetch JSON and API responses raw, because readability extraction mangles structured data. Fetch authenticated or JavaScript-rendered pages directly, because it retrieves them anonymously. And never route adversary infrastructure (phishing links, C2, malware hosting), client-owned hosts, or engagement URLs through it — the request leaves your machine to a third party, and for live adversary infrastructure it also tips off the operator.
Some sites block the extractor and return an error blob rather than the page —
{"error":"Failed to fetch: 418 I'm a teapot"} from freedesktop.org, for
instance. That is the fetch being refused, not the source saying the thing
does not exist. Re-fetch the URL directly before drawing any conclusion from
it.
analyzing-binaries — disassembly, unpacking, and anti-analysis detailresponding-to-incidents — scoping and eradication around the sampleengineering-detections — turning capability into deployed rulescapa, floss, oletools, Volatility 3, YARA as the core toolchainWhat SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/analyzing-disk-imagesPerform dead-disk forensics on an acquired disk image using The Sleuth Kit, Plaso, and bulk_extractor — verify integrity and mount read-only, map partitions, recover deleted files, build a file-system and super-timeline, carve unallocated space, mine registry hives and OS artifacts, and detect anti-forensics. Use when handed a .E01/.dd/.raw/.vmdk/.vhdx disk image or forensic acquisition to examine, recovering deleted files, building a file-system timeline, or carving artifacts from unallocated space./analyzing-linux-persistenceSystematically identify and analyze persistence mechanisms on Linux systems during DFIR investigations -- sweep systemd units, cron jobs, shell initialization, SSH config, kernel modules, LD_PRELOAD, package manager hooks, udev rules, container entrypoints, and XDG autostart entries. Use when investigating a compromised Linux host, performing forensic analysis of a Linux disk image, looking for backdoors or unauthorized access mechanisms, or determining how an attacker maintained access./analyzing-memory-imagesAnalyze volatile memory images (RAM dumps) using Volatility 3 — process enumeration, injected code detection, credential extraction, network artifacts, rootkit analysis, and timeline construction from memory-resident data. Use when examining a memory capture from a compromised host, hunting for injected code or hollowed processes, extracting credentials or network state from RAM, or detecting kernel-level rootkits./analyzing-network-trafficAnalyze packet captures and network telemetry for intrusion evidence — capture and handling, the Wireshark/tshark triage funnel, Zeek log mining, Suricata rule runs, beacon and DNS-tunnel detection, TLS/JA3 fingerprinting, HTTP and file carving, exfiltration hunting, and IOC handoff. Use when a `.pcap` or `.pcapng` capture lands on your desk, when a suspected C2 beacon needs confirming, when there is data exfiltration to investigate, when malware network behaviour must be characterized from what it emitted, when a Zeek or Suricata alert needs running down, or when DNS tunneling or unusual TLS is suspected./analyzing-phishing-emailsTriage and forensically analyze reported phishing safely — extract the raw message, read the Received chain, verify SPF/DKIM/DMARC, detect display-name and lookalike spoofing, unwrap redirects and SafeLinks/URLDefense, decode quishing QR codes, triage attachments, and pull IOCs for hunting. Use when handed a reported phishing email, a suspicious .eml or .msg file, a set of email headers to analyze, a malicious attachment or link to triage, or a business email compromise or spoofing case./analyzing-shellcodeAnalyze raw shellcode and position-independent code — extracting the bytes, guessing architecture, disassembling at the right base, decoding self-decoder stubs, resolving hashed Windows APIs, emulating to the decoded stage, and pulling C2 and stage IOCs. Use when handed a raw blob of position-independent code, an extracted payload with no PE/ELF header, shellcode lifted from an exploit or a macro/loader, a `\x`-escaped or base64 buffer, a suspected Cobalt Strike or Metasploit stager, or an egg-hunter.npx claudepluginhub trilwu/secskills --plugin secskills-defense2 plugins ship this exact skill · first indexed Aug 29, 2026
Other plugins' skills for the same job