IronRDP:一个使用Rust实现的微软RDP协议
IronRDP: a Rust implementation of Microsoft's RDP protocol

原始链接: https://github.com/Devolutions/IronRDP

IronRDP是一个Rust库集合,提供了一个安全的微软远程桌面协议(RDP)实现。它支持多种编解码器,包括未压缩原始位图、RLE、RDP 6.0压缩和RemoteFX (RFX)。 提供的资料包括: * 基于IronRDP库套件构建的完整异步RDP客户端示例。它使用非阻塞I/O,可以使用`cargo run --bin ironrdp-client`运行。 * 一个简化的同步示例,展示了IronRDP在阻塞方式下的使用方法。此示例建立RDP连接,解码图形更新,并将输出保存为BMP图像。可以使用`cargo run --example=screenshot`运行。 * 通过PowerShell命令或组策略设置在RDP服务器上启用RemoteFX的说明。 该代码库优先考虑安全,并利用Rust的内存安全特性。架构细节可以在ARCHITECTURE.md文档中找到。

Hacker News 上的一篇帖子讨论了 “IronRDP”,一个用 Rust 语言实现的微软远程桌面协议 (RDP)。评论者对该项目印象深刻,认为它有潜力成为 VNC 或 SPICE 的更高效替代方案,尤其是在 Proxmox 等环境中。其多平台支持(包括 Linux 和 Windows)也受到了关注。一些人指出 Fedora 最近采用了 RDP,在其安装程序中逐步淘汰了 VNC。该实现包括客户端和服务器组件,甚至还有一个用于连接到 RDP 服务器的 React 组件,以及一个基于 Avalonia 的 .NET 客户端。使用 Rust 被认为是朝着解决以前 RDP 实现中发现的安全漏洞迈出的积极一步。

原文

A collection of Rust crates providing an implementation of the Microsoft Remote Desktop Protocol, with a focus on security.

ironrdp-tauri-client-hackaton-result.mp4

Supported codecs:

  • Uncompressed raw bitmap
  • Interleaved Run-Length Encoding (RLE) Bitmap Codec
  • RDP 6.0 Bitmap Compression
  • Microsoft RemoteFX (RFX)

A full-fledged RDP client based on IronRDP crates suite, and implemented using non-blocking, asynchronous I/O.

cargo run --bin ironrdp-client -- <HOSTNAME> --username <USERNAME> --password <PASSWORD>

Example of utilizing IronRDP in a blocking, synchronous fashion.

This example showcases the use of IronRDP in a blocking manner. It demonstrates how to create a basic RDP client with just a few hundred lines of code by leveraging the IronRDP crates suite.

In this basic client implementation, the client establishes a connection with the destination server, decodes incoming graphics updates, and saves the resulting output as a BMP image file on the disk.

cargo run --example=screenshot -- --host <HOSTNAME> --username <USERNAME> --password <PASSWORD> --output out.bmp

How to enable RemoteFX on server

Run the following PowerShell commands, and reboot.

Set-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services' -Name 'ColorDepth' -Type DWORD -Value 5
Set-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services' -Name 'fEnableVirtualizedGraphics' -Type DWORD -Value 1

Alternatively, you may change a few group policies using gpedit.msc:

  1. Run gpedit.msc.

  2. Enable Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/RemoteFX for Windows Server 2008 R2/Configure RemoteFX

  3. Enable Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008 R2 SP1

  4. Enable Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/Limit maximum color depth

  5. Reboot.

See the ARCHITECTURE.md document.

联系我们 contact @ memedata.com