samr
MS-SAMR (Security Account Manager Remote Protocol) client for Rust — full DCE/RPC surface for enumerating users, groups, domains, aliases and local administrators over the \PIPE\samr named pipe. Part of the icedracon offensive-AD ecosystem, extracted from dcerpc.
Status
0.1.0 — first stable release. Encoders and decoders live-validated against Windows Server 2016 → 2025. Wire byte-shape matches the spec samr.* NDR marshaling.
What it does
MS-SAMR is the RPC-over-SMB protocol Windows exposes for SAM database access. This crate wraps the opcode set relevant to offensive/defensive tooling:
| Opcode | Purpose |
|---|---|
SamrConnect2 (57) / SamrConnect5 (64) |
Open a handle to the SAM server. |
SamrLookupDomainInSamServer (5) |
Domain name → SID. |
SamrEnumerateDomainsInSamServer (6) |
Iterate domains on the server. |
SamrOpenDomain (7) |
Handle-open on a domain SID. |
SamrEnumerateUsersInDomain (13) |
RID + sAMAccountName pairs. |
SamrCloseHandle (1) |
Release any of the above handles. |
Usage
# async
Related icedracon crates
dcerpc— sealed DCE/RPC transport this crate rides onsmb2-client— SMB2 named-pipe transportntlmssp— NTLM sealed bind for authenticated pipeswindows-sddl— SID / SDDL used in the domain-lookup response- ADhammer — the AD security-assessment toolkit that originally shipped this code before extraction
Comparison
ms-samr(zer1t0, 6836 dl) — data-types only, no RPC surface.- This crate — full client with encoders + decoders for the enum/lookup/open flow, ready to plug into a
dcerpc::SmbPipe.
License
MIT © 2026 zevs