๐ Encode File Using PowerShell
Letโs learn how to Base64-encode a file in PowerShell, transfer it manually (like over SSH or copy-paste), and decode it on Linux.
๐ Encode File Using PowerShell & Transfer via Base64
๐ป Step 1: Encode File with PowerShell
PS C:\htb> [Convert]::ToBase64String((Get-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Encoding Byte))๐งช Step 2: Confirm File Integrity with MD5
PS C:\htb> Get-FileHash "C:\Windows\System32\drivers\etc\hosts" -Algorithm MD5 | Select HashHash
----
3688374325B992DEF12793500307566D๐ง Step 3: Decode on Linux
๐ Step 4: Verify Integrity with md5sum
md5sumLast updated