A base64-wrapped, string-concatenated PowerShell blob pulled from an alert is unreadable by design — the attacker obfuscated it precisely so you would not understand it quickly. LLMs are genuinely good at unwinding obfuscation and explaining what a script does, which turns a twenty-minute manual decode into a two-minute read.
Tier: Core · Workflow area: Incident response, DFIR & CTI
This playbook does that safely: static analysis and explanation only, never execution, with every claimed behavior verified against the actual code.
This is static analysis of a captured sample only. Never use AI (or anything else) to run the sample outside a proper isolated sandbox — and never point offensive tooling at systems you do not own.
Handle the sample as inert evidence. Keep the script in a text file inside your analysis environment. You are reading it, not executing it. Treat it like a hazardous artifact — no double-clicks, no "just to see."
Ask for layer-by-layer deobfuscation with explanation.
This is a captured suspicious script (sample, for DEFENSIVE static analysis
only — do not execute anything, do not help me run it). Deobfuscate it:
- Decode each obfuscation layer (base64, concatenation, char codes) and show
the deobfuscated result at each layer.
- Explain what the final script does, line by line.
- List every observable it would produce: network destinations, files
written, registry keys, processes spawned, persistence.
- Map the behaviors to MITRE ATT&CK techniques where clear.
Quote the exact code line behind each claimed behavior. If a section is
ambiguous, say so — do not guess at intent.
<<<SCRIPT>>>
Expected output: the decoded script at each layer, a line-by-line explanation, an observables list (IOCs/behaviors), and ATT&CK mappings — each behavior tied to the code line that produces it.
Verify the decode independently. Decode at least the outer layer yourself (base64 -d, a CyberChef recipe) and confirm it matches the model's claimed layer-1 output. If the model's decode diverges from a deterministic tool, trust the tool.
Confirm each claimed behavior against the code. For every "downloads from evil.example" or "writes to Startup," find the exact line that does it. A behavior with no corresponding line is the model inferring intent — flag it, do not report it as fact.
Extract observables into your IOC workflow. The network destinations, file paths, and hashes become detection and blocking inputs — after you have confirmed each against the code (hand off to pb-12 for STIX).
"Deobfuscate and explain" is defensive; "run this and tell me what happens" is not. Keep the model on static analysis of a captured sample — never let it help execute untrusted code, and never aim any tooling at a system the learner does not own.
A captured malicious sample from a client's environment may embed client identifiers (internal URLs, usernames, paths) in the payload, so analyze it inside the client boundary. Use a local Ollama model in an isolated environment; do not paste the sample into a public AI tool, both for confidentiality and because the sample is hostile code. Where feasible, redact embedded client-specific strings before prompting, keeping the structural code intact so the deobfuscation logic still works. Confirmed observables and the behavior explanation go into the client's case system and IOC feeds; the sample itself stays contained, and any decision to detonate it dynamically happens only in the client's sanctioned malware sandbox.