Expand description
SMB2 request bodies and response parsers (MS-SMB2 §2.2). Offsets in the on-wire
*Offset fields are measured from the start of the SMB2 header (i.e. 64 + body_off).
Structs§
- DirEntry
- One entry from a directory enumeration (FileDirectoryInformation, class 1).
Constants§
- FILE_
DIRECTORY_ INFORMATION - FileDirectoryInformation class (§2.4.10) — the classic
name+attrs+size directory-enumeration info-class. Exposed publicly
in 0.2.4 (adopted from g0h4n’s PR #1) so downstream callers building
custom
query_directory_req-shaped requests do not have to remember the magic byte. Additional info classes (FileFullDirectoryInformation class 2, FileBothDirectoryInformation class 3, etc.) can be added alongside if needed. - FSCTL_
PIPE_ TRANSCEIVE
Functions§
- close_
req - SMB2 CLOSE (§2.2.15).
- create_
file - Generic disk-file CREATE (§2.2.13).
pathis relative to the connected share root (no leading backslash). Callers pass the access mask, share mode, disposition, and options. - create_
file_ id - FileId (16 bytes) from a CREATE response.
- create_
pipe - Open a named pipe (e.g. “samr”) on the IPC$ tree.
- ioctl_
output - Extract the pipe output (RPC response bytes) from an IOCTL response.
- ioctl_
transceive - Send
inputthrough the pipe and read the response in one round trip. - negotiate
- Offer dialect 2.1.0 with a random client GUID.
- parse_
directory_ info - Parse a QUERY_DIRECTORY response (§2.2.34) carrying FileDirectoryInformation entries. Bounds-checked and loop-bounded: a hostile server cannot drive an out-of-range read or a non-terminating walk (a NextEntryOffset that fails to advance, or an entry claiming a name longer than the buffer, ends parsing).
- query_
directory_ output - Raw output-buffer extractor for a QUERY_DIRECTORY response (§2.2.34).
Returns the whole info-class buffer as bytes; callers that want the
higher-level
Vec<DirEntry>decoding callparse_directory_infoinstead. Adopted from g0h4n’s PR #1 for 0.2.4 — useful when a caller wants to walk a non-FileDirectoryInformation info-class from the same wire framing. Bounds-checked: a truncated response returnsSmbError::Truncated, never panics through the direct-indexing helpers. - query_
directory_ req - SMB2 QUERY_DIRECTORY (§2.2.33): enumerate an open directory handle using
FileDirectoryInformation (class 1).
patternis the search wildcard (typically*); on continuation calls the server ignores it and resumes from where the handle left off, so passing*every time is correct. - read_
output - Extract the data returned by a READ response (§2.2.20).
- read_
req - SMB2 READ (§2.2.19): read
lengthbytes atoffsetfrom the open file. - session_
setup - The security buffer holds a raw NTLMSSP token.
- session_
setup_ token - Extract the security buffer (server NTLM token) from a SESSION_SETUP response.
- tree_
connect - write_
req - SMB2 WRITE (§2.2.21): write
datato the open handle atoffset.