File Transfer

Listeners and binaries

Linux

base64

  • Using base64 help to keep file integrity

  • Check hashes to avoid file corruption

Generate hash
md5sum <file>

Encoding

Encode File + Redirect Output
base64 file.txt > hash.txt
Encode String + Redirect Output
echo "your_string_here" | base64 > encoded_file.txt
  • In Base64 encoding, by default, some implementations add line breaks every 76 characters (following the RFC 2045 standard).

Encode File Without line break
base64 -w 0 <file>
Encode String without line breaks
echo -n "your_string_here" | base64 -w 0

Safe URL encoding
base64 -w 0 <file> | tr '+/' '-_' > url_safe_encoded.txt

Decoding

Decode String + Output to a file
echo <string> | base64 -d > <file>
Decode File + Output to a file
base64 -d -i <file> > <decoded_file>
Decode File without line breaks
base64 -d -w 0 file.txt > decoded_output.bin

Techniques

Host
python3 -m http.server 443

Client

curl
curl -o IP:Port/file
wget
wget IP:Port/file

Windows

First, start a python web server
python3 -m http.server 443
Then
certutil.exe -f -urlcache -split http://<IP>/<file>

Useful binaries

Last updated