Library vnc
The VNC library provides some basic functionality needed in order to communicate with VNC servers, and derivates such as Tight- or Ultra- VNC.
Summary ------- The library currently supports the VNC Authentication security type only. This security type is supported by default in VNC, TightVNC and "Remote Desktop Sharing" in eg. Ubuntu. For servers that do not support this authentication security type the login method will fail.
Overview -------- The library contains the following classes:
o VNC - This class contains the core functions needed to communicate with VNC
Source: http://nmap.org/svn/nselib/vnc.lua
Functions
| connect (self) |
Connects the VNC socket |
| createVNCDESKey (self, password) |
Creates the password bit-flip needed before DES encryption |
| disconnect (self) |
Disconnects the VNC socket |
| getProtocolVersion (self, version) |
Returns the protocol version reported by the server |
| getSecTypesAsStringTable (self) |
Returns all supported security types as a table of strings |
| handshake (self) |
Performs the VNC handshake and determines o The RFB Protocol to use o The supported authentication security types |
| login (self, username, password) |
Attempts to login to the VNC service Currently the only supported auth sectype is VNC Authentication |
| supportsSecType (self, sectype) |
Checks if the supplied security type is supported or not |
Functions
- connect (self)
-
Connects the VNC socket
Parameters
- self:
- createVNCDESKey (self, password)
-
Creates the password bit-flip needed before DES encryption
Parameters
- self:
- password: string containing the password to process
Return value:
password string containing the processed password - disconnect (self)
-
Disconnects the VNC socket
Parameters
- self:
- getProtocolVersion (self, version)
-
Returns the protocol version reported by the server
Parameters
- self:
- version: string containing the version number
- getSecTypesAsStringTable (self)
-
Returns all supported security types as a table of strings
Parameters
- self:
Return value:
table containing a string entry for each security type - handshake (self)
-
Performs the VNC handshake and determines o The RFB Protocol to use o The supported authentication security types
Parameters
- self:
Return values:
- status, true on success, false on failure
- error string containing error message if status is false
- login (self, username, password)
-
Attempts to login to the VNC service Currently the only supported auth sectype is VNC Authentication
Parameters
- self:
- username: string, could be anything when VNCAuth is used
- password: string containing the password to use for authentication
Return values:
- status true on success, false on failure
- err string containing error message when status is false
- supportsSecType (self, sectype)
-
Checks if the supplied security type is supported or not
Parameters
- self:
- sectype: number containing the security type to check for
Return value:
status true if supported, false if not supported


