meltedinhex/analyst-ai-pack / skills/deobfuscating-malicious-javascript
deobfuscating-malicious-javascript
UnverifiedDeobfuscates 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 obfuscated JS, or analyze a malicious script dropper.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 3.2 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 2.8 KB |
references/api-reference.md
View on GitHub# API Reference: Deobfuscating Malicious JavaScript
## Overview
`scripts/analyst.py` statically decodes common JS obfuscation: `\xHH`/`\uHHHH` escapes,
`String.fromCharCode(...)` sequences, and standalone base64 string literals, then extracts and
defangs URLs. It executes nothing; dynamic `eval`/`Function` layers require a sandbox (box-js).
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | base64, regex, JSON, file IO |
## External tools
| Tool | Purpose |
|------|---------|
| box-js | Sandboxed execution of `eval`/`Function` layers without real browser/WScript |
## Core functions
### `decode(source)`
Applies escape, fromCharCode, and base64 decoding; returns a preview, decoded base64, and defanged
URLs.
### `_decode_escapes` / `_decode_fromcharcode` / `_decode_b64_literals`
The individual static-decoding passes.
## Usage
```bash
python scripts/analyst.py decode dropper.js
```
## Sources
- ECMAScript language specification — https://tc39.es/ecma262/
- box-js malicious JavaScript sandbox — https://github.com/CapacitorSet/box-js
- Common JS obfuscation families (string arrays, fromCharCode, eval-packers), established practice
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |