Expand description
ms-tds — pure-Rust TDS 7.4 client for Microsoft SQL Server.
§STATUS: pre-alpha
Compile-clean skeleton with partial implementation:
- TDS packet framing (header + segmentation across
packet_size) - PreLogin token round-trip
- TLS-in-TDS handshake tunneling —
TlsTunnelwraps rustls handshake records inside TDS PRELOGIN packets and flips to passthrough afterwards, so an encrypted SQL Server (“Encrypt = yes / Force Encryption”) accepts the login. Post-handshake, TDS packet framing rides on top of the TLS layer unchanged. - Login7 with NTLM SSPI blob wrapping (INTEGRATED_SECURITY)
TdsClientconnect/login_ntlm/sql_batch— the wire is driven but ROW / COLMETADATA decoding is not implemented, sosql_batchreturns an emptyResultSeteven when the server sends rows.
§Minimal usage sketch
let mut c = ms_tds::TdsClient::connect("sql01", 1433, None).await?;
c.login_ntlm("CORP", "svc_scan", "pw").await?;
let _ = c.sql_batch(ms_tds::pentest::enum_linked_servers()).await?;Re-exports§
pub use client::Column;pub use client::ResultSet;pub use client::Row;pub use client::TdsClient;pub use error::Error;pub use error::Result;pub use tls_tunnel::TlsTunnel;pub use tls_tunnel::TunnelMode;pub use transport::AsyncStream;pub use transport::Transport;
Modules§
- client
- High-level TDS 7.4 client.
- error
- login7
- Login7 packet (MS-TDS §2.2.6.4). Strings are UTF-16LE; the password field uses the trivial “nibble-swap ^ 0xA5” obfuscation.
- packet
- TDS packet framing (MS-TDS §2.2.3).
- pentest
- Pentest primitives — SQL string builders for offensive TDS work.
- prelogin
- PreLogin token stream (MS-TDS §2.2.6.5). Client and server both send this shape.
- tls
- TLS-in-TDS handshake driver.
- tls_
tunnel - TLS-in-TDS handshake tunneling wrapper (MS-TDS §3.3.5.1).
- token
- Token stream (MS-TDS §2.2.5). Skeleton reader — recognizes token kinds and their length prefixes so the caller can walk the stream, but does not decode ROW / COLMETADATA yet (that needs the full type-info decoder — future work).
- transport
- Async transport with TDS packet framing.