2004-12-19 16:29:08 +00:00
|
|
|
/* packet-dcom-remact.c
|
2001-07-11 01:25:45 +00:00
|
|
|
* Routines for DCOM Remote Activation
|
|
|
|
* Copyright 2001, Todd Sabin <tas@webspan.net>
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-07-11 01:25:45 +00:00
|
|
|
* 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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2001-07-11 01:25:45 +00:00
|
|
|
*/
|
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
/* see packet-dcom.c for details about DCOM */
|
|
|
|
|
2001-07-11 01:25:45 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2001-07-11 01:25:45 +00:00
|
|
|
#include "packet-dcerpc.h"
|
2004-12-19 16:29:08 +00:00
|
|
|
#include "packet-dcom.h"
|
2001-07-11 01:25:45 +00:00
|
|
|
|
2013-03-16 20:22:54 +00:00
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_remact(void);
|
|
|
|
void proto_reg_handoff_remact(void);
|
2013-03-16 20:22:54 +00:00
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
static int hf_remact_opnum = -1;
|
2001-07-11 01:25:45 +00:00
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
static int hf_remact_requested_protseqs = -1;
|
|
|
|
static int hf_remact_protseqs = -1;
|
|
|
|
static int hf_remact_interfaces = -1;
|
|
|
|
static int hf_remact_mode = -1;
|
|
|
|
static int hf_remact_client_impl_level = -1;
|
|
|
|
static int hf_remact_object_name = -1;
|
|
|
|
static int hf_remact_object_storage = -1;
|
|
|
|
static int hf_remact_interface_data = -1;
|
2001-07-11 01:25:45 +00:00
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
static int hf_remact_oxid_bindings = -1;
|
|
|
|
static int hf_remact_authn_hint = -1;
|
2001-07-11 01:25:45 +00:00
|
|
|
|
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
static int proto_remact = -1;
|
|
|
|
static gint ett_remact = -1;
|
2015-03-03 10:47:53 +00:00
|
|
|
static e_guid_t uuid_remact = { 0x4d9f4ab8, 0x7d1c, 0x11cf, { 0x86, 0x1e, 0x00, 0x20, 0xaf, 0x6e, 0x7c, 0x57 } };
|
2001-07-11 01:25:45 +00:00
|
|
|
static guint16 ver_remact = 0;
|
|
|
|
|
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
static int
|
|
|
|
dissect_remact_remote_activation_rqst(tvbuff_t *tvb, int offset,
|
2013-11-06 14:31:29 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
|
2004-12-19 16:29:08 +00:00
|
|
|
{
|
|
|
|
guint32 u32ClientImpLevel;
|
|
|
|
guint32 u32Mode;
|
|
|
|
guint32 u32Interfaces;
|
|
|
|
guint32 u32Pointer;
|
|
|
|
guint32 u32ArraySize;
|
|
|
|
guint32 u32ItemIdx;
|
|
|
|
guint16 u16ProtSeqs;
|
2015-03-03 10:47:53 +00:00
|
|
|
e_guid_t clsid;
|
|
|
|
e_guid_t iid;
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
gchar szObjName[1000] = { 0 };
|
|
|
|
guint32 u32ObjNameLen = sizeof(szObjName);
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_this(tvb, offset, pinfo, tree, di, drep);
|
2005-01-24 19:30:07 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_append_UUID(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_dcom_clsid, -1, &clsid);
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32Pointer);
|
2004-12-19 16:29:08 +00:00
|
|
|
if (u32Pointer) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_object_name, szObjName, u32ObjNameLen);
|
2004-12-19 16:29:08 +00:00
|
|
|
}
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_object_storage, NULL /* XXX */);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_client_impl_level, &u32ClientImpLevel);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_mode, &u32Mode);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
/* Interfaces */
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_interfaces, &u32Interfaces);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32Pointer);
|
2004-12-19 16:29:08 +00:00
|
|
|
if (u32Pointer) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, di, drep,
|
2004-12-19 16:29:08 +00:00
|
|
|
&u32ArraySize);
|
|
|
|
u32ItemIdx = 1;
|
|
|
|
while (u32Interfaces--) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_append_UUID(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_dcom_iid, u32ItemIdx, &iid);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
u32ItemIdx++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_requested_protseqs, &u16ProtSeqs);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, di, drep,
|
2004-12-19 16:29:08 +00:00
|
|
|
&u32ArraySize);
|
|
|
|
u32ItemIdx = 1;
|
|
|
|
while (u32ArraySize--) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_protseqs, &u16ProtSeqs);
|
2004-12-19 16:29:08 +00:00
|
|
|
u32ItemIdx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_remact_remote_activation_resp(tvbuff_t *tvb, int offset,
|
2013-11-06 14:31:29 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
|
2004-12-19 16:29:08 +00:00
|
|
|
{
|
|
|
|
guint32 u32Pointer;
|
2015-03-03 10:47:53 +00:00
|
|
|
e_guid_t ipid;
|
2004-12-19 16:29:08 +00:00
|
|
|
guint32 u32AuthnHint;
|
|
|
|
guint16 u16VersionMajor;
|
|
|
|
guint16 u16VersionMinor;
|
|
|
|
guint32 u32HResult;
|
|
|
|
guint32 u32ArraySize;
|
|
|
|
guint32 u32Idx;
|
|
|
|
guint32 u32VariableOffset;
|
|
|
|
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_that(tvb, offset, pinfo, tree, di, drep);
|
2005-01-24 19:30:07 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_dcom_oxid, NULL);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32Pointer);
|
2004-12-19 16:29:08 +00:00
|
|
|
if (u32Pointer) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, di, drep,
|
2004-12-19 16:29:08 +00:00
|
|
|
&u32ArraySize);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_DUALSTRINGARRAY(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_oxid_bindings, NULL);
|
2004-12-19 16:29:08 +00:00
|
|
|
}
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_UUID(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_dcom_ipid, &ipid);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_authn_hint, &u32AuthnHint);
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_COMVERSION(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u16VersionMajor, &u16VersionMinor);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32HResult);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, di, drep,
|
2004-12-19 16:29:08 +00:00
|
|
|
&u32ArraySize);
|
|
|
|
u32VariableOffset = offset + u32ArraySize * 4;
|
|
|
|
while (u32ArraySize--) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32Pointer);
|
2004-12-19 16:29:08 +00:00
|
|
|
if (u32Pointer) {
|
2013-11-06 14:31:29 +00:00
|
|
|
u32VariableOffset = dissect_dcom_MInterfacePointer(tvb, u32VariableOffset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
hf_remact_interface_data, NULL /* XXX */);
|
2004-12-19 16:29:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
offset = u32VariableOffset;
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, di, drep,
|
2004-12-19 16:29:08 +00:00
|
|
|
&u32ArraySize);
|
|
|
|
u32Idx = 1;
|
|
|
|
while (u32ArraySize--) {
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32HResult, u32Idx);
|
2004-12-19 16:29:08 +00:00
|
|
|
/* update column info now */
|
2011-09-26 11:33:10 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s[%u]",
|
|
|
|
val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)"),
|
|
|
|
u32Idx);
|
2004-12-19 16:29:08 +00:00
|
|
|
u32Idx++;
|
|
|
|
}
|
|
|
|
|
2013-11-06 14:31:29 +00:00
|
|
|
offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, di, drep,
|
2010-05-10 15:54:57 +00:00
|
|
|
&u32HResult);
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
/* update column info now */
|
2011-09-26 11:33:10 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
|
|
|
|
val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)"));
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-11 01:25:45 +00:00
|
|
|
static dcerpc_sub_dissector remact_dissectors[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{ 0, "RemoteActivation", dissect_remact_remote_activation_rqst, dissect_remact_remote_activation_resp },
|
|
|
|
{ 0, NULL, NULL, NULL },
|
2001-07-11 01:25:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_remact (void)
|
|
|
|
{
|
2004-12-19 16:29:08 +00:00
|
|
|
static hf_register_info hf_remact[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{ &hf_remact_opnum,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "Operation", "remact.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
{ &hf_remact_requested_protseqs,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "RequestedProtSeqs", "remact.req_prot_seqs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_protseqs,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "ProtSeqs", "remact.prot_seqs", FT_UINT16, BASE_DEC, VALS(dcom_protseq_vals), 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_interfaces,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "Interfaces", "remact.interfaces", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_mode,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "Mode", "remact.mode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_client_impl_level,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "ClientImplLevel", "remact.client_impl_level", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_object_name,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "ObjectName", "remact.object_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_object_storage,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "ObjectStorage", "remact.object_storage", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_interface_data,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "InterfaceData", "remact.interface_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
|
|
|
|
{ &hf_remact_oxid_bindings,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "OxidBindings", "remact.oxid_bindings", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
2004-12-19 16:29:08 +00:00
|
|
|
{ &hf_remact_authn_hint,
|
2010-10-06 21:51:07 +00:00
|
|
|
{ "AuthnHint", "remact.authn_hint", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2001-07-11 01:25:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
2002-05-31 00:31:13 +00:00
|
|
|
&ett_remact
|
2001-07-11 01:25:45 +00:00
|
|
|
};
|
2010-05-10 15:54:57 +00:00
|
|
|
|
2004-12-19 16:29:08 +00:00
|
|
|
proto_remact = proto_register_protocol ("DCOM IRemoteActivation", "REMACT", "remact");
|
|
|
|
proto_register_field_array (proto_remact, hf_remact, array_length (hf_remact));
|
2001-07-11 01:25:45 +00:00
|
|
|
proto_register_subtree_array (ett, array_length (ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_remact (void)
|
|
|
|
{
|
|
|
|
/* Register the protocol as dcerpc */
|
2004-12-19 16:29:08 +00:00
|
|
|
dcerpc_init_uuid (proto_remact, ett_remact, &uuid_remact, ver_remact, remact_dissectors, hf_remact_opnum);
|
2001-07-11 01:25:45 +00:00
|
|
|
}
|
2014-10-04 15:28:35 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* 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:
|
|
|
|
*/
|