Skip to content

Commit 04740bd

Browse files
committed
Land rapid7#8194, piwik_superuser_plugin_upload update
2 parents 1245eb9 + 06ca406 commit 04740bd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

documentation/modules/exploit/unix/webapp/piwik_superuser_plugin_upload.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Older builds are also available from [builds.piwik.org](https://builds.piwik.org
55

66
This module was tested with Piwik versions 2.14.0, 2.16.0, 2.17.1 and 3.0.1
77

8+
Piwik disabled custom plugin uploads in version 3.0.3. From version 3.0.3 onwards you have to enable custom plugin uploads via the config file.
9+
810
## Verification Steps
911

1012
### Install Piwik (Debian/Ubuntu)

modules/exploits/unix/webapp/piwik_superuser_plugin_upload.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def initialize(info = {})
2020
This module will generate a plugin, pack the payload into it
2121
and upload it to a server running Piwik. Superuser Credentials are
2222
required to run this module. This module does not work against Piwik 1
23-
as there is no option to upload custom plugins.
23+
as there is no option to upload custom plugins. Piwik disabled
24+
custom plugin uploads in version 3.0.3. From version 3.0.3 onwards you
25+
have to enable custom plugin uploads via the config file.
2426
Tested with Piwik 2.14.0, 2.16.0, 2.17.1 and 3.0.1.
2527
},
2628
'License' => MSF_LICENSE,
@@ -30,7 +32,9 @@ def initialize(info = {})
3032
],
3133
'References' =>
3234
[
33-
[ 'URL', 'https://firefart.at/post/turning_piwik_superuser_creds_into_rce/' ]
35+
[ 'URL', 'https://firefart.at/post/turning_piwik_superuser_creds_into_rce/' ],
36+
[ 'URL', 'https://piwik.org/faq/plugins/faq_21/' ],
37+
[ 'URL', 'https://piwik.org/changelog/piwik-3-0-3/' ]
3438
],
3539
'DisclosureDate' => 'Feb 05 2017',
3640
'Platform' => 'php',
@@ -314,6 +318,10 @@ def exploit
314318

315319
upload_nonce = nil
316320
if res && res.code == 200
321+
if res.body =~ /Plugin upload is disabled in config file/
322+
fail_with(Failure::NotVulnerable, 'Custom plugin uploads are disabled')
323+
end
324+
317325
match = res.body.match(/<form.+id="uploadPluginForm".+nonce=(\w+)/m)
318326
if match
319327
upload_nonce = match[1]
@@ -362,4 +370,3 @@ def exploit
362370
}, 5)
363371
end
364372
end
365-

0 commit comments

Comments
 (0)