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
| 255 | |
| 256 | |
| 257 | class 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 | |
| 290 | class SMB2TreeConnectRequest(Structure): |