CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/passivex/CPassiveX.h
Views: 11766
1
/*
2
* This file is part of the Metasploit Exploit Framework
3
* and is subject to the same licenses and copyrights as
4
* the rest of this package.
5
*/
6
#ifndef _CPASSIVEX_H
7
#define _CPASSIVEX_H
8
9
#include <windows.h>
10
#include <atlbase.h>
11
12
extern CComModule _Module;
13
14
#include <atlcom.h>
15
#include <ocidl.h>
16
17
#include "HttpTunnel.h"
18
19
class ATL_NO_VTABLE CPassiveX :
20
public CComObjectRootEx<CComMultiThreadModel>,
21
public CComCoClass<CPassiveX, &CLSID_PassiveX>,
22
public CComControl<CPassiveX>,
23
public IOleObjectImpl<CPassiveX>,
24
public IOleControlImpl<CPassiveX>,
25
public IOleInPlaceActiveObjectImpl<CPassiveX>,
26
public IOleInPlaceObjectWindowlessImpl<CPassiveX>,
27
public IObjectWithSiteImpl<CPassiveX>,
28
public IProvideClassInfo2Impl<&CLSID_PassiveX, &DIID_PassiveXEvents, &LIBID_PassiveXCOM>,
29
public IConnectionPointContainerImpl<CPassiveX>,
30
public IDispatchImpl<IPassiveX, &IID_IPassiveX, &LIBID_PassiveXCOM>,
31
public IConnectionPointImpl<CPassiveX, &DIID_PassiveXEvents, CComDynamicUnkArray>,
32
public IPersistPropertyBagImpl<CPassiveX>,
33
public ISupportErrorInfo
34
{ public:
35
CPassiveX();
36
~CPassiveX();
37
38
DECLARE_REGISTRY_RESOURCEID(IDR_PASSIVEX)
39
DECLARE_PROTECT_FINAL_CONSTRUCT()
40
BEGIN_COM_MAP(CPassiveX)
41
COM_INTERFACE_ENTRY(IPassiveX)
42
COM_INTERFACE_ENTRY(IDispatch)
43
COM_INTERFACE_ENTRY(ISupportErrorInfo)
44
COM_INTERFACE_ENTRY(IProvideClassInfo)
45
COM_INTERFACE_ENTRY(IProvideClassInfo2)
46
COM_INTERFACE_ENTRY(IObjectWithSite)
47
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
48
COM_INTERFACE_ENTRY(IOleInPlaceObject)
49
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObject)
50
COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
51
COM_INTERFACE_ENTRY(IOleControl)
52
COM_INTERFACE_ENTRY(IOleObject)
53
COM_INTERFACE_ENTRY(IPersistPropertyBag)
54
COM_INTERFACE_ENTRY(IConnectionPointContainer)
55
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
56
END_COM_MAP()
57
58
// We are a singleton
59
DECLARE_CLASSFACTORY_SINGLETON(CPassiveX);
60
61
// Messages
62
BEGIN_MSG_MAP(CPassiveX)
63
CHAIN_MSG_MAP(CComControl<CPassiveX>)
64
DEFAULT_REFLECTION_HANDLER()
65
END_MSG_MAP()
66
67
// Connections
68
BEGIN_CONNECTION_POINT_MAP(CPassiveX)
69
CONNECTION_POINT_ENTRY(DIID_PassiveXEvents)
70
END_CONNECTION_POINT_MAP()
71
72
// Properties
73
BEGIN_PROPERTY_MAP(CPassiveX)
74
PROP_ENTRY("HttpHost", PASSIVEX_PROPERTY_HTTP_HOST, CLSID_NULL)
75
PROP_ENTRY("HttpPort", PASSIVEX_PROPERTY_HTTP_PORT, CLSID_NULL)
76
PROP_ENTRY("HttpSid", PASSIVEX_PROPERTY_HTTP_SID, CLSID_NULL)
77
PROP_ENTRY("HttpUriBase", PASSIVEX_PROPERTY_HTTP_URI_BASE, CLSID_NULL)
78
PROP_ENTRY("DownloadSecondStage", PASSIVEX_PROPERTY_DOWNLOAD_SECOND_STAGE, CLSID_NULL)
79
END_PROPERTY_MAP()
80
81
// ISupportErrorInfo
82
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
83
84
// IPassiveX
85
STDMETHOD(get_HttpHost)(BSTR *Host);
86
STDMETHOD(put_HttpHost)(BSTR Host);
87
STDMETHOD(get_HttpSid)(BSTR *Sid);
88
STDMETHOD(put_HttpSid)(BSTR Sid);
89
STDMETHOD(get_HttpUriBase)(BSTR *UriBase);
90
STDMETHOD(put_HttpUriBase)(BSTR UriBase);
91
STDMETHOD(get_HttpPort)(ULONG *Port);
92
STDMETHOD(put_HttpPort)(ULONG Port);
93
STDMETHOD(get_DownloadSecondStage)(ULONG *Port);
94
STDMETHOD(put_DownloadSecondStage)(ULONG Port);
95
96
#ifdef PXDEBUG
97
// Debug logging
98
static VOID Log(LPCTSTR fmt, ...);
99
#else
100
static VOID Log(LPCTSTR fmt, ...) { }
101
#endif
102
protected:
103
104
VOID Initialize();
105
106
VOID ResetExplorerZoneRestrictions();
107
108
/**************
109
* Attributes *
110
**************/
111
112
// Properties
113
CComBSTR PropHttpHost;
114
CComBSTR PropHttpSid;
115
CComBSTR PropHttpUriBase;
116
ULONG PropHttpPort;
117
118
// Tunnel
119
HttpTunnel Tunnel;
120
};
121
122
#endif
123
124