Search code examples
c++smbcifs

What should I set my TID to in an SMB header if I haven't established a tree connect?


When I'm building a smb packet, what should the header TID be set to if I haven't established a tree connect yet? I'm trying to do a dfs referral. I don't want to do the tree connect until after I've done the dfs referral and picked a domain controller to talk to. I'm getting a STATUS_SMB_BAD_TID status response.

I'm writing in c++. The code is really too extensive to show any examples here, but here's the smb header that I'm getting back:

$3 = {SmbCommand = 50 '2', Status = 327682, Flags = 128 '\200', Flags2 = 2113, PidHigh = 0, SecuritySignature = "\003\000\000\000\000\000\000", Tid = 0, Pid = 5906, Uid = 26625, Mid = 1}

Solution

  • This situation is only possible on Negotiate or SessionSetup. Both expect a zero value but I do not believe that any implementation checks that.