catalogue
1. Configure Server Authentication and Encryption Levels 2. Configure Network Level Authentication for Remote Desktop Services Connections 3. Configure Client Logon Information for Remote Desktop Services Connections 4. Configure Permissions for Remote Desktop Services Connections 5. SSL模式下记录RDP来源IP
1. Configure Server Authentication and Encryption Levels
此策略设置指定是否需要使用一个特定的安全层在远程桌面协议(RDP)连接期间保护的客户端和 RD 会话主机服务器之间的通信吗,如果启用此策略设置,客户端和 RD 会话主机服务器的远程连接期间的所有通信都必须都使用此设置中指定的安全方法。可用的是下列安全方法
1. 协商(默认设置): 协商方法强制执行的客户端程序支持的最安全方法 1) 如果客户端支持传输层安全(TLS)版本 1.0,它用于 RD 会话主机服务器验证身份(这种情况下system event log里未记录登录失败者的来源IP) 2) 如果客户端不支持 TLS,将采用RDP安全层进行加密 2. RDP security: RDP 方法使用本机 RDP 加密安全客户端和 RD 会话主机服务器之间的通信,在这个模式下,system event log里正常记录登录失败者的来源IP,我们可以通过syslogevent事件回调实时获取登录失败事件 3. SSL: SSL 方法要求使用 TLS 1.0 对会话主机服务器进行身份验证。如果不支持 TLS,则连接将失败
对应注册表项如下
RDP security Registry Hive HKEY_LOCAL_MACHINE Registry Path SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services Value Name SecurityLayer Value Type REG_DWORD Value 0 协商 Registry Hive HKEY_LOCAL_MACHINE Registry Path SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services Value Name SecurityLayer Value Type REG_DWORD Value 1 SSL Registry Hive HKEY_LOCAL_MACHINE Registry Path SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services Value Name SecurityLayer Value Type REG_DWORD Value 2
By default, Remote Desktop Services connections are encrypted at the highest level of security available. However, some older versions of the Remote Desktop Connection client do not support this high level of encryption. If your network contains such legacy clients, you can set the encryption level of the connection to send and receive data at the highest encryption level supported by the client.
Four encryption levels are available.
1. FIPS Compliant: This level encrypts and decrypts data sent from the client to the server and from the server to the client by using Federal Information Process Standard (FIPS) 140-1 validated encryption methods. Clients that do not support this level of encryption cannot connect. 2. High: This level encrypts data sent from the client to the server and from the server to the client by using 128-bit encryption. Use this level when the RD Session Host server is running in an environment containing 128-bit clients only (such as Remote Desktop Connection clients). Clients that do not support this level of encryption will not be able to connect. 3. Client Compatible(默认设置): This is the default setting. This level encrypts data sent between the client and the server at the maximum key strength supported by the client. Use this level when the RD Session Host server is running in an environment containing mixed or legacy clients. 4. Low: This level encrypts data sent from the client to the server by using 56-bit encryption. Data sent from the server to the client is not encrypted.
在默认情况下,在未配置的情况下由server和client协商使用最安全的通讯协议进行rdp登陆(协商模式),而协商的结果和client和server的os版本有关
gpedit.msc 打开 计算机配置->管理模板->windows组件->远程桌面服务->远程桌面会话主机->安全
若Client操作系统是Vista/Win7+,Server系统是Server2008以上,那么默认情况下都将会采用SSL方式验证
Relevant Link:
https://technet.microsoft.com/en-us/library/cc770833(v=ws.11).aspx http://winintro.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.TerminalServer::TS_SECURITY_LAYER_POLICY&Language=zh-cn https://rdpguard.com/windows-server-how-to-catch-failed-logons.aspx https://technet.microsoft.com/en-us/library/cc770833(v=ws.11).aspx https://technet.microsoft.com/en-us/magazine/ff458357.aspx
2. Configure Network Level Authentication for Remote Desktop Services Connections
3. Configure Client Logon Information for Remote Desktop Services Connections
4. Configure Permissions for Remote Desktop Services Connections
5. SSL模式下记录RDP来源IP
google上很多这种相似的问题,当用户配置SSL模式进行RDP验证,windows system eventlog就无法正常记录来源IP,这是因为
This is because client authenticating via network logon. 配置了SSL模式后,系统的验证将由网络验证模块完成,而不再通过RDP模块
0x1: 解决方法1
secpol.msc open Local Policies | Security Options set Network security: Restrict NTLM: Incoming NTLM traffic to Deny all accounts
0x2: 解决方法2
用ntlmssp api直接抓网络行为,因为RDP SSL是通过NTLM进行的网络层(4层)验证,并没有到应用层的RDP Services
0x3: 解决方法3
gpedit.msc 打开 计算机配置->管理模板->windows组件->远程桌面服务->远程桌面会话主机->安全 将远程(RDP)连接要求使用指定的安全层显式地修改为"RDP安全层"
0x4: wmi方式修改组策略
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetSecurityLayer(0) (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'")
0x5: 修改注册表
1. 导入注册表配置
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services] "SecurityLayer"=dword:00000000 //0代表RDP security
2. 用powershell修改注册表
Set-ItemProperty HKCU:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services SecurityLayer 0 -type REG_Dword
Relevant Link:
http://serverfault.com/questions/399878/security-log-in-event-viewer-does-not-store-ips http://wutils.com/wmi/root/cimv2/terminalservices/win32_tsgeneralsetting/#setsecuritylayer_methods http://wutils.com/wmi/root/cimv2/terminalservices/win32_tsgeneralsetting/#setsecuritylayer_methods http://www.2cto.com/Article/201505/402965.html https://msdn.microsoft.com/en-us/library/aa383640(v=vs.85).aspx http://wutils.com/wmi/root/cimv2/terminalservices/win32_tsaccount/vbscript-samples.html http://www.gszadc.com/6509226.html http://www.chipa.org/2015/11/remote-desktop-certificates-with-internal-enterprise-ca/ http://www.dotnetspider.com/attachments/Resources/16540-15624-wmi_terminalserver_scripts.htm http://www.cnblackhat.com/Article/201512/132400.html http://www.activexperts.com/admin/scripts/wmi/vbscript/0648/ https://gallery.technet.microsoft.com/Powershell-script-to-9d66257a http://www.lazywinadmin.com/2014/04/powershell-getset-network-level.html http://www.serhatakinci.com/index.php/windows-rdp-guvenligi.html
Copyright (c) 2016 LittleHann All rights reserved