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

Class SMB2SessionSetupResponse

pager_lib/smb/smb2_structs.py:257–287  ·  view source on GitHub ↗

Contains information about the SMB2_COM_SESSION_SETUP response from the server. If the message has no errors, each instance contains the following attributes: - session_flags (integer) - security_blob (string) References: =========== - [MS-SMB2]: 2.2.6

Source from the content-addressed store, hash-verified

255
256
257class SMB2SessionSetupResponse(Structure):
258 """
259 Contains information about the SMB2_COM_SESSION_SETUP response from the server.
260
261 If the message has no errors, each instance contains the following attributes:
262 - session_flags (integer)
263 - security_blob (string)
264
265 References:
266 ===========
267 - [MS-SMB2]: 2.2.6
268 """
269
270 STRUCTURE_FORMAT = "<HHHH"
271 STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT)
272
273 @property
274 def isGuestSession(self):
275 return (self.session_flags & 0x0001) > 0 # SMB2_SESSION_FLAG_IS_GUEST
276
277 @property
278 def isAnonymousSession(self):
279 return (self.session_flags & 0x0002) > 0 # SMB2_SESSION_FLAG_IS_NULL
280
281 def decode(self, message):
282 assert message.command == SMB2_COM_SESSION_SETUP
283
284 struct_size, self.session_flags, security_blob_offset, security_blob_len \
285 = struct.unpack(self.STRUCTURE_FORMAT, message.raw_data[SMB2Message.HEADER_SIZE:SMB2Message.HEADER_SIZE+self.STRUCTURE_SIZE])
286
287 self.security_blob = message.raw_data[security_blob_offset:security_blob_offset+security_blob_len]
288
289
290class SMB2TreeConnectRequest(Structure):

Callers 1

_decodeCommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected