
BlueGate Exploit validator - RD Gateway validator for CVE-2020-0609 and CVE-2020-0610 (BlueGate) using OpenSSL DTLS over UDP/3391.
A small check-only Python utility for remotely validating the patch behavior associated with the Microsoft Remote Desktop Gateway vulnerabilities:
The vulnerabilities, commonly associated with the BlueGate research, affect Microsoft Remote Desktop Gateway (RD Gateway) and can potentially allow an unauthenticated remote attacker to execute arbitrary code on an unpatched server.
This utility does not implement remote code execution, denial of service, persistence, or payload delivery.
It performs a single protocol-level validation request and evaluates the RD Gateway response.
| Property | Details |
|---|
| CVEs | CVE-2020-0609, CVE-2020-0610 |
| Component | Microsoft Remote Desktop Gateway |
| Vulnerability Type | Remote Code Execution |
| Authentication Required | No |
| User Interaction | No |
| Attack Vector | Network |
| Severity | Critical |
| CVSS v3.1 | 9.8 |
| CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Primary Protocol | RD Gateway UDP transport |
| Default UDP Port | 3391/UDP |
| Public Name | BlueGate |
Affected Windows Server families include:
Windows Server 2012
Windows Server 2012 R2
Windows Server 2016
Windows Server 2019
Systems that have installed Microsoft's January 2020 security updates or later cumulative updates should contain the relevant fixes.
An RD Gateway deployment can expose multiple related services.
For example:
Microsoft RD Gateway
|
+------------+------------+
| |
TCP/443 UDP/3391
| |
HTTPS / RDWeb RD Gateway UDP
RPC-over-HTTPS DTLS transport
The RDWeb portal may be visible through a browser at:
https://gateway.example/RDWeb/
and RD Gateway functionality may also be exposed through TCP/443.
However, the attack surface tested by this BlueGate-style validator is the RD Gateway UDP transport, normally listening on:
UDP/3391
The scanner therefore uses DTLS over UDP/3391, not HTTPS over TCP/443.
Changing the script to port 443 would mean testing:
UDP/443
which is not the same thing as:
TCP/443
Before running the vulnerability validator, UDP/3391 can be checked with Nmap:
nmap -Pn -sU -p3391 --reason <TARGET>
Example:
PORT STATE SERVICE
3391/udp open savant
The savant service label is simply Nmap's port-name mapping and does not necessarily identify the actual service.
The RD Gateway DTLS service can be confirmed more reliably with OpenSSL.
openssl s_client \
-dtls1 \
-connect <TARGET>:3391 \
-state
openssl s_client \
-dtls1_2 \
-connect <TARGET>:3391 \
-state
A successful handshake confirms that a DTLS service is responding on UDP/3391.
Typical successful output includes:
SSL handshake has read ...
New, SSLv3, Cipher is ...
Protocol: DTLSv1
or:
Protocol: DTLSv1.2
The validator:
No authentication credentials are required for the validation.
The utility intentionally contains:
NO reverse shell
NO command execution
NO exploit payload
NO denial-of-service loop
NO repeated malformed packet transmission
Tested with:
Python 3
OpenSSL command-line client
Linux
Verify OpenSSL:
openssl version
Verify Python:
python3 --version
No Python OpenSSL module is required because the script launches the system openssl s_client implementation.
This avoids compatibility problems encountered by older BlueGate implementations that relied on deprecated Python/OpenSSL APIs such as:
DTLSv1_client_method
Basic scan:
python3 BlueGate.py <TARGET>
Example:
python3 BlueGate.py 192.0.2.10
The default destination is:
UDP/3391
python3 BlueGate.py \
-P 3391 \
192.0.2.10
python3 BlueGate.py \
--dtls 1 \
192.0.2.10
python3 BlueGate.py \
--dtls 1.2 \
192.0.2.10
Testing both can be useful:
python3 BlueGate.py --dtls 1 192.0.2.10
python3 BlueGate.py --dtls 1.2 192.0.2.10
Example result from a patched RD Gateway:
[*] Target: 192.0.2.10:3391/udp
[*] DTLS mode: 1.2
[*] Starting OpenSSL DTLS client...
[+] DTLS handshake completed.
[*] Probe (11 bytes): 0500070000004100010041
[*] Sending one validation packet...
[*] Response length: 16
[*] Response hex: 02000c0000000000ffffffffffff0080
[*] Status: 0x8000ffff
[+] PATCHED SIGNATURE RECEIVED
Server returned 0x8000ffff, which is
the rejection value used by the public
CVE detector to identify a patched host.
The same patched response may also be returned over DTLS 1.0:
Response length: 16
Response hex: 02000c0000000000ffffffffffff0080
Status: 0x8000ffff
0x8000ffffA response ending with:
0x8000ffff
is the rejection value used by public BlueGate/RD Gateway scanners to identify the malformed fragmentation condition as rejected.
The tool therefore reports:
PATCHED SIGNATURE RECEIVED
This provides strong protocol-level evidence that the particular condition tested for CVE-2020-0609/CVE-2020-0610 is not exploitable using the known public detection technique.
If a 16-byte RD Gateway response is received but the final DWORD is something other than:
0x8000ffff
the tool reports:
DETECTOR POSITIVE
This should be treated as:
Potentially Vulnerable
rather than immediate proof of successful remote code execution.
The result should preferably be corroborated using:
Windows build information
Installed KB information
Microsoft patch inventory
Credentialed vulnerability scanning
before reporting the vulnerability as definitively exploitable.
If no application response is received:
INCONCLUSIVE
The tool deliberately does not classify a timeout as vulnerable.
A timeout could be caused by:
Therefore:
No response != Vulnerable
The public BlueGate/RDG detection approach uses an RD Gateway fragmentation packet containing an unusual fragment count.
Conceptually:
DTLS connection
|
v
+-----------------------+
| RD Gateway UDP parser |
+-----------------------+
|
| fragmentation validation packet
v
+-----------------------+
| Fragment validation |
+-----------------------+
|
+---- patched ----> rejection
| 0x8000ffff
|
+---- unexpected --> requires investigation
The validation packet used by this utility is sent only once.
This project is intended exclusively for:
Only test systems for which you have explicit authorization.
The author assumes no responsibility for misuse, unauthorized access, service disruption, data loss, or other consequences resulting from use or modification of this software.
The detection methodology is based on publicly documented research into the Microsoft RD Gateway vulnerabilities CVE-2020-0609 and CVE-2020-0610, including the work performed by the BlueGate and RD Gateway security research community.
This project primarily modernizes the validation workflow by using the system OpenSSL DTLS implementation rather than deprecated pyOpenSSL DTLS internals.