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§
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_ 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.