winrm-pentest 0.1.0-dev

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

winrm-pentest

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

STATUS: pre-alpha (0.1.0-dev, NOT publishable)

Compile-clean skeleton with:

  • Byte-deterministic WSMan envelope builders for Create / Command / Send / Receive / Signal / Delete (all covered by a round-trip test).
  • Full three-legged HTTP-Negotiate NTLM handshake (Negotiate → Challenge → Authenticate) driven off ntlmssp, including pass-the-hash from a 32-hex NT hash or a LM:NT secretsdump pair.
  • PowerShell -EncodedCommand UTF-16LE helper + a deflate-then-b64 payload for scripts that overflow the 512 KB envelope cap.
  • Public API stable at [WinRmClient]: connect, auth_ntlm, open_shell, run_command, receive_stream, invoke_ps, upload_file, close_shell.
  • auth_credssp and auth_kerberos on the type but returning Error::Unsupported — see gaps below.

What does NOT work yet

  • HTTP sign+seal (multipart/encrypted; protocol="application/HTTP-SPNEGO-session-encrypted"). Blocks WinRM over 5985 when AllowUnencrypted=false (Windows default). Use HTTPS (5986) meanwhile.
  • CredSSP transport — API surface exists, needs the sibling credssp crate to finish its pubKeyAuth seal/unseal step.
  • Kerberos — needs a picky-krb-style KDC client.
  • receive_stream returns an immediately-empty stream (the drain loop needs sign+seal). upload_file returns Unsupported for the same reason. invoke_ps runs the command but reports empty stdout / exit=0.

Minimal 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?; // or an NT hash
let sh = cli.open_shell().await?;
let cmd = cli.run_command(&sh, "whoami", &[]).await?;
let _ = cli.receive_stream(&cmd).await?; // empty stream today
cli.close_shell(&sh).await?;
# Ok(()) }

Deps

S-tier posture. 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, no uuid crate — WSMan envelopes are hand-rolled strings, UUIDv4s are 20 LOC.

License

MIT