Skip to content

Artifact Analysis: LNK Files & Shortcut Forensics

1. Technical Overview & Creation Mechanics

Section titled “1. Technical Overview & Creation Mechanics”

The primary philosophy behind LNK files is user convenience. While users can manually create shortcuts on their Desktop, the true forensic value lies in the files generated automatically by the Windows operating system.

When a user opens a non-executable file (e.g., a .pdf document, a .docx file, or a .jpg image) or accesses a remote folder via Windows Explorer, the OS automatically generates a corresponding LNK file to populate the “Recent Items” menu.

  • User-Created: Scattered across the file system, predominantly on the Desktop or in custom directories.
  • System-Generated (The DFIR Target): C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Recent\

2. The Data Payload (The “Chatty Witness”)

Section titled “2. The Data Payload (The “Chatty Witness”)”

A raw LNK file is a complex binary structure. When parsed by forensic tools, it reveals a staggering amount of embedded metadata about the target file at the exact moment the shortcut was created.

  1. Target File Path: The absolute path of the original file.
  2. Frozen Target Timestamps: The Creation, Modification, and Last Access dates of the target file. Crucially, these timestamps are “frozen” inside the LNK file. Even if an attacker alters or deletes the original file, the LNK file retains the metadata of the file as it existed during the interaction.
  3. LNK Timestamps:
    • LNK Creation Date = The first time the user opened the target file.
    • LNK Modification Date = The last time the user opened the target file.
  4. Target File Size: The exact byte size of the original file.
  5. Volume Information:
    • Drive Type: Fixed (Hard Drive), Network, or Removable (USB).
    • Volume Serial Number (VSN): A unique identifier assigned to the disk when formatted.
    • Volume Label: The human-readable name of the drive (e.g., KINGSTON).
  6. Network & Machine Tracking (TrackerData Block): If the target file resided on a network share, the LNK file stores the NetBIOS name and the MAC address of the remote machine hosting the file.

LNK files answer the critical DFIR question: “Did the user or attacker actually interact with this specific file or directory?”

This is the superpower of LNK analysis. An attacker might download a malicious script, execute it, and immediately delete it to cover their tracks. While the script is gone, the LNK file generated upon its opening remains in the Recent folder. This provides irrefutable proof of the file’s historical existence, its exact path, and its size.

B. Tracking Infection Vectors (USB Drives)

Section titled “B. Tracking Infection Vectors (USB Drives)”

If an analyst discovers an LNK file pointing to a known malware payload (e.g., invoice.exe), and the LNK’s embedded volume information indicates a “Removable Media” drive type, the initial access vector is definitively proven to be a USB drive. The Volume Serial Number (VSN) can then be used to hunt for the specific physical USB drive within the organization.

C. Tracing Lateral Movement & Data Exfiltration

Section titled “C. Tracing Lateral Movement & Data Exfiltration”

LNK files are created when documents are accessed across network shares (\\SERVER\Share\document.docx). By parsing LNK files on a compromised workstation, analysts can map out exactly which internal servers the attacker browsed. Extracting the MAC address from the LNK’s TrackerData block allows analysts to positively identify the target server, even if IP addresses have changed.

Because LNK files are binary, manual analysis via a hex editor is inefficient. DFIR teams rely on automated parsers to extract the metadata into structured formats.

parse_lnk_files.cmd
:: LECmd (LNK Explorer Command Line) is the industry standard parser.
:: It processes a single LNK or an entire directory, outputting parsed metadata to CSV.
LECmd.exe -d "C:\Forensics\Export\Users\Admin\AppData\Roaming\Microsoft\Windows\Recent" --csv "C:\Forensics\Results" --csvf lnk_analysis.csv