ntlmssp
A pure-Rust, no-FFI implementation of Windows NTLM / NTLMSSP (MS-NLMP): the
NEGOTIATE / CHALLENGE / AUTHENTICATE token exchange with NTLMv2, the message-integrity
code (MIC), key exchange, and RC4 sign+seal for message privacy. No windows crate, no
SSPI — so you can perform NTLM authentication from Linux/macOS to drive SMB, HTTP, or
DCE/RPC.
Features
- Build the three NTLMSSP messages (Type 1/2/3) with NTLMv2, target-info, and the MIC.
- Authenticate from a password or directly from an NT hash (pass-the-hash).
SealState: RC4-based per-message sign+seal (the sealed-RPC / packet-privacy primitive), with directional keys derived from the exported session key.- Parse a server CHALLENGE (Type 2) into its fields (server challenge, target info).
- Crypto building blocks:
md4,nt_owf_v2, and a NetNTLMv2 extractor (netntlmv2_from_type3) that yields a hashcat-m 5600string from a captured Type 3. - Verified against the MS-NLMP §4.2.4 NTLMv2 test vector.
Example
use Ntlm;
let mut ntlm = new;
let type1 = ntlm.negotiate; // → send to server
// ... receive the server's Type 2 CHALLENGE bytes ...
let =
ntlm.authenticate?;
// send `type3`; use `session_key` for SMB/RPC signing.
Pass-the-hash:
let =
ntlm.authenticate_hash?;
Scope
Client-side NTLMSSP (NTLMv2) + the sign/seal state machine, plus enough server-side helpers
(build_challenge, netntlmv2_from_type3) to stand up a capture/relay endpoint. NTLMv1 and
LM responses are intentionally not produced (NTLMv2 only).
License
MIT © icedracon. Extracted from ADhammer.