smb2-client 0.2.4

Minimal async SMB2 client in pure Rust: negotiate, NTLMv2 (SPNEGO) session setup, message signing (HMAC-SHA256 / AES-CMAC), tree connect, named-pipe and file I/O — no FFI.
Documentation

smb2-client

crates.io docs.rs License: MIT

A minimal, async, pure-Rust SMB2 clientno FFI, no windows crate — so it connects to Windows file servers from any platform. Built on ntlmssp for authentication.

Features

  • SMB2 NEGOTIATE (multi-dialect: 2.0.2 → 3.x) and NTLMv2 session setup wrapped in SPNEGO, from a password or an NT hash (pass-the-hash).
  • Message signing: HMAC-SHA256 (SMB 2.x) and AES-CMAC (SMB 3.0.x), with the SP800-108 KDF.
  • TREE_CONNECT, named-pipe open/read/write (the transport under DCE/RPC-over-SMB), and disk-file read (for pulling command output back over C$).
  • A small SMB2 server side (server) sufficient to stand up an NTLM capture endpoint.

Example

use smb2_client::SmbClient;

# async fn run() -> Result<(), Box<dyn std::error::Error>> {
let mut c = SmbClient::connect("fileserver:445").await?;
c.login("fileserver", "CORP", "alice", "P@ssw0rd").await?;
c.tree_connect(r"\\fileserver\IPC$").await?;
let pipe = c.open_pipe("srvsvc").await?;   // now drive DCE/RPC over the pipe
# Ok(()) }

Pairs with dcerpc for SAMR / LSAT / DRSUAPI etc. over the named-pipe transport — together they're the "spec-vector captures for Rust" that didn't previously exist.

Scope

Client-focused SMB2 for automation/tooling (auth, signing, pipes, file read). Not a general file-server or a full SMB3 encryption implementation. NTLMv2 only (no NTLMv1/LM).

License

MIT © icedracon. Extracted from ADhammer.