winrm-pentest 0.1.0

Async WinRM 2.0 (WS-Management) client for offensive security — NTLM/Kerberos/CredSSP auth, remote PowerShell, encoded-command exec, SMB-free file upload. Cross-platform. Pre-alpha
Documentation

winrm-pentest

Crates.io Docs.rs License: MIT

Async WinRM 2.0 (WS-Management, MS-WSMV) client for offensive-security work in Rust. NTLM / Kerberos / CredSSP auth, remote PowerShell shells, -EncodedCommand execution, streaming stdout, and SMB-free file upload via base64-chunked <rsp:Send>. Cross-platform reboot of the Evil-WinRM surface, minus the Ruby.

Status

0.1.0-dev — pre-alpha, expect breaking changes before 0.1.0. Part of the icedracon Rust offensive AD ecosystem.

What it does

Talks WS-Management directly over HTTP(S) — no winrs.exe, no PowerShell Remoting on the client side, no OpenSSH. Byte-deterministic WSMan envelope builders (Create / Command / Send / Receive / Signal / Delete) sit under a small [WinRmClient] surface, driven by a full three-legged HTTP-Negotiate NTLM handshake (via [ntlmssp]) with native support for pass-the-hash from a 32-hex NT hash or a LM:NT secretsdump pair.

Because it is Rust reqwest + tokio on top, it runs on Linux and macOS as well as Windows — an authenticated pivot from a non-Windows attacker box.

Usage

use winrm_pentest::WinRmClient;

# async fn demo() -> winrm_pentest::Result<()> {
let mut cli = WinRmClient::connect("dc01.lab.local", 5986, true).await?;
cli.auth_ntlm("LAB\\Administrator", "P@ssw0rd!").await?;   // password OR NT hash
let sh  = cli.open_shell().await?;
let cmd = cli.run_command(&sh, "whoami", &[]).await?;
let _   = cli.receive_stream(&cmd).await?;                 // empty stream until sign+seal lands
cli.close_shell(&sh).await?;
# Ok(()) }

Pass-the-hash — call auth_ntlm with a 32-hex NT hash (or LM:NT) as the password argument; the NTLMSSP driver treats it as an NT-hash secret rather than hashing it again.

What works / what does not (this version)

  • Working: byte-deterministic WSMan envelope builders (round-trip tested); full NTLM Negotiate → Challenge → Authenticate over HTTP, including PtH from nthash or LM:NT; PowerShell -EncodedCommand UTF-16LE helper + deflate-then-b64 payload for scripts that overflow the 512 KB envelope cap; stable [WinRmClient] API surface.
  • Stubbed: HTTP sign+seal (multipart/encrypted; protocol="application/HTTP-SPNEGO-session-encrypted") — blocks WinRM over plaintext 5985 when AllowUnencrypted=false (Windows default). Use HTTPS (5986) meanwhile. receive_stream returns an immediately-empty stream; upload_file returns Error::Unsupported; invoke_ps runs the command but reports empty stdout / exit=0 until the sign+seal layer lands.
  • Not yet: full CredSSP transport (the sibling credssp crate wires up the pump; WSMV encryption on top is still open); Kerberos ticket transport (needs a picky-krb-style KDC client — will land with ms-kile).

Everything above the "working" line is fair game to fail on non-toy targets.

Dependency posture

S-tier. Nine runtime deps total: ntlmssp, credssp (sibling path), reqwest (rustls-tls only), tokio, quick-xml, base64, flate2, futures-util, thiserror. No serde, no serde-xml-rs, no uuid crate — WSMan envelopes are hand-rolled strings and UUIDv4s are 20 LOC.

Related icedracon crates

  • windows-wmi-com — in-process WMI via COM (~10x faster than DCOM-over-RPC for local queries).
  • windows-eventlog-native — live EvtQuery/EvtSubscribe wrapper for Security/System/Application channels.

Cluster: Windows-native higher-level admin surfaces. winrm-pentest is the cross-platform remoting piece; the other two are cfg(windows)-only local telemetry.

License

MIT (c) 2026 zevs