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
| 190 | |
| 191 | |
| 192 | class 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 | |
| 228 | class SMB2SessionSetupRequest(Structure): |