Back home
中文
H7 / SECURITY RESEARCH NOTES

Decoding a Server Port from Base64 Multiple Times with PowerShell

Environment

IPHOSTNAMENOTE
N/AWin10Test host

Related Script

ContentDownload
PowerShell scriptDownload

Base64-encoded string

Decode a Base64 string with PowerShell

[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(dGVzdF9wb2M=))

Decode port 443 three times with PowerShell

$target_port = "VGtSUmVnPT0="

for ($x = 0; $x -lt 3; $x = $x + 1)
{
    $target_port = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($target_port))
}

echo $target_port