Created
January 9, 2016 16:09
-
-
Save FrankSpierings/cfb7246e6e267ce7178c to your computer and use it in GitHub Desktop.
This file contains 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
$DebugPreference = "Continue" | |
function Create-Base64Payload() | |
{ | |
param( | |
$Filename | |
) | |
$content = (Get-Content -Path $Filename | Out-String) | |
$command = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($content)) | |
Write-Debug "[+] Mind the newlines!" | |
Write-Debug "[+] Powershell.exe -EncodedCommand $command" | |
return $command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment