MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / SMB2NegotiateResponse

Class SMB2NegotiateResponse

pager_lib/smb/smb2_structs.py:192–225  ·  view source on GitHub ↗

Contains information on the SMB2_NEGOTIATE response from server After calling the decode method, each instance will contain the following attributes, - security_mode (integer) - dialect_revision (integer) - server_guid (string) - max_transact_size (integer) - max_read_s

Source from the content-addressed store, hash-verified

190
191
192class SMB2NegotiateResponse(Structure):
193 """
194 Contains information on the SMB2_NEGOTIATE response from server
195
196 After calling the decode method, each instance will contain the following attributes,
197 - security_mode (integer)
198 - dialect_revision (integer)
199 - server_guid (string)
200 - max_transact_size (integer)
201 - max_read_size (integer)
202 - max_write_size (integer)
203 - system_time (long)
204 - server_start_time (long)
205 - security_blob (string)
206
207 References:
208 ===========
209 - [MS-SMB2]: 2.2.4
210 """
211
212 STRUCTURE_FORMAT = "<HHHH16sIIIIQQHHI"
213 STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT)
214
215 def decode(self, message):
216 assert message.command == SMB2_COM_NEGOTIATE
217
218 if message.status == 0:
219 struct_size, self.security_mode, self.dialect_revision, _, self.server_guid, self.capabilities, \
220 self.max_transact_size, self.max_read_size, self.max_write_size, self.system_time, self.server_start_time, \
221 security_buf_offset, security_buf_len, _ = struct.unpack(self.STRUCTURE_FORMAT, message.raw_data[SMB2Message.HEADER_SIZE:SMB2Message.HEADER_SIZE+self.STRUCTURE_SIZE])
222
223 self.server_start_time = convertFILETIMEtoEpoch(self.server_start_time)
224 self.system_time = convertFILETIMEtoEpoch(self.system_time)
225 self.security_blob = message.raw_data[security_buf_offset:security_buf_offset+security_buf_len]
226
227
228class SMB2SessionSetupRequest(Structure):

Callers 1

_decodeCommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected