Skip to main content

Module msg

Module msg 

Source
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§

FSCTL_PIPE_TRANSCEIVE

Functions§

close_req
SMB2 CLOSE (§2.2.15).
create_file
Generic disk-file CREATE (§2.2.13). path is 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 input through 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). pattern is 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 length bytes at offset from 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 data to the open handle at offset.