rhaist/marq / skills/malware/malware-scripts
malware-scripts
FlaggedGuides statically triaging and deobfuscating script-based lures (LNK, HTA, JS/JScript, VBS/VBE, PowerShell, batch, HTML smuggling, ClickFix-style paste-and-run pages) to recover the next-stage command and IOCs without ever executing them. Use when the user has a suspicious script, shortcut or HTML attachment, an obfuscated PowerShell one-liner, or a fake CAPTCHA page that asks to paste a command.
Script & lure analysis (static)
Never execute. Don't run the sample, and don't run its decoder either, not even with
eval swapped for a print: that is still running attacker code. marq ships no
pwsh/node/wscript, which is correct. Recover each layer by re-implementing the
decode step yourself. Stage under /work/<case>/; keep your own decode scripts in a
different dir and run them with python3 -I. Malicious .doc(m)/.xls(m)/OneNote →
load_skill malware-maldoc; a PE/ELF that falls out → load_skill malware-triage.
Identify & unpack the container
- Hash first (
sha256sum) and check reputation (load_skill indicator-enrichment). - Type by content, not extension:
exif_metadatareports File Type / MIME Type.read_filewith a smallmax_bytesshows the head of a text script. - ZIP:
unzip -l, thenunzip -d /work/<case>/x(unpacking runs nothing). ISO/IMG/VHD(X)/7z/RAR: unpack with 7-Zip and stage the contents.
Per lure type
- LNK:
exif_metadatagives the target path, command-line arguments, working dir, icon file (a PDF icon on a.lnk= lure) and Machine ID (the builder's hostname, a pivot). Arguments padded with whitespace to hide past the Properties box (CVE-2025-9491); Windows changed that dialog in 2025, but it's a UI-only fix. Read the raw args, not the GUI. verify: https://0patch.com/blog/microsoft-silently-patched-cve-2025-9491-we-think-our-patch-provides-more-securit Payloads appended after the LNK structure:rabin2 -zz(raw + UTF-16 strings). - HTA: HTML run by
mshta.exeat full trust, outside the browser sandbox.read_file; look for<script language="VBScript">,CreateObject("WScript.Shell"),.Run,window.close. - JS/JScript (WSH): a double-clicked
.jsruns inwscript.exe, not a browser. Sinks and primitives:ActiveXObject,WScript.Shell,MSXML2.XMLHTTP,ADODB.Stream(SaveToFile),eval/Function(). Obfuscation: a string array + rotate/index function (obfuscator.io style),fromCharCode, reversed strings, megabytes of junk padding. Lift the array and decoder logic into python3. Emulation (box-js) belongs off-box, in a sandbox. - VBS/VBE:
olevba(oletools) reads plain VBScript text too (auto-exec, suspicious keywords,--deobf)..vbe(#@~^header) is Script-Encoder output: decode off-box (Didier Stevens'decode-vbe.py) or re-implement it. VBScript is still on by default in Windows 11; it's planned to stop being on by default around 2027. verify: https://techcommunity.microsoft.com/blog/windows-itpro-blog/vbscript-deprecation-timelines-and-next-steps/4148301 - PowerShell:
-e/-enc/-EncodedCommandis base64 of UTF-16LE:base64 -d | iconv -f UTF-16LE -t UTF-8. Next layers:FromBase64String+GzipStream/DeflateStream(python3gzip, orzlib.decompress(d, -15)for raw deflate),-bxorkeys,[char]arrays +-join,-fformat reordering, backticks. Sinks:IEX,Invoke-Expression,&(...),.Invoke(). Strip the sink and decode its argument.AmsiUtils/amsiInitFailed= AMSI bypass. - Batch (.bat/.cmd):
setfragments joined via%v:~x,y%substrings,^carets, undefined%junk%vars that expand to nothing, a UTF-16 BOM to break editors,certutil -decode, and payloads afterexit /b/goto :eofread back byfindstr/PowerShell. Resolve thesets in python3. - HTML smuggling (T1027.006): an HTML/SVG attachment builds a file in-browser (
Blob,URL.createObjectURL,a.download,msSaveOrOpenBlob) from an embedded base64/array blob, often XOR'd or reversed. Regex the blob out, decode it in python3, write it to/workas an inert file and triage that (often ZIP/ISO → LNK). Credential-phish pages: note the POST target. - ClickFix / paste-and-run (ATT&CK T1204.004, 2025): a fake CAPTCHA/"fix it" page writes a
command to the clipboard (
navigator.clipboard.writeText,execCommand('copy')) and tells the user to paste it into Win+R, Terminal (Win+X → I), the Explorer address bar ("FileFix") or macOS Terminal. Typical:mshta https://…,powershell -w h … | iex,curl … | bash, with a trailing# I'm not a robotcomment. verify: https://attack.mitre.org/techniques/T1204/004/ Get the page HTML from email/proxy logs or an existing urlscan scan. Don't browse it from an engagement box. If the command is only fetched at runtime (remote API, blockchain contract), you needload_skill malware-dynamic. IR artefact: pasted Run-dialog commands land inHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU. macOS 26.4+ warns on suspicious Terminal pastes. verify: https://support.apple.com/en-us/127377
Deobfuscation discipline
- One layer at a time; save each as
layerN.txtand hash the final payload. - The goal is the next-stage URL/command and dropped filename, not a pretty script.
- Never fetch the stage-2 from marq: enrich the URL (
load_skill indicator-enrichment) or send it to a sandbox. Stuck (environment-keyed decryption, runtime fetch, a decoder too complex to port)? →load_skill malware-dynamic.
Detect & report
- YARA for lures: text strings with
nocase,widefor UTF-16 (LNK args); anchor on the obfuscator's unique function/variable names plus a sink. Test withyara; method inload_skill malware-yara. report_finding: evidence = delivery chain (container → LNK →mshtaURL → stage-2), the defanged deobfuscated command, IOCs, ATT&CK (T1204.002/.004, T1027.006, T1059.001/.003/.005/.007, T1218.005 Mshta). Pivot IOCs viaload_skill ioc-pivoting.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |