Skip to content

rhaist/marq / skills/malware/malware-scripts

malware-scripts

Flagged

Guides 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_metadata reports File Type / MIME Type. read_file with a small max_bytes shows the head of a text script.
  • ZIP: unzip -l, then unzip -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_metadata gives 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.exe at 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 .js runs in wscript.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/-EncodedCommand is base64 of UTF-16LE: base64 -d | iconv -f UTF-16LE -t UTF-8. Next layers: FromBase64String + GzipStream/DeflateStream (python3 gzip, or zlib.decompress(d, -15) for raw deflate), -bxor keys, [char] arrays + -join, -f format reordering, backticks. Sinks: IEX, Invoke-Expression, &(...), .Invoke(). Strip the sink and decode its argument. AmsiUtils/amsiInitFailed = AMSI bypass.
  • Batch (.bat/.cmd): set fragments 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 after exit /b/goto :eof read back by findstr/PowerShell. Resolve the sets 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 /work as 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 robot comment. 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 need load_skill malware-dynamic. IR artefact: pasted Run-dialog commands land in HKCU\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.txt and 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, wide for UTF-16 (LNK args); anchor on the obfuscator's unique function/variable names plus a sink. Test with yara; method in load_skill malware-yara.
  • report_finding: evidence = delivery chain (container → LNK → mshta URL → stage-2), the defanged deobfuscated command, IOCs, ATT&CK (T1204.002/.004, T1027.006, T1059.001/.003/.005/.007, T1218.005 Mshta). Pivot IOCs via load_skill ioc-pivoting.
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: 197kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall