meltedinhex/analyst-ai-pack / skills/analyzing-malicious-lnk-files
analyzing-malicious-lnk-files
VerifiedAnalyzes weaponized Windows shortcut (.lnk) files: parsing the shell link structure for the target command, arguments, icon, and working directory, and recovering hidden PowerShell/cmd payloads and embedded content used in phishing. Activates for requests to analyze a malicious LNK, parse a shortcut file, or extract a command from a .lnk.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 3.2 KB |
| references/api-reference.md | markdown | 1.3 KB |
| scripts/analyst.py | script | 3.2 KB |
references/api-reference.md
View on GitHub# API Reference: Analyzing Malicious LNK Files
## Overview
`scripts/analyst.py` is a minimal [MS-SHLLINK] parser: it validates the LNK header and CLSID, reads
LinkFlags, skips the IDList/LinkInfo, and extracts the StringData fields (name, relative path,
working dir, arguments, icon), plus the count of any appended data. It parses statically and never
executes the shortcut.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | struct parsing, file IO |
## External tools
| Tool | Purpose |
|------|---------|
| LECmd / lnkparse | Full-featured LNK parsing including extra data blocks |
## Core functions
### `parse(path)`
Returns LinkFlags and the recovered StringData fields, appended-data size, and a suspicious flag.
### `_read_stringdata(data, off, unicode_)`
Reads a CountedString (ANSI or UTF-16LE) per the IsUnicode flag.
## Usage
```bash
python scripts/analyst.py parse sample.lnk
```
## Sources
- Microsoft [MS-SHLLINK] Shell Link Binary File Format —
https://learn.microsoft.com/openspecs/windows_protocols/ms-shllink/
- liblnk LNK format documentation —
https://github.com/libyal/liblnk/blob/main/documentation/Windows%20Shortcut%20File%20(LNK)%20format.asciidoc
- Malicious-argument hiding in COMMAND_LINE_ARGUMENTS, established document-analysis practice
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: 198k | 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 |