Created
April 24, 2017 18:15
-
-
Save idiom/a1940bc1c7496e3e431c023ce0728608 to your computer and use it in GitHub Desktop.
Script to decode a Base64 Encoded and Compressed PowerShell script
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
# | |
# Decode a base64 and compressed Powershell script. | |
# | |
# | |
# | |
# | |
$input = Read-Host -Prompt 'Base64 Text' | |
$decoded = $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream($(New-Object IO.MemoryStream(,$([Convert]::FromBase64String($input)))), [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd(); | |
Write-Host "----- Decoded -----" | |
Write-Host $decoded | |
Write-Host "----- Decoded End -----" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got the same error as sp00ks-git mentioned above