配置远程桌面(RDP)服务连接的安全设置

admin 2025年2月11日17:08:53评论32 views字数 3855阅读12分51秒阅读模式
远程桌面服务是Windows操作系统的一个重要功能,广泛应用于企业和个人用户的日常工作中。它允许用户从其他设备连接到远程计算机,进行文件传输和远程操作。然而,隐藏在其背后的安全隐患却让人不得不警惕。漏洞的存在意味着,如果攻击者能够获得某种程度的接入,就能远程控制受影响的系统,甚至可以获取机密数据。这不仅对个人信息安全造成威胁,更可能对企业的商业机密、客户资料等产生深远的影响。
配置远程桌面(RDP)服务连接的安全设置
catalogue
1. Configure Server Authentication and Encryption Levels2. Configure Network Level Authentication for Remote Desktop Services Connections3. Configure Client Logon Information for Remote Desktop Services Connections4. Configure Permissions for Remote Desktop Services Connections5. 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 securityRegistry Hive    HKEY_LOCAL_MACHINERegistry Path    SOFTWAREPoliciesMicrosoftWindows NTTerminal ServicesValue Name    SecurityLayerValue Type    REG_DWORDValue    0协商 Registry Hive    HKEY_LOCAL_MACHINERegistry Path    SOFTWAREPoliciesMicrosoftWindows NTTerminal ServicesValue Name    SecurityLayerValue Type    REG_DWORDValue    1SSL Registry Hive    HKEY_LOCAL_MACHINERegistry Path    SOFTWAREPoliciesMicrosoftWindows NTTerminal ServicesValue Name    SecurityLayerValue Type    REG_DWORDValue    2

默认情况下,远程桌面服务连接以可用的最高安全级别进行加密。但是,一些旧版本的远程桌面连接客户端不支持这种高级别的加密。如果您的网络包含此类传统客户端,则可以设置连接的加密级别,以客户端支持的最高加密级别发送和接收数据。

有四种加密级别可供选择。

1. FIPS Compliant: This level encrypts and decrypts data sent from the client to the server andfrom the server to the client byusing Federal Information Process Standard (FIPS) 140-1 validated encryption methods. Clients that donot support this level of encryption cannot connect.2. High: This level encrypts data sent from the client to the server andfrom the server to the client byusing 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 donot 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 byusing 56-bit encryption. Data sent from the server to the client isnot encrypted.
在默认情况下,在未配置的情况下由server和client协商使用最安全的通讯协议进行rdp登陆(协商模式),而协商的结果和client和server的os版本有关
gpedit.msc 打开  计算机配置->管理模板->windows组件->远程桌面服务->远程桌面会话主机->安全
配置远程桌面(RDP)服务连接的安全设置
若Client操作系统是Vista/Win7+,Server系统是Server2008以上,那么默认情况下都将会采用SSL方式验证

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

用ntlmssp api直接抓网络行为,因为RDP SSL是通过NTLM进行的网络层(4层)验证,并没有到应用层的RDP Services

0x3: 解决方法3

gpedit.msc 打开  计算机配置->管理模板->windows组件->远程桌面服务->远程桌面会话主机->安全将远程(RDP)连接要求使用指定的安全层显式地修改为"RDP安全层"
0x4: wmi方式修改组策略
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace rootcimv2terminalservices -Filter "TerminalName='RDP-tcp'").SetSecurityLayer(0(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace rootcimv2terminalservices -Filter "TerminalName='RDP-tcp'")

0x5: 修改注册表

1. 导入注册表配置

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindows NTTerminal Services]"SecurityLayer"=dword:00000000//0代表RDP security
2. 用powershell修改注册表
Set-ItemPropertyHKCU:SOFTWAREPoliciesMicrosoftWindowsNTTerminalServicesSecurityLayer0 -type REG_Dword 

原文始发于微信公众号(三沐数安):配置远程桌面(RDP)服务连接的安全设置

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年2月11日17:08:53
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   配置远程桌面(RDP)服务连接的安全设置https://cn-sec.com/archives/3727966.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息