Path: blob/master/documentation/modules/auxiliary/fileformat/datablock_padding_lnk.md
23592 views
Vulnerable Application
Windows systems where LNK files are processed, such as in Explorer or when shortcuts are executed. This can lead to arbitrary command execution via manipulated command line buffers.
References:
Disclosure Date: 2025-07-19.
Verification Steps
Start msfconsole.
Load the module:
use auxiliary/fileformat/windows_lnk_padding
.Optionally customize FILENAME, DESCRIPTION, ICON_PATH, or BUFFER_SIZE.
Execute the module:
run
.A malicious LNK file will be generated.
Deliver the LNK file to the target Windows system.
Open the LNK file to trigger command execution (e.g., launching calc.exe).
Options
COMMAND
The command to execute when the LNK is opened.
Default: C:\\Windows\\System32\\calc.exe
Example:
DESCRIPTION
Optional description for the LNK file. If not set, a random sentence is generated.
Example:
ICON_PATH
Optional path to an icon for the LNK file. If not set, a random system icon path is generated.
Example:
BUFFER_SIZE
The size of the whitespace padding buffer before the command (must be sufficient to avoid truncation).
Default: 900
Example:
Scenarios
Basic Command Execution on Windows
Target: Any Windows system (e.g., Windows 10 or later).
Generate an LNK that launches Calculator with custom padding: