decrypting rdp traffic with message analyzer · 2018. 10. 16. · message analyzer disadvantages...

56
Bryan S. Burgin Sr. Escalation Engineer, Developer Support, Open Specs Microsoft Corporation Decrypting RDP Traffic with Message Analyzer

Upload: others

Post on 25-Sep-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Bryan S. Burgin

Sr. Escalation Engineer, Developer Support, Open Specs

Microsoft Corporation

Decrypting RDP Traffic with Message Analyzer

Page 2: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Sr. EE, Developer Support, Protocols/Open Specifications/Interop13 years at Microsoft:

Primary duties:

www.microsoft.com/protocolswww.microsoft.com/openspecifications

Page 3: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

May 2012 (Taipei): Whiteboard discussion:

May/July 2012: “Hitchhiker’s Guide to Debugging RDP protocols” blog posts:

April 2013 (Taipei):

March 2014 (Taipei):

Page 4: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Viewing unencrypted, uncompressed RDP traffic Windows-to-Windows in both directions is difficult.

Viewing unencrypted traffic:

Page 5: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

To share a technique to observe Windows-to-Windows RDP traffic using Message Analyzer

Page 6: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Network Monitor/NmDecrypt advantages

Network Monitor/NmDecrypt disadvantages

Message Analyzer advantages

Message Analyzer disadvantages

Page 7: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

Close

Page 8: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 9: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Only needs to be done once in a lifetime.

Can be made on any machine.

Make a certificate using MAKECERT.

Export the cert to a Personal Informational Exchange (.PFX) file

Import/copy the certificate (via PFX) wherever it will be used:

Page 10: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 11: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 12: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Note: Do NOT check Network Level Authentication

Page 13: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Import certificate via Microsoft Management Console (MMC):

Page 14: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Double-click .PFX file

Page 15: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Run MMC, use Certificate plug-in for Local Computer

Find certificate in the local store

Right-click, All-Tasks, Manage Private Keys

Add NETWORK SERVICE

Page 16: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

To use the certificate, RDP needs to know the certificate’s SSL SHA1 HASH (a.k.a. Thumbprint):

For any given certificate, the HASH is always the same

Page 17: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Identify certificate’s SHA1 HASH to RDP

The RDP server will now use this certificate for encryption

Page 18: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Windows 7 ONLY; Windows 8 defaults are okay

Set HKLM\System\CCS\Control\Terminal Server\Winstations\RDP-Tcp:

Page 19: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Disable server-side compression (server-to-client packets):

Run GPEDIT, find:»Local Computer Policy»Computer Configuration»Administrative Templates»Windows Components»Remote Desktop Services»Remote Desktop Session Host»Remote Session Environment»Configure compression for RemoteFX data

Enable the policySet to “Do not use a compression algorithm”

Page 20: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

RDP8 will send/receive ~3000 frames to detect network conditions (bandwidth) at initial connect (RTT, Kb/sec):

Disabling bandwidth detection reduces overhead, yields smaller and faster traces

Solution: disable network bandwidth detection; via GPEdit»Local Computer Policy»Computer Configuration»Administrative Templates»Windows Components»Remote Desktop Services»Remote Desktop Session Host» Connections» Select network detection on the server

“Turn off Connect Time & Continuous NW Detect”

Page 21: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 22: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 23: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

If you want the client to use a specific compression algorithm:

Page 24: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Windows 8 uses TLS 1.2 by default

Message Analyzer does not decrypt TLS 1.2 frames (yet?)

Solution: downgrade to TLS 1.1 or 1.0

Consequence: Windows Update will stop working

Page 25: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

RDP 8 uses both TCP and UDP

Message Analyzer does not decrypt UDP/DTLS frames (yet)

Solution: Disable UDP; force TCP only

Page 26: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 27: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 28: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 29: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 30: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 31: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 32: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 33: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 34: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 35: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 36: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 37: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 38: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 39: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 40: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Work on improving the parsers:

Add support to decrypt TLS 1.2

Add support to decrypt DTLS and RDP over UDP Traffic

Page 41: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Escalation Engineer

Developer Support

Protocols/Open Specifications/Interoperability

8 years at Microsoft:

Page 42: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

• MS-RDPEUDP is a new protocol in RDP8 which use UDP as a transport and operates in 2 modes:

• Reliable (RDP-UDP-R)

• Best Effort/Lossy (RDP-UDP-L).

• RDP-UDP-R use TLS and RDP-UDP-L DTLS.

• Unique sockets for each instance.

• MS-RDPBCGR\MS-RDPEMT\MS-RDPEUDP

• FEC PDUs

• Optional.

• Safe to ignore and not generate.

• No capability to turn on/ off.

• !FEC - Recovery from packet loss will be compromised .

• RDPEUDP is preferred by default if both endpoints are RDP8 capable. This can be turned-off through Group policy

• Server : Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host: Select RDP

Transport Protocols to “Use both UDP and TCP”, “Use only TCP” and “Use Either TCP or UDP”

• Client : Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Connection Client: Turn off

UDP On Client

• Minencryption level (http://technet.microsoft.com/en-us/library/cc785662(v=ws.10).aspx ) MUST be set to 3 (TS_ENCRYPTION_LEVEL_HIGH) and Securitylayer to

2 (TS_SECURITY_LAYER_SSL) for RDPEUDP.

• Key differentiator from TLS over TCP

• TLS\DTLS packets over UDP are enveloped by RDPEUDP header.

Page 43: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

• Apply filter as TLS – Unencrypted handshake and encrypted data PDUs.

• NMDecrypt decrypts encrypted data PDUs.

Page 44: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

• Apply filter as TLS, profile windows – No data.

• Apply filter as RDPEUDP – Enveloped handshake and encrypted data PDUs.

• NMDecrypt can’t decrypt RDPEUDP data.

Page 45: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

• ‘’16 03 01” or “16 03 02” as starting bytes then it’s a packet.

• ‘’16 FE FF” as starting bytes then it’s a packet.

Page 46: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 47: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 48: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Make and export a certificate

Server-side preparation

Client-side preparation

Installing Message Analyzer

Capturing and analyzing traffic

What’s next

CloseDemo

References

Getting help

Page 49: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default
Page 50: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

www.microsoft.com/protocols

Raising protocol specification [email protected]

Open Specifications Team Bloghttp://blogs.msdn.com/b/openspecification

Channel9.MSDN.com

Page 51: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

How to get Message Analyzer

http://www.microsoft.com/en-us/download/details.aspx?id=40308

Page 52: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

E-mail [email protected]

1:1, private

Monitored by support 24x7

Issues acknowledged with in 24 hours

Post to a Microsoft Open Specifications Forum

1:many, public

Community of industry implementers

Moderated by Microsoft

Issues become support cases for tracking

Open Specifications Support is free

Page 53: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Clear problem description

Document short name (e.g. [MS-RDPEUSB])

Section (e.g. 2.2.4.1 Add Virtual Channel)

Doc version (e.g. v20110609)

Impact to your project (Blocking? Just feedback?)

Multiple issues: Provide priorities

Include sample files, traces, notes

Page 54: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Problems NOT related to the Open Specifications documentation:

If in doubt, ask.

Page 55: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Blog:http://blogs.technet.com/b/messageanalyzer/

Operating Guidehttp://blogs.technet.com/b/messageanalyzer/

Technet Forum:

Message Analyzer is NOT supported via Dochelp

Page 56: Decrypting RDP Traffic with Message Analyzer · 2018. 10. 16. · Message Analyzer disadvantages ... Set to “Do not use a compression algorithm ... Windows 8 uses TLS 1.2 by default

Q&A

http://www.microsoft.com/protocols

[email protected]