Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMB Server fix filename offsets #1831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jborean93
Copy link

Correctly set the NextEntryOffset for the SMBFindFileNamesInfo results when querying the names of files. The current logic does not set this value so will be set to 0 making the client believe there are no more entries in the result if going by the MS-SMB2 logic.

The docs for FileNamesInformation state that NextEntryOffset should be

A 32-bit unsigned integer that contains the byte offset from the beginning of this entry, at which the next FILE_NAMES_INFORMATION entry is located, if multiple entries are present in a buffer. This member MUST be zero if no other entries follow this one. An implementation MUST use this value to determine the location of the next entry (if multiple entries are present in a buffer)

Currently you can see that while the reponse buffer contains all the entires, becaue NextEntryOffset is 0, consumers of this buffer only see the first entry when going by the MS-FSCC logic (0 is last entry)

image

After this change you can see the payload is correctly dissected by Wireshark

image

Correctly set the NextEntryOffset for the SMBFindFileNamesInfo results
when querying the names of files. The current logic does not set this
value so will be set to 0 making the client believe there are no more
entries in the result if going by the MS-SMB2 logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review This issue or pull request is being analyzed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants