Depending on the file size we want to transfer, we can use a method that does not require network communication. If we have access to a terminal, we can encode a file to a base64 string, copy its content into the terminal and perform the reverse operation. Let's see how we can do this with Bash.

Pwnbox - Check File MD5 hash

md5sum id_rsa

Pwnbox - Encode SSH Key to Base64

We use cat to print the file content, and base64 encode the output using a pipe |. We used the option -w 0 to create only one line and ended up with the command with a semi-colon (;) and echo keyword to start a new line and make it easier to copy.

cat id_rsa |base64 -w 0;echo

Linux TARGET - Decode the File

echo -n '<base64>' | base64 -d > id_rsa

Linux - Confirm the MD5 Hashes Match

md5sum id_rsa

<aside> 🗒️

You can also upload files using the reverse operation. From your compromised target cat and base64 encode a file and decode it in your Pwnbox.

</aside>