Skip to content

Commit 34d5d92

Browse files
committed
Land rapid7#5555, @Th3R3p0's support for for RFB Version 4
2 parents d19c2e7 + 7eeb880 commit 34d5d92

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

lib/rex/proto/rfb/client.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(sock, opts = {})
2424
@opts = opts
2525

2626
@banner = nil
27-
@majver = MajorVersion
27+
@majver = MajorVersions
2828
@minver = -1
2929
@auth_types = []
3030
end
@@ -50,7 +50,7 @@ def handshake
5050

5151
if @banner =~ /RFB ([0-9]{3})\.([0-9]{3})/
5252
maj = $1.to_i
53-
if maj != MajorVersion
53+
unless MajorVersions.include?(maj)
5454
@error = "Invalid major version number: #{maj}"
5555
return false
5656
end
@@ -61,7 +61,12 @@ def handshake
6161

6262
@minver = $2.to_i
6363

64-
our_ver = "RFB %03d.%03d\n" % [MajorVersion, @minver]
64+
# Forces version 3 to be used. This adds support for version 4 servers.
65+
# It may be necessary to hardcode minver as well.
66+
# TODO: Add support for Version 4.
67+
# Version 4 adds additional information to the packet regarding supported
68+
# authentication types.
69+
our_ver = "RFB %03d.%03d\n" % [3, @minver]
6570
@sock.put(our_ver)
6671

6772
true

lib/rex/proto/rfb/constants.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module RFB
1919
DefaultPort = 5900
2020

2121
# Version information
22-
MajorVersion = 3
22+
MajorVersions = [3, 4]
2323
# NOTE: We will emulate whatever minor version the server reports.
2424

2525
# Security types

modules/auxiliary/scanner/vnc/vnc_login.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def initialize
2121
'Description' => %q{
2222
This module will test a VNC server on a range of machines and
2323
report successful logins. Currently it supports RFB protocol
24-
version 3.3, 3.7, and 3.8 using the VNC challenge response
24+
version 3.3, 3.7, 3.8 and 4.001 using the VNC challenge response
2525
authentication method.
2626
},
2727
'Author' =>

0 commit comments

Comments
 (0)