Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoicware/powershell2lnk
Generate a Custom LNK File To Run PowerShell Code
https://github.com/zoicware/powershell2lnk
powershell redteam windows
Last synced: 15 days ago
JSON representation
Generate a Custom LNK File To Run PowerShell Code
- Host: GitHub
- URL: https://github.com/zoicware/powershell2lnk
- Owner: zoicware
- Created: 2024-10-17T02:34:39.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-17T02:57:47.000Z (2 months ago)
- Last Synced: 2024-10-26T22:11:59.357Z (about 2 months ago)
- Topics: powershell, redteam, windows
- Language: PowerShell
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## PS2LNK
This PowerShell script allows you to pass a command and create a customized shortcut file (LNK) to execute the code. This can be used to bypass windows execution policy or create a fake file to run PowerShell code.
### How to Use
*Run the Script From PowerShell*
**Example**
```PowerShell
.\PS2LNK.ps1 -code 'Write-Host Hello World' -PSVersion 64bit -RunAsAdmin
```**Display Help**
```PowerShell
.\PS2LNK.ps1 -Help
```
![image](https://github.com/user-attachments/assets/0b0b61b8-49e7-4bb9-97e7-f4daa37dabde)**Change Icon**
```PowerShell
.\PS2LNK.ps1 -code 'Write-Host Hello World' -PSVersion 64bit -RunAsAdmin -Icon 173
```### Get Icon Index
- Download IconsExtract from NirSoft - https://www.nirsoft.net/utils/iconsext.html
- Find the index of the icon you want your lnk file to have from Shell32.dll