TryHackMe - Takeover
Este desafío gira en torno a la enumeración de subdominios
Introducción
Tenemos un pequeño texto de introducción:
Hola,
Soy el CEO y uno de los cofundadores de futurevera.thm. En Futurevera, creemos que el futuro está en el espacio. Hacemos mucha investigación espacial y escribimos blogs al respecto. Solíamos ayudar a estudiantes con preguntas sobre el espacio, pero estamos reconstruyendo nuestro sistema de soporte.
Recientemente, unos hackers de sombrero negro se acercaron a nosotros diciendo que podrían tomar el control y nos están pidiendo un gran rescate. Por favor, ayúdanos a descubrir qué podrían tomar.
Nuestro sitio web está ubicado en: https://futurevera.thm
Pista: No olvides agregar 10.10.207.60 en /etc/hosts para futurevera.thm
Agregar URL a /etc/hosts
Vamos a agregar nuestra IP al archivo /etc/hosts
para poder acceder al sitio web mediante la URL
1
echo "10.10.207.60 futurevera.thm" | sudo tee -a /etc/hosts
Nmap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
nmap -T4 -n -sC -sV -Pn -p- 10.10.207.60
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 b0:66:60:93:3a:bf:b7:e3:a9:3d:47:af:33:1d:9b:46 (RSA)
| 256 1a:38:12:53:7d:94:23:72:59:36:1a:da:77:b2:9b:1c (ECDSA)
|_ 256 9d:d0:92:e7:54:ec:b0:80:c5:29:f1:1d:a1:e7:92:76 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Did not follow redirect to https://futurevera.thm/
|_http-server-header: Apache/2.4.41 (Ubuntu)
443/tcp open ssl/http Apache httpd 2.4.41 ((Ubuntu))
| ssl-cert: Subject: commonName=futurevera.thm/organizationName=Futurevera/stateOrProvinceName=Oregon/countryName=US
| Not valid before: 2022-03-13T10:05:19
|_Not valid after: 2023-03-13T10:05:19
|_http-title: FutureVera
|_http-server-header: Apache/2.4.41 (Ubuntu)
| tls-alpn:
|_ http/1.1
|_ssl-date: TLS randomness does not represent time
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Puertos abiertos:
22/tcp
80/tcp
443/tcp
Subdominios
Vamos a buscar subdominios usando ffuf
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
┌──(rene㉿kali)-[~]
└─$ ffuf -H "Host: FUZZ.futurevera.thm" -u https://10.10.207.60 -w /usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt -fs 0,4605
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : GET
:: URL : https://10.10.207.60
:: Wordlist : FUZZ: /usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt
:: Header : Host: FUZZ.futurevera.thm
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
:: Filter : Response size: 0,4605
________________________________________________
blog [Status: 200, Size: 3838, Words: 1326, Lines: 81, Duration: 43ms]
support [Status: 200, Size: 1522, Words: 367, Lines: 34, Duration: 42ms]
Vamos a agregar esos subdominios a nuestro archivo /etc/hosts
1
2
echo "10.10.207.60 blog.futurevera.thm" | sudo tee -a /etc/hosts
echo "10.10.207.60 support.futurevera.thm" | sudo tee -a /etc/hosts
Después de visitar el subdominio support y revisar el certificado SSL, podemos ver un subdominio secreto:
Vamos a agregar el nuevo subdominio al archivo /etc/hosts
1
echo "10.10.207.60 [CENSORED].support.futurevera.thm" | sudo tee -a /etc/hosts
Bandera
Después de agregar y visitar el nuevo subdominio, aparece un mensaje de error con la bandera (flag)
Desafío bastante rápido y buena práctica para aprender a usar ffuf
en la enumeración de subdominios