aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-09-11 09:05:22 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-09-11 09:05:22 +0000
commit14243464b9236acd4c6d5b3143574c573f8396a5 (patch)
treec314de53569ee3bde8760b9b907deb86141af30b
parent48a5798890adb4de33a2a3fd48fd314d3171434c (diff)
From Jaime Fournier: DCE/RCP RPRIV interface
svn path=/trunk/; revision=6267
-rw-r--r--AUTHORS2
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.nmake3
-rw-r--r--packet-dcerpc-rpriv.c162
4 files changed, 167 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 02d799e158..87ee8e4e68 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1411,7 +1411,7 @@ Matthew Smart <smart[AT]monkey.org> {
Jamie Fournier <jafour1@yahoo.com>
DCE/RPC dissectors for RSEC_LOGIN, RS_ACCT, RS_ATTR, RS_MISC, RS_PGO,
- RS_REPLIST, RS_UNIX
+ RS_REPLIST, RS_UNIX, RPRIV
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
diff --git a/Makefile.am b/Makefile.am
index 76b47d0bc9..47a102988c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.480 2002/09/10 11:33:00 sahlberg Exp $
+# $Id: Makefile.am,v 1.481 2002/09/11 09:05:22 sahlberg Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
@@ -128,6 +128,7 @@ DISSECTOR_SRC = \
packet-dcerpc-oxid.c \
packet-dcerpc-reg.c \
packet-dcerpc-remact.c \
+ packet-dcerpc-rpriv.c \
packet-dcerpc-rs_acct.c \
packet-dcerpc-rs_attr.c \
packet-dcerpc-rs_misc.c \
diff --git a/Makefile.nmake b/Makefile.nmake
index 46efd2bdfb..992a8148d6 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
-# $Id: Makefile.nmake,v 1.217 2002/09/10 11:33:00 sahlberg Exp $
+# $Id: Makefile.nmake,v 1.218 2002/09/11 09:05:22 sahlberg Exp $
include config.nmake
include <win32.mak>
@@ -70,6 +70,7 @@ DISSECTOR_SRC = \
packet-dcerpc-oxid.c \
packet-dcerpc-reg.c \
packet-dcerpc-remact.c \
+ packet-dcerpc-rpriv.c \
packet-dcerpc-rs_acct.c \
packet-dcerpc-rs_attr.c \
packet-dcerpc-rs_misc.c \
diff --git a/packet-dcerpc-rpriv.c b/packet-dcerpc-rpriv.c
new file mode 100644
index 0000000000..9206a91072
--- /dev/null
+++ b/packet-dcerpc-rpriv.c
@@ -0,0 +1,162 @@
+/* packet-dcerpc-rpriv.c
+ *
+ * Routines for DCERPC Privilege Server operations
+ * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>
+ * 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
+ *
+ * $Id: packet-dcerpc-rpriv.c,v 1.1 2002/09/11 09:05:22 sahlberg Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <string.h>
+
+#include <glib.h>
+#include <epan/packet.h>
+#include "packet-dcerpc.h"
+
+
+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;
+static int hf_rpriv_get_eptgt_rqst_key_size = -1;
+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;
+
+
+static e_uuid_t uuid_rpriv = { 0xb1e338f8, 0x9533, 0x11c9, { 0xa3, 0x4a, 0x08, 0x00, 0x1e, 0x01, 0x9c, 0x1e } };
+static guint16 ver_rpriv = 1.1;
+
+
+static int
+rpriv_dissect_get_eptgt_rqst (tvbuff_t *tvb, int offset,
+ packet_info *pinfo, proto_tree *tree,
+ char *drep)
+{
+ /* [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[];
+ */
+
+ guint32 authn_svc, authz_svc, key_size, key_size2, var1;
+ char *key_t = NULL;
+ char *key_t2 = NULL;
+
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_authn_svc, &authn_svc);
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_authz_svc, &authz_svc);
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_var1, &var1);
+ offset += 276;
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size);
+ /* advance to get size of cell, and princ */
+
+ proto_tree_add_string (tree, hf_rpriv_get_eptgt_rqst_key_t, tvb, offset, hf_rpriv_get_eptgt_rqst_key_size, tvb_get_ptr (tvb, offset, key_size));
+ key_t = (char *)tvb_get_ptr(tvb,offset,key_size);
+ offset += key_size;
+
+ offset += 8;
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size2);
+ proto_tree_add_string (tree, hf_rpriv_get_eptgt_rqst_key_t2, tvb, offset, hf_rpriv_get_eptgt_rqst_key_size2, tvb_get_ptr (tvb, offset, key_size2));
+ key_t2 = (char *)tvb_get_ptr(tvb,offset,key_size2);
+ offset += key_size2;
+
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ " Request for: %s in %s ", key_t2, key_t);
+ }
+
+ return offset;
+
+}
+
+
+static dcerpc_sub_dissector rpriv_dissectors[] = {
+ { 0, "rpriv_get_ptgt", NULL,NULL},
+ { 1, "rpriv_become_delegate", NULL, NULL},
+ { 2, "rpriv_become_impersonator", NULL, NULL},
+ { 3, "rpriv_get_eptgt", rpriv_dissect_get_eptgt_rqst , NULL},
+ { 0, NULL, NULL, NULL }
+};
+
+static const value_string rpriv_opnum_vals[] = {
+ { 0, "rpriv_get_ptgt" },
+ { 1, "rpriv_become_delegate" },
+ { 2, "rpriv_become_impersonator" },
+ { 3, "rpriv_get_eptgt" },
+ { 0, NULL }
+};
+
+void
+proto_register_rpriv (void)
+{
+ static hf_register_info hf[] = {
+ { &hf_rpriv_opnum,
+ { "Operation", "rpriv.opnum", FT_UINT16, BASE_DEC, VALS(rpriv_opnum_vals), 0x0, "Operation", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_authn_svc,
+ { "Authn_Svc", "rpriv.get_eptgt_rqst_authn_svc", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_authz_svc,
+ { "Authz_Svc", "rpriv.get_eptgt_rqst_authz_svc", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_key_size,
+ { "Key_Size", "rpriv.get_eptgt_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_key_size,
+ { "Key_Size", "rpriv.get_eptgt_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_var1,
+ { "Var1", "rpriv.get_eptgt_rqst_var1", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_key_size2,
+ { "Key_Size", "rpriv.get_eptgt_rqst_key_size2", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_key_t,
+ { "Key_t", "rpriv.get_eptgt_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
+ { &hf_rpriv_get_eptgt_rqst_key_t2,
+ { "Key_t2", "rpriv.get_eptgt_rqst_key_t2", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
+
+ };
+
+ 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);
+}