Deobfuscating malicious javascript

From meltedinhex/analyst-ai-pack · View interactive version

Deobfuscating malicious javascript is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. Deobfuscates malicious JavaScript from droppers, web pages, and HTA/scriptlets: unrolling string-array and char-code encodings, resolving eval/Function chains, and statically recovering payloads and URLs without executing untrusted code. Activates for requests to deobfuscate JavaScript, decode obfus

How to use this skill

Skill file

Deobfuscating Malicious JavaScript

When to Use

behavior.

Do not use a real browser or node to execute the script for analysis — that runs the

malware. Use a sandboxed interpreter (box-js) or static transformation only.

Prerequisites

eval/Function chains, packers.

Safety & Handling

Workflow

Step 1: Normalize and de-pack

Pretty-print the source and identify the obfuscation style (array-shuffle, eval-packer, charcode).

Decode static encodings first: hex/unicode escapes and base64 literals.

python scripts/analyst.py decode dropper.js

Step 2: Unroll string arrays and char-code builds

Reconstruct strings built from arrays/fromCharCode/concatenation to reveal API names, URLs, and

commands.

Step 3: Resolve eval/Function indirection — safely

Replace eval/new Function with logging (or a sandbox) so the constructed code is captured as

data, not executed, then recurse on the recovered layer.

Step 4: Extract behavior and IOCs

Identify the dropper actions (WScript.Shell, ActiveX, fetch/XHR), recover URLs and dropped paths,

defang, and route payloads onward.

Validation

Pitfalls

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.