2002-11-08 19:46:09 +00:00
|
|
|
/* packet-dcerpc-rpriv.c
|
|
|
|
*
|
|
|
|
* Routines for DCERPC Privilege Server operations
|
2004-01-27 04:15:49 +00:00
|
|
|
* Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
|
2002-11-08 19:46:09 +00:00
|
|
|
* This information is based off the released idl files from opengroup.
|
|
|
|
* ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/rpriv.idl
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2002-11-08 19:46:09 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2002-11-08 19:46:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include "packet-dcerpc.h"
|
|
|
|
|
2014-04-21 16:34:14 +00:00
|
|
|
void proto_register_rpriv (void);
|
|
|
|
void proto_reg_handoff_rpriv (void);
|
2002-11-08 19:46:09 +00:00
|
|
|
|
|
|
|
static int proto_rpriv = -1;
|
|
|
|
static int hf_rpriv_opnum = -1;
|
|
|
|
static int hf_rpriv_get_eptgt_rqst_authn_svc = -1;
|
|
|
|
static int hf_rpriv_get_eptgt_rqst_authz_svc = -1;
|
|
|
|
static int hf_rpriv_get_eptgt_rqst_var1 = -1;
|
2013-01-31 17:55:31 +00:00
|
|
|
/* static int hf_rpriv_get_eptgt_rqst_key_size = -1; */
|
2002-11-08 19:46:09 +00:00
|
|
|
static int hf_rpriv_get_eptgt_rqst_key_size2 = -1;
|
|
|
|
static int hf_rpriv_get_eptgt_rqst_key_t = -1;
|
|
|
|
static int hf_rpriv_get_eptgt_rqst_key_t2 = -1;
|
|
|
|
|
|
|
|
static gint ett_rpriv = -1;
|
|
|
|
|
|
|
|
|
2015-03-03 10:47:53 +00:00
|
|
|
static e_guid_t uuid_rpriv = { 0xb1e338f8, 0x9533, 0x11c9, { 0xa3, 0x4a, 0x08, 0x00, 0x1e, 0x01, 0x9c, 0x1e } };
|
2003-12-28 23:50:31 +00:00
|
|
|
static guint16 ver_rpriv = 1;
|
2002-11-08 19:46:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
rpriv_dissect_get_eptgt_rqst (tvbuff_t *tvb, int offset,
|
2010-05-10 15:54:57 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2013-11-06 14:31:29 +00:00
|
|
|
dcerpc_info *di, guint8 *drep)
|
2002-11-08 19:46:09 +00:00
|
|
|
{
|
|
|
|
/* [in] handle_t handle,
|
|
|
|
* [in] unsigned32 authn_svc,
|
|
|
|
* [in] unsigned32 authz_svc,
|
|
|
|
* [in] rpriv_pickle_t *ptgt_req,
|
|
|
|
* unsigned32 num_bytes;
|
|
|
|
* [size_is(num_bytes)]
|
|
|
|
* byte bytes[];
|
2011-01-12 03:35:14 +00:00
|
|
|
*/
|
2002-11-08 19:46:09 +00:00
|
|
|
|
2010-05-10 15:54:57 +00:00
|
|
|
guint32 authn_svc, authz_svc, key_size, key_size2, var1;
|
2016-06-26 14:52:37 +00:00
|
|
|
const guint8 *key_t1 = NULL;
|
|
|
|
const guint8 *key_t2 = NULL;
|
2002-11-08 19:46:09 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_authn_svc, &authn_svc);
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_authz_svc, &authz_svc);
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_var1, &var1);
|
2010-05-10 15:54:57 +00:00
|
|
|
offset += 276;
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size);
|
2010-05-10 15:54:57 +00:00
|
|
|
/* advance to get size of cell, and princ */
|
2002-11-08 19:46:09 +00:00
|
|
|
|
2021-07-16 15:36:34 +00:00
|
|
|
proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &key_t1);
|
2010-05-10 15:54:57 +00:00
|
|
|
offset += key_size;
|
2002-11-08 19:46:09 +00:00
|
|
|
|
2010-05-10 15:54:57 +00:00
|
|
|
offset += 8;
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size2);
|
2021-07-16 15:36:34 +00:00
|
|
|
proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t2, tvb, offset, key_size2, ENC_ASCII|ENC_NA, pinfo->pool, &key_t2);
|
2010-05-10 15:54:57 +00:00
|
|
|
offset += key_size2;
|
2002-11-08 19:46:09 +00:00
|
|
|
|
|
|
|
|
2013-10-01 13:02:12 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
2010-05-10 15:54:57 +00:00
|
|
|
" Request for: %s in %s ", key_t2, key_t1);
|
2002-11-08 19:46:09 +00:00
|
|
|
|
2010-05-10 15:54:57 +00:00
|
|
|
return offset;
|
2002-11-08 19:46:09 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static dcerpc_sub_dissector rpriv_dissectors[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{ 0, "get_ptgt", NULL,NULL},
|
|
|
|
{ 1, "become_delegate", NULL, NULL},
|
|
|
|
{ 2, "become_impersonator", NULL, NULL},
|
|
|
|
{ 3, "get_eptgt", rpriv_dissect_get_eptgt_rqst , NULL},
|
|
|
|
{ 0, NULL, NULL, NULL }
|
2002-11-08 19:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_rpriv (void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{ &hf_rpriv_opnum,
|
|
|
|
{ "Operation", "rpriv.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &hf_rpriv_get_eptgt_rqst_authn_svc,
|
|
|
|
{ "Authn_Svc", "rpriv.get_eptgt_rqst_authn_svc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &hf_rpriv_get_eptgt_rqst_authz_svc,
|
|
|
|
{ "Authz_Svc", "rpriv.get_eptgt_rqst_authz_svc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2013-01-31 17:55:31 +00:00
|
|
|
#if 0
|
2010-05-10 15:54:57 +00:00
|
|
|
{ &hf_rpriv_get_eptgt_rqst_key_size,
|
|
|
|
{ "Key_Size", "rpriv.get_eptgt_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2013-01-31 17:55:31 +00:00
|
|
|
#endif
|
2010-05-10 15:54:57 +00:00
|
|
|
{ &hf_rpriv_get_eptgt_rqst_var1,
|
|
|
|
{ "Var1", "rpriv.get_eptgt_rqst_var1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &hf_rpriv_get_eptgt_rqst_key_size2,
|
|
|
|
{ "Key_Size", "rpriv.get_eptgt_rqst_key_size2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &hf_rpriv_get_eptgt_rqst_key_t,
|
|
|
|
{ "Key_t", "rpriv.get_eptgt_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
|
|
|
{ &hf_rpriv_get_eptgt_rqst_key_t2,
|
|
|
|
{ "Key_t2", "rpriv.get_eptgt_rqst_key_t2", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
2011-01-12 03:35:14 +00:00
|
|
|
|
2002-11-08 19:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_rpriv,
|
|
|
|
};
|
|
|
|
proto_rpriv = proto_register_protocol ("Privilege Server operations", "rpriv", "rpriv");
|
|
|
|
proto_register_field_array (proto_rpriv, hf, array_length (hf));
|
|
|
|
proto_register_subtree_array (ett, array_length (ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_rpriv (void)
|
|
|
|
{
|
|
|
|
/* Register the protocol as dcerpc */
|
|
|
|
dcerpc_init_uuid (proto_rpriv, ett_rpriv, &uuid_rpriv, ver_rpriv, rpriv_dissectors, hf_rpriv_opnum);
|
|
|
|
}
|
2014-10-05 19:57:05 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-10-05 19:57:05 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|