Wireshark Tutorial - Decrypting RDP Traffic
Wireshark Tutorial - Decrypting RDP Traffic
Wireshark Tutorial - Decrypting RDP Traffic
Menu
18 10 min. read
SHARE
By Brad Duncan and Vijay Prakash
April 1, 2021 at 6:00 AM
Category: Unit 42
Tags: RDP, tutorial, Windows, Wireshark, Wireshark Tutorial
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 1/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Execu ve Summary
In recent years, Remote Desktop Protocol (RDP) has been exploited by a ackers to access unsecured
servers and enterprise networks. Since 2017, RDP has become a significant vector in malware a acks
using ransomware. Security professionals have increasingly focused their a en on on this protocol by
wri ng signatures to detect RDP vulnerabili es and prevent a acks.
As a proprietary protocol from Microso , RDP supports several opera ng modes that encrypt network
traffic. Unfortunately, this encryp on makes wri ng RDP signatures difficult because RDP content is
hidden.
Fortunately, we can establish a test environment that provides a key file, and we can use that key to
decrypt a packet capture (pcap) of the RDP traffic in Wireshark.
This blog demonstrates how to prepare the environment, obtain a decryp on key and use it to decrypt
RDP traffic.
Requirements
The following are necessary to get the most value from this tutorial:
Overall Process
The overall process follows seven general steps:
This
Step 1: site
Set uses
up a cookies essential to its with
virtual environment operation, for analytics,
two hosts, one acandngforas an RDP client and one ac ng as an
personalized
RDP server. content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 2/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Step 4: Capture RDP traffic between the RDP server and Windows client.
This tutorial does not cover se ng up virtual machines (VMs) in a virtual environment. The basic
structure of our lab used for this tutorial is shown below in Figure 1.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 3/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Our lab environment contained two Windows 10 hosts. One of the hosts acted as an RDP client, and
the other acted as an RDP server. We recorded network traffic from an RDP session between these
two hosts from the virtual LAN.
For this tutorial, our RDP client was a host running Windows 10 Pro. This host has a built-in RDP
client.
Microso has published details on removing configura on op ons that support forward secrecy in the
ar cles, “Manage Transport Layer Security (TLS)” and “Priori zing Schannel Cipher Suites.” Below is a
step-by-step process that we used.
Open the Group Policy Management Console gpedit.msc as an administrator as shown below in Figure
2.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use Figure 2. Running
of cookies. the Group
Privacy Policy Editor in Windows 10 Pro as an administrator.
statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 4/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Under SSL Configura on Se ngs, double-click the entry for SSL Cipher Suite Order as shown below in
Figure 4.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 5/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Under the SSL Cipher Suite Order, click the Enabled op on as shown below in Figure 5.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 6/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Next, double-click the list of ciphers and select the en re list as shown below in Figure 6.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 7/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Once the list has been selected, copy it as shown below in Figure 7.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 8/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Copy this list of ciphers into a text editor such as Notepad. Remove any ciphers that support Ellip c
Curve cryptography using Diffie-Hellman Ephemeral (ECDHE) or Digital Signature Algorithm (ECDSA)
encryp on. These should be any entries with ECDHE and/or ECDSA in the name. In the example
shown below in Figure 8, these ciphers were all located sequen ally, so they were easy to delete from
the text.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 9/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_G
CM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_CBC_S
HA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,T
LS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WI
TH_NULL_SHA256,TLS_RSA_WITH_NULL_SHA,TLS_PSK_WITH_AES_256_GCM_SHA384
,TLS_PSK_WITH_AES_128_GCM_SHA256,TLS_PSK_WITH_AES_256_CBC_SHA384,TLS
_PSK_WITH_AES_128_CBC_SHA256,TLS_PSK_WITH_NULL_SHA384,TLS_PSK_WITH_N
ULL_SHA256
Thisthe
Paste siteupdated
uses cookies essential
cipher to its
list back intooperation,
the SSLfor analytics,
Cipher SuitesandField,
for making sure to overwrite the
original list. Click the Apply bu on, then click OK to close the window. You have❯now
personalized content and ads. By continuing to browse this site, you Cookie Settings
updated the list
acknowledge the use of cookies.
and can close the Group Policy Editor. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 10/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
A er we accomplished this step, we had to obtain the RDP server’s private key.
For our RDP server in this tutorial, we used another host running Windows 10 Pro. Then we extracted
the private key from the host’s opera ng system.
To ensure our second Windows host acted as an RDP server, we enabled RDP. To enable RDP on a
host running Windows 10 Pro, go to Windows Se ngs from the Start Menu, then select the System
icon as shown below in Figure 9.
Under the system se ngs, select Remote Desktop and click the switch for Enable Remote Desktop as
shown below in Figure 10.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 11/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
A er se ng up our second Windows host as an RDP server, we extracted the private key from its
opera ng system.
To extract the server key, we could either use either Jailbreak or Mimikatz. We chose Jailbreak.
Jailbreak is a tool by iSECPartners that can export the server's RDP cer ficate. From the exported
cer ficate, we could extract the private key.
To use Jailbreak, we downloaded the following Jailbreak binaires from this GitHub repository on our
newly established RDP server:
EasyHook64.dll
jailbreak64.exe
jailbreakhook64.dll
jbstore2_64.exe
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
Note: The above files were used on a Windows 10 Pro 64-bit host downloaded on March 4, 2021. A
acknowledge the use of cookies. Privacy statement
screenshot of the GitHub page is shown below in Figure 11.
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 12/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 13/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
In the command prompt, we went to the directory with the downloaded Jailbreak binaries. We ran the
following command from this directory:
See Figure 13 below for an example of running the 64-bit command on our Windows host ac ng as
the RDP server.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 14/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
This command opened the cer ficate manager for our local machine. From the le column, we
expanded Remote Desktop and went to the Cer ficates folder. This showed one cer ficate. If there had
been more than one cer ficate, we would have selected the one with the most recent expira on date.
We right-clicked on the cer ficate, selected All Tasks then used Export as shown below in Figure 14.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you
Figure 14. Expor ng the RDP cer ficate.
❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 15/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
When expor ng the cer ficate, we made sure to select the op on to export the private key as shown
below in Figure 15.
Figure 15. Ensuring the private key is exported with the cer ficate.
For our host, we could only export the cer ficate as a PKCS #12 (.PFX) file as shown below in Figure
16.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 16/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 16. Could only export the cer ficate as a .pfx file.
As shown below in Figure 17, the cer ficate had to have a password. Fortunately, we had no
complexity requirements, so we used a single le er as the password.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 17/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 17. The export process required a password for the cer ficate.
Finally, we exported our cer ficate with the private key as shown below in Figure 18.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 18/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
As an alterna ve, we could have extracted the server’s cer ficate using Mimikatz instead of Jailbreak.
The instruc ons for using Mimikatz to get the RDP server cer ficate are listed on GitHub.
Since our cer ficate was obtained using Jailbreak, we moved it to a Linux host and used OpenSSL to
extract the key. First, we used the following OpenSSL command to extract the key in PEM format:
To remove the passphrase form the key, we also used the following command:
This site uses cookies essential to its operation, for analytics, and for
openssl rsa -in server_key.pem -out server.key
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 19/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
This provided us with the RDP server’s private key as shown below in Figure 19.
Figure 19. Private server key extracted from the cer ficate.
Before we could use the private server key, we needed to record an RDP session between our two
Windows hosts and save it as a pcap.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 20/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 20. Using the Remote Desktop Connec on tool to log into our RDP server.
While the pcap was being recorded, we logged into DESKTOP-USER1PC and performed some basic
tasks like opening documents and web browsing.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 21/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
A er a minute or so, we logged off RDP and stopped recording network traffic from our VLAN.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 22/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 22. Filtering for RDP informa on, but no results, due to encrypted RDP traffic.
However, when we used our private server key to decrypt RDP traffic in Wireshark, the results looked
much different.
In Wireshark, we used the Preferences window and expanded the Protocols sec on as shown below in
Figure 23.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 23/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
With Wireshark 3.x, use the TLS entry. If you are using Wireshark 2.x, use the SSL entry. For this
sec on, there should be a bu on to edit the RSA keys list. We clicked the bu on and added the IP
address of the RDP server, the RDP port (3389) and the loca on of the private key file. Our example is
shown below in Figure 24.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 24/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 24. Go to the TLS sec on and add the private key to the RSA keys list.
A er Wireshark was set up to decrypt RDP traffic, we had much be er results when reviewing the
pcap.
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 25/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Figure 25. Viewing the same RDP ac vity a er the private key was loaded in Wireshark.
For security professionals who write signatures to find RDP vulnerabili es and a acks, the type of
informa on revealed above in Figure 25 is cri cal to their work.
Conclusion
This blog reviewed how to establish an environment to decrypt traffic from an RDP session. This is
easiest to do in a virtual LAN with two hosts running Windows 10 Professional. A er ensuring the
client did not use any forward secrecy ciphers, we extracted the private key from our Windows host
ac ng as the RDP server. Then we easily recorded a pcap of network traffic. A er the session finished,
we were able to decrypt RDP traffic using the server’s private key.
This type of environment can help security professionals when wri ng signatures to detect RDP
vulnerabili es and a acks.
Email address
Subscribe
By submi ng this form, you agree to our Terms of Use and acknowledge our Privacy Statement.
Popular Resources
Resource Center
Blog
Communi es
Tech Docs
This site uses cookies essential to its operation, for analytics, and for
Unit 42
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
Sitemap
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 27/28
4/3/2021 Wireshark Tutorial: Decrypting RDP Traffic
Legal Notices
Privacy
Terms of Use
Documents
Account
Report a Vulnerability
This site uses cookies essential to its operation, for analytics, and for
personalized content and ads. By continuing to browse this site, you ❯ Cookie Settings
acknowledge the use of cookies. Privacy statement
https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-rdp-traffic/ 28/28