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

Class SMB2SessionSetupRequest

pager_lib/smb/smb2_structs.py:228–254  ·  view source on GitHub ↗

References: =========== - [MS-SMB2]: 2.2.5

Source from the content-addressed store, hash-verified

226
227
228class SMB2SessionSetupRequest(Structure):
229 """
230 References:
231 ===========
232 - [MS-SMB2]: 2.2.5
233 """
234
235 STRUCTURE_FORMAT = "<HBBIIHHQ"
236 STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT)
237
238 def __init__(self, security_blob):
239 self.security_blob = security_blob
240
241 def initMessage(self, message):
242 Structure.initMessage(self, message)
243 message.command = SMB2_COM_SESSION_SETUP
244
245 def prepare(self, message):
246 message.data = struct.pack(self.STRUCTURE_FORMAT,
247 25, # Structure size. Must be 25 as mandated by [MS-SMB2] 2.2.5
248 0, # VcNumber
249 0x01, # Security mode
250 0x00, # Capabilities
251 0, # Channel
252 SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE,
253 len(self.security_blob),
254 0) + self.security_blob
255
256
257class SMB2SessionSetupResponse(Structure):

Calls

no outgoing calls

Tested by

no test coverage detected