deobfuscating-malicious-javascript

A static-analysis skill for turning obfuscated malicious JavaScript into a more understandable form. Obfuscation is code written to hide its real actions, such as URLs or commands.

In plain words
What is it for?
It helps analyze phishing pages, HTA files, script droppers, and scriptlets by decoding strings, unpacking common wrappers, and recovering payloads and URLs.
Why use it?
It reveals hidden behavior without running untrusted JavaScript in a normal browser or Node.js process.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/meltedinhex/analyst-ai-pack/deobfuscating-malicious-javascript
Any agent
npx skills add meltedinhex/analyst-ai-pack --skill deobfuscating-malicious-javascript
Clone the repo
git clone --depth 1 https://github.com/meltedinhex/analyst-ai-pack

Made for: Claude Code, Codex.

Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 813 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00084 $0.00813
Opus 5 $0.00042 $0.00407
Sonnet 5 $0.00017 $0.00163
Haiku 4.5 $0.00008 $0.00081

Measured 3d ago against content hash a9166b67d253, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

deobfuscating-malicious-javascript scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/analyst.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/deobfuscating-malicious-javascript/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deobfuscating Malicious JavaScript

When to Use

  • You have obfuscated JS (from a phishing page, HTA, .js dropper, or scriptlet) and need its real behavior.
  • You must recover hidden URLs, dropped commands, or a next-stage payload.
  • You want to statically unroll common obfuscation rather than run untrusted code.

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

  • A safe analysis approach: static decoding, or a JS malware sandbox (box-js) in the lab.
  • Familiarity with common obfuscation: string arrays, String.fromCharCode, hex/unicode escapes, eval/Function chains, packers.

Safety & Handling

  • Treat the script as live code; never execute it outside an isolated sandbox.
  • Defang recovered URLs and store dropped payloads password-protected.

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

  • Static encodings (hex/unicode/base64) are fully decoded.
  • String-array/charcode constructions are unrolled to readable strings.
  • eval/Function layers are captured as data and recursed, with no untrusted execution.

Pitfalls

  • Running the script to "see what it does" and infecting the analysis host.
  • Stopping at one layer when the dropper nests several.
  • Missing environment-keyed branches (only acts on certain dates/locales) during static review.

Read the full file on GitHub · 95 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 95 lines · 84 tokens per session scan A a9166b67d253

Subscribe to this mod's changes

deobfuscating-malicious-javascript is a skill published in the GitHub repository meltedinhex/analyst-ai-pack (22 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 84 tokens to every session and 813 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware in Ghidra by parsing Go buildinfo and pclntab structures, recovering stripped/obfuscated function names (e.g. via GoResolver), and extracting embedded module/dependency strings and types from Go binaries. Use when analyzing a Go-language malware sample, deobfuscating a…

mukul975/Anthropic-Cybersecurity-Skills · 95 tokens

analyzing-malicious-pdf-with-peepdf

Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects. Use when triaging a suspicious PDF attachment from a phishing email, analyzing a PDF-based exploit document, or building detection signatures for weaponized PDF…

mukul975/Anthropic-Cybersecurity-Skills · 73 tokens

analyzing-malicious-pdf-with-peepdf

使用 peepdf、pdfid 和 pdf-parser 对恶意 PDF 文档进行静态分析, 提取嵌入的 JavaScript、shellcode 和可疑对象。.

killvxk/cybersecurity-skills-zh · 50 tokens

analyzing-malicious-pdf-with-peepdf

Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects.

26zl/cybersec-toolkit · 43 tokens

analyzing-malicious-pdf-with-peepdf

Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects.

autohandai/community-skills · 43 tokens

analyzing-malicious-pdf-with-peepdf

Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects.

Mikaru0Mystic/sectinel · 43 tokens