1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="vrde-crypt">
|
---|
4 | <title>RDP Encryption</title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>
|
---|
8 | RDP features data stream encryption, which is based on the RC4
|
---|
9 | symmetric cipher, with keys up to 128-bit. The RC4 keys are
|
---|
10 | replaced at regular intervals, every 4096 packets.
|
---|
11 | </p>
|
---|
12 | <p>
|
---|
13 | RDP provides the following different authentication methods:
|
---|
14 | </p>
|
---|
15 | <ul>
|
---|
16 | <li>
|
---|
17 | <p><b outputclass="bold">RDP 4</b> authentication was
|
---|
18 | used historically. With RDP 4, the RDP client does not
|
---|
19 | perform any checks in order to verify the identity of the
|
---|
20 | server it connects to. Since user credentials can be
|
---|
21 | obtained using a man in the middle (MITM) attack, RDP4
|
---|
22 | authentication is insecure and should generally not be used.
|
---|
23 | </p>
|
---|
24 | </li>
|
---|
25 | <li>
|
---|
26 | <p><b outputclass="bold">RDP 5.1</b> authentication
|
---|
27 | employs a server certificate for which the client possesses
|
---|
28 | the public key. This way it is guaranteed that the server
|
---|
29 | possess the corresponding private key. However, as this
|
---|
30 | hard-coded private key became public some years ago, RDP 5.1
|
---|
31 | authentication is also insecure.
|
---|
32 | </p>
|
---|
33 | </li>
|
---|
34 | <li>
|
---|
35 | <p><b outputclass="bold">RDP 5.2 or later</b>
|
---|
36 | authentication uses Enhanced RDP Security, which means that
|
---|
37 | an external security protocol is used to secure the
|
---|
38 | connection. RDP 4 and RDP 5.1 use Standard RDP Security. The
|
---|
39 | VRDP server supports Enhanced RDP Security with TLS protocol
|
---|
40 | and, as a part of the TLS handshake, sends the server
|
---|
41 | certificate to the client.
|
---|
42 | </p>
|
---|
43 | <p> The <codeph>Security/Method</codeph> VRDE property sets the required security method,
|
---|
44 | which is used for a connection. Valid values are as follows: </p>
|
---|
45 | <ul>
|
---|
46 | <li>
|
---|
47 | <p><b outputclass="bold">Negotiate.</b> Both
|
---|
48 | Enhanced (TLS) and Standard RDP Security connections are
|
---|
49 | allowed. The security method is negotiated with the
|
---|
50 | client. This is the default setting.
|
---|
51 | </p>
|
---|
52 | </li>
|
---|
53 | <li>
|
---|
54 | <p><b outputclass="bold">RDP.</b> Only Standard RDP
|
---|
55 | Security is accepted.
|
---|
56 | </p>
|
---|
57 | </li>
|
---|
58 | <li>
|
---|
59 | <p><b outputclass="bold">TLS.</b> Only Enhanced RDP
|
---|
60 | Security is accepted. The client must support TLS.
|
---|
61 | </p>
|
---|
62 | <p>
|
---|
63 | The version of OpenSSL used by <ph conkeyref="vbox-conkeyref-phrases/product-name"/> supports
|
---|
64 | TLS versions 1.0, 1.1, 1.2, and 1.3.
|
---|
65 | </p>
|
---|
66 | </li>
|
---|
67 | </ul>
|
---|
68 | <p>
|
---|
69 | For example, the following command enables a client to use
|
---|
70 | either Standard or Enhanced RDP Security connection:
|
---|
71 | </p>
|
---|
72 | <pre xml:space="preserve">vboxmanage modifyvm <varname>VM-name</varname> --vrde-property "Security/Method=negotiate"</pre>
|
---|
73 | <p>
|
---|
74 | If the <codeph>Security/Method</codeph> property is set to
|
---|
75 | either Negotiate or TLS, the TLS protocol will be
|
---|
76 | automatically used by the server, if the client supports
|
---|
77 | TLS. However, in order to use TLS the server must possess
|
---|
78 | the Server Certificate, the Server Private Key and the
|
---|
79 | Certificate Authority (CA) Certificate. The following
|
---|
80 | example shows how to generate a server certificate.
|
---|
81 | </p>
|
---|
82 | <ol>
|
---|
83 | <li>
|
---|
84 | <p>
|
---|
85 | Create a CA self signed certificate.
|
---|
86 | </p>
|
---|
87 | <pre xml:space="preserve">openssl req -new -x509 -days 365 -extensions v3_ca \
|
---|
88 | -keyout ca_key_private.pem -out ca_cert.pem</pre>
|
---|
89 | </li>
|
---|
90 | <li>
|
---|
91 | <p>
|
---|
92 | Generate a server private key and a request for signing.
|
---|
93 | </p>
|
---|
94 | <pre xml:space="preserve">openssl genrsa -out server_key_private.pem
|
---|
95 | openssl req -new -key server_key_private.pem -out server_req.pem</pre>
|
---|
96 | </li>
|
---|
97 | <li>
|
---|
98 | <p>
|
---|
99 | Generate the server certificate.
|
---|
100 | </p>
|
---|
101 | <pre xml:space="preserve">openssl x509 -req -days 365 -in server_req.pem \
|
---|
102 | -CA ca_cert.pem -CAkey ca_key_private.pem -set_serial 01 -out server_cert.pem</pre>
|
---|
103 | </li>
|
---|
104 | </ol>
|
---|
105 | <p>
|
---|
106 | The server must be configured to access the required files.
|
---|
107 | For example:
|
---|
108 | </p>
|
---|
109 | <pre xml:space="preserve">vboxmanage modifyvm <varname>VM-name</varname> \
|
---|
110 | --vrde-property "Security/CACertificate=path/ca_cert.pem"</pre>
|
---|
111 | <pre xml:space="preserve">vboxmanage modifyvm <varname>VM-name</varname> \
|
---|
112 | --vrde-property "Security/ServerCertificate=path/server_cert.pem"</pre>
|
---|
113 | <pre xml:space="preserve">vboxmanage modifyvm <varname>VM-name</varname> \
|
---|
114 | --vrde-property "Security/ServerPrivateKey=path/server_key_private.pem"</pre>
|
---|
115 | </li>
|
---|
116 | </ul>
|
---|
117 | <p>
|
---|
118 | As the client that connects to the server determines what type
|
---|
119 | of encryption will be used, with <userinput>rdesktop</userinput>,
|
---|
120 | the Linux RDP viewer, use the <codeph>-4</codeph> or
|
---|
121 | <codeph>-5</codeph> options.
|
---|
122 | </p>
|
---|
123 | </body>
|
---|
124 |
|
---|
125 | </topic>
|
---|