At this point, there is an open channel between the client and server. Next, the client sends a message to the server to negotiate an SMB protocol. As mentioned earlier, the client sets its tree identifier (TID) field to zero, since it does not yet know what TID to use. A
tree identifier is a number that represents a connection to a share on a server.
The command in the message is
SMBnegprot
, a request to negotiate a protocol variant that will be used for the entire session. Note that the client sends to the server a list of all of the variants that it can speak, not vice versa.
The server responds to the
SMBnegprot
request with an index into the list of variants that the client offered, starting with index 0, or with the value 0xFF if none of the protocol variants are acceptable. Continuing this example, the server responds with the value 5, which indicates that the
NT
LM
0.12
dialect will be used for the remainder of the session:
>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=154
SMB PACKET: SMBnegprot (REQUEST)
SMB Command = 0x72
Error class = 0x0
Error code = 0
Flags1 = 0x0
Flags2 = 0x0
Tree ID = 0
Proc ID = 5371
UID = 0
MID = 385
Word Count = 0
Dialect=PC NETWORK PROGRAM 1.0
Dialect=MICROSOFT NETWORKS 3.0
Dialect=DOS LM1.2X002
Dialect=DOS LANMAN2.1
Dialect=Windows for Workgroups 3.1a
Dialect=NT LM 0.12
>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=69
SMB PACKET: SMBnegprot (REPLY)
SMB Command = 0x72
Error class = 0x0
Error code = 0
Flags1 = 0x0
Flags2 = 0x1
Tree ID = 0
Proc ID = 5371
UID = 0
MID = 385
Word Count = 02
[000] 05 00