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 aLM:NTsecretsdump pair. - PowerShell
-EncodedCommandUTF-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_credsspandauth_kerberoson the type but returningError::Unsupported— see gaps below.
What does NOT work yet
- HTTP sign+seal (
multipart/encrypted; protocol="application/HTTP-SPNEGO-session-encrypted"). Blocks WinRM over 5985 whenAllowUnencrypted=false(Windows default). Use HTTPS (5986) meanwhile. - CredSSP transport — API surface exists, needs the sibling
credsspcrate to finish its pubKeyAuth seal/unseal step. - Kerberos — needs a picky-krb-style KDC client.
receive_streamreturns an immediately-empty stream (the drain loop needs sign+seal).upload_filereturnsUnsupportedfor the same reason.invoke_psruns the command but reports empty stdout / exit=0.
Minimal usage
use WinRmClient;
# async
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