Auditing Windows Shortcut (.LNK) Files: The Persistence and Phishing Vector Hiding in Plain Sight
Malicious .LNK shortcuts are a favorite for phishing payloads and stealthy persistence. Learn how attackers weaponize them and how to audit your Windows fleet for LNK-based threats.
The humble Windows shortcut file has been a first-class attack primitive for over a decade, and it is still working. A .lnk is not a passive pointer — it is a binary structure (the Shell Link Binary File Format) that can encode an arbitrary target path, command-line arguments, a working directory, a custom icon, and even an embedded environment variable that expands at click time. That flexibility is exactly what attackers exploit. A single double-click can launch powershell.exe with a base64-encoded payload while displaying a PDF icon and a benign-looking filename. Windows still hides the .lnk extension by default, so Invoice.pdf.lnk renders as Invoice.pdf. The user thinks they opened a document; they actually ran a command interpreter.
Why attackers love .LNK
LNK abuse spans nearly the entire kill chain, which is why it shows up in commodity phishing and nation-state tooling alike:
- Initial access. Since Microsoft began blocking macros from internet-sourced Office files, adversaries pivoted hard to
.lnkfiles delivered inside ISO, IMG, and ZIP containers — archives that strip the Mark-of-the-Web from the shortcut inside. - Execution. The
targetfield points at a living-off-the-land binary (cmd.exe,powershell.exe,mshta.exe,rundll32.exe) and theargumentsfield carries the real payload. - Persistence. Drop a malicious shortcut into a Startup folder (
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup) and it runs at every logon — a classic ASEP (auto-start extensibility point) that many EDRs under-inspect. - Defense evasion. Custom icons, spoofed extensions, and padded arguments (thousands of whitespace characters push the malicious command off-screen in the shortcut's Target field) all frustrate a hurried analyst.
Anatomy of a malicious shortcut
You do not need a specialized parser to triage a suspicious shortcut. PowerShell's WScript.Shell COM object exposes the fields that matter. On a suspect file:
$sh = New-Object -ComObject WScript.Shell
$lnk = $sh.CreateShortcut("C:\Users\jdoe\Downloads\Invoice.pdf.lnk")
[pscustomobject]@{
Target = $lnk.TargetPath
Arguments = $lnk.Arguments
WorkDir = $lnk.WorkingDirectory
IconLoc = $lnk.IconLocation
} | Format-List
Red flags jump out immediately: a TargetPath of C:\Windows\System32\cmd.exe on a file named Invoice.pdf, an Arguments string containing -enc, -nop, DownloadString, or a URL, or an icon location pointing at a document viewer to complete the disguise. The arguments field is where the intent lives — treat any interpreter target with a long or obfuscated argument string as hostile until proven otherwise.
Hunting across the fleet
Manual inspection is fine for a single alert. Auditing a hundred machines is a different problem. The signal you want is every shortcut whose target resolves to a script host or LOLBin, prioritized by location. Shortcuts in Startup folders, the Recent folder, and user Desktops carry the most risk. A fleet sweep should enumerate:
- All per-user and all-users Startup directories.
- Shortcuts whose
TargetPathends inpowershell.exe,cmd.exe,wscript.exe,cscript.exe,mshta.exe,rundll32.exe, orregsvr32.exe. - Shortcuts with non-empty arguments containing encoding flags, network calls, or unusual working directories such as
%TEMP%.
Pair this with telemetry: enable command-line process auditing (Event ID 4688 with the process command line included) and Sysmon Event ID 1 so that a click on a weaponized shortcut leaves an unmistakable trail — a script host spawned by explorer.exe with a suspicious command line.
A shortcut in a Startup folder that launches an interpreter is not a preference — it is persistence until you have proven otherwise.
Hardening steps that hold up
- Un-hide known extensions fleet-wide so
.lnkand double-extensions are visible (HideFileExt = 0). It is a small registry change with outsized phishing-resistance value. - Deploy Attack Surface Reduction rules, especially "Block executable content from email client and webmail" and the LOLBin-launch rules, which break the shortcut-to-interpreter chain.
- Preserve Mark-of-the-Web. Prefer container formats that propagate MOTW and use SmartScreen so downloaded shortcuts trigger a warning instead of silent execution.
- Application control. WDAC or AppLocker policies that constrain which script hosts can run, and from where, neutralize most LNK payloads even after a click.
Where WinSentinel fits
On a single machine, WinSentinel is free and audits the full picture — it enumerates Startup-folder and auto-start shortcuts, resolves each shortcut's target and arguments, flags LNKs that launch script hosts or LOLBins, and confirms the supporting controls (extension visibility, ASR rules, command-line auditing, SmartScreen) are actually in place rather than merely assumed. Every one of the 33 audit modules runs with no limits on your own box.
For organizations running fleets, the Pro tier lifts that same LNK-persistence check into a central view: the node dispatches the audit across every managed endpoint, rolls the findings into a fleet posture score, and raises a drift alert the moment a new interpreter-launching shortcut appears in a Startup folder on any machine — the difference between discovering LNK persistence during an incident and catching it the hour it is planted. Whether you run one workstation or a hundred, the shortcut file deserves the same scrutiny you give a scheduled task.