analyzing-malicious-lnk-files
Analyzes weaponized Windows shortcut (.lnk) files: parsing the shell link structure
v1.0.03 installs+3 in 7 days24 StarsApache-2.0synced 10 hours ago
Install
No NotHoly CLI yet? Install it first.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install meltedinhex/analyzing-malicious-lnk-filesWrites to ~/.notholy/skills after checking the signature and the SHA-256.
SignatureSigned, ed25519
Packagec5c48fec…e4f5525a
c5c48fecd1b4…c0dfe4f5525a4 files · 3.5 KBScanMedium2 findings
- Executable script shipped with the skillscripts/analyst.py
- Links to outside domains
Sourcegithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/analyzing-malicious-lnk-files@da7600a
On this page
When to Use
- You have a
.lnkdelivered via phishing (often in an archive or ISO) and need its real action. - You must recover the target command line, arguments, and any embedded/hidden payload.
- You are extracting IOCs (commands, URLs, file paths) from a shortcut.
Do not use Windows Explorer to inspect or double-click the shortcut — that executes its target. Parse the binary structure statically.
Prerequisites
- An LNK parser (Python
struct, orlnkparse/LECmd); the sample handled inertly.
Safety & Handling
- Never double-click or hover-load the shortcut in Explorer; parse raw bytes only.
- Defang recovered URLs and store any embedded payload password-protected.
Workflow
Step 1: Confirm and parse the header
Verify the LNK magic (4C 00 00 00 + the link CLSID) and read LinkFlags to know which optional
structures are present.
python scripts/analyst.py parse sample.lnkStep 2: Recover the target and arguments
Extract the relative/local path and, crucially, the COMMAND_LINE_ARGUMENTS string — malicious
LNKs hide powershell -enc ... or cmd /c ... here.
Step 3: Inspect icon and metadata
Read the icon location (often spoofed to look like a document) and metadata (machine ID, timestamps) useful for attribution/clustering.
Step 4: Find appended/embedded payloads
Check for data appended after the LNK structure (some campaigns embed scripts/binaries past the parsed end) and extract it.
Step 5: Decode and extract IOCs
Decode encoded commands (UTF-16LE base64), defang URLs, and route extracted payloads to the right analysis workflow.
Validation
- The full command line, including arguments, is recovered (not just the target path).
- Encoded commands are decoded to cleartext.
- Appended/embedded payloads are detected and extracted, and IOCs are defanged.
Pitfalls
- Reading only the target path and missing the malicious arguments.
- Inspecting in Explorer and executing the shortcut.
- Ignoring data appended past the LNK structure.
References
- See
references/api-reference.mdfor the LNK parser. - MS-SHLLINK and the liblnk format notes (linked in frontmatter).
Files in this version
references/11.3 KB
- api-reference.md1.3 KB
scripts/13.2 KB
- analyst.py3.2 KB
- LICENSE340 B
- SKILL.md3.2 KB
Permissions
| Permission | Declared | Found by the scan |
|---|---|---|
| Reads files | No | No |
| Writes files | No | No |
| Runs shell commands | Yes | Yes |
| Uses the network | Yes | Yes |
| Uses connectors | No | No |
| Drives a browser | No | No |
Scan findings
Reviewed on Nov 13, 2026
- MediumFile · Executable script shipped with the skillscripts/analyst.py
- InfoLink · Links to outside domains
A clean scan lowers the risk but does not prove a package is safe. Read what you install.
| Version | Published | Commit | SHA-256 | Signature | Permission change |
|---|---|---|---|---|---|
| v1.0.0 | Nov 13, 2026 | da7600a | c5c48fec | Signed | – |
More from meltedinhex
All from this publisher- writing-yara-rules-from-reversed-codemeltedinhex/writing-yara-rules-from-reversed-code4
- validating-detections-with-atomic-testsmeltedinhex/validating-detections-with-atomic-tests4
- writing-suricata-and-snort-rulesmeltedinhex/writing-suricata-and-snort-rules3
- writing-sigma-detection-rulesmeltedinhex/writing-sigma-detection-rules3
More in Active Directory and Windows
See the category- offensive-windows-mitigationssnailsploit/offensive-windows-mitigations4
- active-directory-attack-pathssecurityskills/active-directory-attack-paths3
- analyzing-powershell-script-block-loggingmukul975/analyzing-powershell-script-block-logging3
- offensive-windows-boundariessnailsploit/offensive-windows-boundaries3
- evil-winrmaeondave/evil-winrm3
- bloodyadaeondave/bloodyad3
Ask anything your scope allows.
Create an account, add credits and ask the first question in the chat or the terminal.
- 1/3
Create the account
Individual or company. You can switch to a company later without losing balance or keys.
IndividualCompany - 2/3
Add credits
By card. Pay per token, no subscription.
$5.00minimum deposit - 3/3
Ask
In the chat, or install the CLI and run notholy login in your terminal.
$ notholy login