RdpVerify.Lib
1.2.2
dotnet add package RdpVerify.Lib --version 1.2.2
NuGet\Install-Package RdpVerify.Lib -Version 1.2.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RdpVerify.Lib" Version="1.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RdpVerify.Lib" Version="1.2.2" />
<PackageReference Include="RdpVerify.Lib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RdpVerify.Lib --version 1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RdpVerify.Lib, 1.2.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RdpVerify.Lib@1.2.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RdpVerify.Lib&version=1.2.2
#tool nuget:?package=RdpVerify.Lib&version=1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NewRDP — RDP 远程桌面账号密码验证
纯托管(.NET 10)实现的 RDP 凭据验证工具与组件库,无第三方依赖。用于授权安全审计、资产巡检场景下批量验证 RDP 账号密码有效性。
⚠️ 本工具仅供授权的安全测试与运维审计使用,请勿用于未授权目标。
支持范围
- 现代系统(Windows Server 2008 ~ 最新 Windows):X.224 协商 → TLS 1.0/1.1/1.2/1.3 → CredSSP (NLA) → NTLMv2 验证
- 旧系统(Windows Server 2003 / XP):经典 X.224 → 传统 RDP 安全层(RSA-512 + RC4)→ 自动登录 → SAVE_SESSION_INFO 判定
- 不支持:XRDP、Windows 2000、空密码、Windows Hello/PIN 凭据
项目结构
| 项目 | 说明 |
|---|---|
RdpVerify.Lib |
核心验证库(NuGet 包:RdpVerify.Lib) |
RdpVerify |
命令行工具(单机 / 批量验证) |
RdpVerify.Tests |
xUnit 测试(108 个单元测试 + 9 个环境变量门控的真机集成测试) |
安装(NuGet)
dotnet add package RdpVerify.Lib
快速开始
using RdpVerify;
var result = await RdpVerifier.CheckAsync("192.168.3.70", "test", "aa@12345");
Console.WriteLine(result); // "Valid: 凭据有效(NTLM 验证通过,pubKeyAuth 回显确认)"
可选参数通过 RdpCheckOptions 覆盖(端口、域、超时、日志、严格模式、NT 哈希 PtH、证书校验钩子等均有默认值)。
CheckStatus 判定结果:Valid(凭据正确)/ Invalid(凭据错误)/ Disabled(账户被策略限制)/ NoNla(服务器未启用 NLA,无法非交互判定)/ Error(网络或协议错误)。
版本亮点
v1.2.1
- 传统安全层(2003/XP)模态弹窗自动消除(
LegacyDismissPrompts,默认开启):"密码即将到期"等 winlogon 模态框不再导致正确密码被误判 Invalid - 附带收益:2003/XP 错误密码约 6 秒触发服务器单会话失败上限被主动断连(原需等满 15s 判定窗口,提速 ~60%)
- 注意:该机制每次错误验证会产生 3~5 条失败登录日志,目标设有账户锁定阈值时请控制验证总量
v1.2.0:全异步 I/O、NT 哈希验证(PtH)、证书校验钩子、敏感材料清零、主机缓存上限、SourceLink 符号包
v1.1.0:RdpCheckOptions 选项对象 + 便捷重载、judgeWaitMs 自动取值
批量验证注意事项
- 判定等待(
judgeWaitMs):NLA 主机(2008+)实际 ~20ms 返回;2003/XP 需 15000,过短会把正确密码误判为失败。混合批量统一 15000 即可。 - 单主机并发:传统安全层主机(2003/XP)实测 ≤5 安全(吞吐约 3 倍于串行),10 并发会使 winlogon 饱和导致正确密码漏判;NLA 主机无此限制。
命令行工具
# 单机验证
dotnet run --project RdpVerify -- 192.168.3.70 test aa@12345
# 批量验证(每行:host user password)
dotnet run --project RdpVerify -- --batch targets.txt -c 8 -hc 2
文档
完整的 API 说明、参数取值建议、批量并发示例、底层构件(NTLM/CredSSP/DER/TLS 1.0)用法见 RdpVerify.Lib/API.md。
运行测试
# 单元测试(无需真机)
dotnet test RdpVerify.Tests -c Release --filter "FullyQualifiedName!~IntegrationTests"
# 集成测试(需真机 + 环境变量门控,未设置自动跳过)
$env:RDP_TEST_HOST = "192.168.3.70"; $env:RDP_TEST_USER = "test"; $env:RDP_TEST_PASS = "aa@12345"
dotnet test RdpVerify.Tests -c Release --filter "FullyQualifiedName~IntegrationTests"
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.