11#ifndef __PACKET_SMB2_H__
12#define __PACKET_SMB2_H__
14#include "packet-dcerpc.h"
15#include "packet-smb.h"
16#include "packet-ntlmssp.h"
21WS_DLL_PUBLIC value_string_ext smb2_cmd_vals_ext;
42 uint64_t fid_persistent;
43 uint64_t fid_volatile;
55 uint32_t desired_access;
56 uint32_t granted_access;
69 uint32_t frame_req, frame_res;
72 uint32_t cancelled_in;
74 uint8_t *preauth_hash_req, *preauth_hash_res;
75 smb2_fid_info_t *file;
81 smb2_extra_info_t extra_info_type;
88 const uint8_t *filename;
94 uint32_t status_pending_in;
95 uint32_t cancel_req_in;
97 smb2_saved_info_t *ssi_parent;
102 uint32_t connect_frame;
103 uint32_t disconnect_frame;
108#define SMB2_PREAUTH_HASH_SIZE 64
109#define AES_KEY_SIZE 16
117 uint16_t server_port;
118 uint32_t session_key_frame;
119 unsigned session_key_len;
120 uint8_t session_key[NTLMSSP_KEY_LEN*2];
121 uint8_t signing_key[NTLMSSP_KEY_LEN];
122 uint8_t client_decryption_key16[AES_KEY_SIZE];
123 uint8_t server_decryption_key16[AES_KEY_SIZE];
124 uint8_t client_decryption_key32[AES_KEY_SIZE*2];
125 uint8_t server_decryption_key32[AES_KEY_SIZE*2];
132 uint8_t preauth_hash[SMB2_PREAUTH_HASH_SIZE];
140 GHashTable *unmatched;
143 GHashTable *asy_cancels;
157 uint8_t *preauth_hash_current;
158 uint8_t preauth_hash_con[SMB2_PREAUTH_HASH_SIZE];
159 uint8_t preauth_hash_ses[SMB2_PREAUTH_HASH_SIZE];
167#define SMB2_FLAGS_RESPONSE 0x00000001
168#define SMB2_FLAGS_ASYNC_CMD 0x00000002
169#define SMB2_FLAGS_CHAINED 0x00000004
170#define SMB2_FLAGS_SIGNATURE 0x00000008
171#define SMB2_FLAGS_PRIORITY_MASK 0x00000070
172#define SMB2_FLAGS_DFS_OP 0x10000000
173#define SMB2_FLAGS_REPLAY_OPERATION 0x20000000
175#define SMB2_FLAGS_PRIORITY1 0x00000010
176#define SMB2_FLAGS_PRIORITY2 0x00000020
177#define SMB2_FLAGS_PRIORITY3 0x00000030
178#define SMB2_FLAGS_PRIORITY4 0x00000040
179#define SMB2_FLAGS_PRIORITY5 0x00000050
180#define SMB2_FLAGS_PRIORITY6 0x00000060
181#define SMB2_FLAGS_PRIORITY7 0x00000070
184#define SMB2_FLAGS_ATTR_ENCRYPTED 0x00004000
185#define SMB2_FLAGS_ATTR_INDEXED 0x00002000
186#define SMB2_FLAGS_ATTR_OFFLINE 0x00001000
187#define SMB2_FLAGS_ATTR_COMPRESSED 0x00000800
188#define SMB2_FLAGS_ATTR_REPARSEPOINT 0x00000400
189#define SMB2_FLAGS_ATTR_SPARSE 0x00000200
190#define SMB2_FLAGS_ATTR_TEMPORARY 0x00000100
191#define SMB2_FLAGS_ATTR_NORMAL 0x00000080
192#define SMB2_FLAGS_ATTR_DEVICE 0x00000040
193#define SMB2_FLAGS_ATTR_ARCHIVE 0x00000020
194#define SMB2_FLAGS_ATTR_DIRECTORY 0x00000010
195#define SMB2_FLAGS_ATTR_VOLUMEID 0x00000008
196#define SMB2_FLAGS_ATTR_SYSTEM 0x00000004
197#define SMB2_FLAGS_ATTR_HIDDEN 0x00000002
198#define SMB2_FLAGS_ATTR_READONLY 0x00000001
201#define SMB2_FID_TYPE_UNKNOWN 0
202#define SMB2_FID_TYPE_FILE 1
203#define SMB2_FID_TYPE_DIR 2
204#define SMB2_FID_TYPE_PIPE 3
205#define SMB2_FID_TYPE_OTHER 4
208#define SMB2_COM_NEGOTIATE_PROTOCOL 0x00
209#define SMB2_COM_SESSION_SETUP 0x01
210#define SMB2_COM_SESSION_LOGOFF 0x02
211#define SMB2_COM_TREE_CONNECT 0x03
212#define SMB2_COM_TREE_DISCONNECT 0x04
213#define SMB2_COM_CREATE 0x05
214#define SMB2_COM_CLOSE 0x06
215#define SMB2_COM_FLUSH 0x07
216#define SMB2_COM_READ 0x08
217#define SMB2_COM_WRITE 0x09
218#define SMB2_COM_LOCK 0x0A
219#define SMB2_COM_IOCTL 0x0B
220#define SMB2_COM_CANCEL 0x0C
221#define SMB2_COM_KEEPALIVE 0x0D
222#define SMB2_COM_FIND 0x0E
223#define SMB2_COM_NOTIFY 0x0F
224#define SMB2_COM_GETINFO 0x10
225#define SMB2_COM_SETINFO 0x11
226#define SMB2_COM_BREAK 0x12
230 uint32_t ioctl_function;
237 smb2_eo_file_info_t *eo_file_info;
238 smb2_conv_info_t *conv;
239 smb2_saved_info_t *saved;
240 smb2_tid_info_t *tree;
241 smb2_sesid_info_t *session;
242 smb2_fid_info_t *file;
243 proto_tree *top_tree;
253 smb2_conv_info_t *conv;
254 smb2_sesid_info_t *session;
255} smb2_transform_info_t;
260 unsigned comp_offset;
261 smb2_conv_info_t *conv;
262 smb2_sesid_info_t *session;
263} smb2_comp_transform_info_t;
266int dissect_smb2_FILE_OBJECTID_BUFFER(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree,
int offset);
267int dissect_smb2_ioctl_function(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *parent_tree,
int offset, uint32_t *ioctl_function);
268void dissect_smb2_ioctl_data(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, proto_tree *top_tree, uint32_t ioctl_function,
bool data_in,
void *private_data);
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
proto_node proto_item
Definition proto.h:927
struct _wmem_map_t wmem_map_t
Opaque type representing a wmem-managed hash map.
Definition wmem_map.h:46
struct _e_guid_t e_guid_t
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
Definition packet-smb2.h:138
Definition packet-smb2.h:36
Definition packet-smb2.h:41
Definition packet-smb2.h:228
Definition packet-smb2.h:65
Definition packet-smb2.h:111
Definition packet-smb2.h:100
Definition packet-smb2.h:91