1 /* packet-dcerpc-krb5rpc.c
3 * Routines for dcerpc DCE/KRB5 interface
4 * Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
5 * This information is based off the released idl files from opengroup.
6 * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/krb5rpc.idl
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
18 #include <epan/packet.h>
19 #include <epan/asn1.h>
20 #include "packet-dcerpc.h"
21 #include "packet-kerberos.h"
23 void proto_register_krb5rpc (void);
24 void proto_reg_handoff_krb5rpc (void);
26 static int proto_krb5rpc
;
28 static int ett_krb5rpc
;
31 static e_guid_t uuid_krb5rpc
=
32 { 0x8f73de50, 0x768c, 0x11ca, {0xbf, 0xfc, 0x08, 0x00, 0x1e, 0x03, 0x94,
35 static uint16_t ver_krb5rpc
= 1;
36 static int hf_krb5rpc_opnum
;
37 static int hf_krb5rpc_sendto_kdc_rqst_keysize
;
38 static int hf_krb5rpc_sendto_kdc_rqst_spare1
;
39 static int hf_krb5rpc_sendto_kdc_resp_len
;
40 static int hf_krb5rpc_sendto_kdc_resp_max
;
41 static int hf_krb5rpc_sendto_kdc_resp_spare1
;
42 static int hf_krb5rpc_sendto_kdc_resp_keysize
;
43 /* static int hf_krb5rpc_sendto_kdc_resp_st; */
44 static int hf_krb5rpc_krb5
;
45 static int ett_krb5rpc_krb5
;
48 krb5rpc_dissect_sendto_kdc_rqst (tvbuff_t
* tvb
, int offset
,
49 packet_info
* pinfo
, proto_tree
* tree
,
50 dcerpc_info
*di
, uint8_t *drep
)
52 uint32_t keysize
, spare1
, remain
;
60 * [in] unsigned32 len,
63 * [in] unsigned32 out_buf_len,
67 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
68 hf_krb5rpc_sendto_kdc_rqst_keysize
, &keysize
);
70 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
71 hf_krb5rpc_sendto_kdc_rqst_spare1
, &spare1
);
72 item
= proto_tree_add_item (tree
, hf_krb5rpc_krb5
, tvb
, offset
, -1, ENC_NA
);
73 subtree
= proto_item_add_subtree (item
, ett_krb5rpc_krb5
);
75 remain
= tvb_captured_length_remaining(tvb
, offset
);
76 krb5_tvb
= tvb_new_subset_length(tvb
, offset
, remain
);
77 offset
= dissect_kerberos_main (krb5_tvb
, pinfo
, subtree
, true, NULL
);
85 krb5rpc_dissect_sendto_kdc_resp (tvbuff_t
* tvb
, int offset
,
86 packet_info
* pinfo
, proto_tree
* tree
,
87 dcerpc_info
*di
, uint8_t *drep
)
89 uint32_t resp_len
, maxsize
, spare1
, keysize
, remain
;
97 * [out] unsigned32 *resp_len,
98 * [out, length_is(*resp_len), size_is(out_buf_len)]
100 * [out] error_status_t *st unsigned long
105 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
106 hf_krb5rpc_sendto_kdc_resp_len
, &resp_len
);
108 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
109 hf_krb5rpc_sendto_kdc_resp_max
, &maxsize
);
111 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
112 hf_krb5rpc_sendto_kdc_resp_spare1
, &spare1
);
114 dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
115 hf_krb5rpc_sendto_kdc_resp_keysize
, &keysize
);
118 item
= proto_tree_add_item (tree
, hf_krb5rpc_krb5
, tvb
, offset
, -1, ENC_NA
);
119 subtree
= proto_item_add_subtree (item
, ett_krb5rpc_krb5
);
120 remain
= tvb_captured_length_remaining(tvb
, offset
);
121 krb5_tvb
= tvb_new_subset_length(tvb
, offset
, remain
);
123 offset
= dissect_kerberos_main (krb5_tvb
, pinfo
, subtree
, true, NULL
);
124 offset
+= 16; /* no idea what this is, probably just extended encrypted text. */
130 static const dcerpc_sub_dissector krb5rpc_dissectors
[] = {
131 {0, "rsec_krb5rpc_sendto_kdc", krb5rpc_dissect_sendto_kdc_rqst
,
132 krb5rpc_dissect_sendto_kdc_resp
},
133 {0, NULL
, NULL
, NULL
},
138 proto_register_krb5rpc (void)
140 static hf_register_info hf
[] = {
142 {"Opnum", "krb5rpc.opnum", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
144 {&hf_krb5rpc_sendto_kdc_rqst_keysize
,
146 "krb5rpc.sendto_kdc_rqst_keysize", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
148 {&hf_krb5rpc_sendto_kdc_rqst_spare1
,
150 "krb5rpc.sendto_kdc_rqst_spare1", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
,
152 {&hf_krb5rpc_sendto_kdc_resp_len
,
153 {"Response length", "krb5rpc.sendto_kdc_resp_len",
154 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
155 {&hf_krb5rpc_sendto_kdc_resp_max
,
156 {"Response max", "krb5rpc.sendto_kdc_resp_max",
157 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
158 {&hf_krb5rpc_sendto_kdc_resp_spare1
,
160 "krb5rpc.sendto_kdc_resp_spare1", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
,
162 {&hf_krb5rpc_sendto_kdc_resp_keysize
,
163 {"Response key size",
164 "krb5rpc.sendto_kdc_resp_keysize", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
167 {&hf_krb5rpc_sendto_kdc_resp_st
,
168 {"Response st", "krb5rpc.sendto_kdc_resp_st",
169 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
172 {"krb5", "krb5rpc.krb5", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
173 "krb5 blob", HFILL
}},
177 static int *ett
[] = {
182 proto_register_protocol ("DCE/RPC Kerberos V", "KRB5RPC", "krb5rpc");
183 proto_register_field_array (proto_krb5rpc
, hf
, array_length (hf
));
184 proto_register_subtree_array (ett
, array_length (ett
));
188 proto_reg_handoff_krb5rpc (void)
190 /* Register the protocol as dcerpc */
191 dcerpc_init_uuid (proto_krb5rpc
, ett_krb5rpc
, &uuid_krb5rpc
, ver_krb5rpc
,
192 krb5rpc_dissectors
, hf_krb5rpc_opnum
);
196 * Editor modelines - https://www.wireshark.org/tools/modelines.html
201 * indent-tabs-mode: nil
204 * ex: set shiftwidth=2 tabstop=8 expandtab:
205 * :indentSize=2:tabSize=8:noTabs=true: