-
Notifications
You must be signed in to change notification settings - Fork 0
/
intercept_rpc_funcs.js
136 lines (115 loc) · 4.87 KB
/
intercept_rpc_funcs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
function func_pRpcBindingFromStringBinding(){
let pRpcBindingFromStringBinding = Module.findExportByName("Rpcrt4.dll", "RpcBindingFromStringBindingW");
Interceptor.attach(pRpcBindingFromStringBinding, {
onEnter: function(args) {
send("[>] Called RpcBindingFromStringBindingW");
send(" |_ StringBinding: " + args[0].readUtf16String());
this.bindingHandle = args[1];
},
onLeave: function(retval) {
send("[<] RpcBindingFromStringBindingW returned: " + retval);
send(" |_ BindingHandle: " + this.bindingHandle.readPointer());
}
});
}
function func_RpcBindingSetAuthInfoW(){
let pRpcBindingSetAuthInfo = Module.findExportByName("Rpcrt4.dll", "RpcBindingSetAuthInfoW");
Interceptor.attach(pRpcBindingSetAuthInfo, {
onEnter: function(args) {
send("[>] Called RpcBindingSetAuthInfoW");
send(" |_ BindingHandle: " + args[0]);
send(" |_ ServerPrincipalName: " + args[1].readUtf16String());
send(" |_ AuthnLevel: " + args[2]);
send(" |_ AuthnSvc: " + args[3]);
send(" |_ AuthIdentity: " + args[4]);
send(" |_ AuthzSvc: " + args[5]);
},
onLeave: function(retval) {
send("[<] RpcBindingSetAuthInfoW returned: " + retval);
}
});
}
function func_pRpcStringBindingCompose(){
let pRpcStringBindingCompose = Module.findExportByName("Rpcrt4.dll", "RpcStringBindingComposeW");
Interceptor.attach(pRpcStringBindingCompose, {
onEnter: function(args) {
send("[>] Called RpcStringBindingComposeW");
send(" |_ ObjUuid: " + args[0].readUtf16String());
send(" |_ ProtSeq: " + args[1].readUtf16String());
send(" |_ NetworkAddr: " + args[2].readUtf16String());
send(" |_ Endpoint: " + args[3].readUtf16String());
send(" |_ Options: " + args[4].readUtf16String());
},
onLeave: function(retval) {
send("[<] RpcStringBindingComposeW returned: " + retval);
}
});
}
function func_pRpcServerListen(){
let pRpcServerListen = Module.findExportByName("Rpcrt4.dll", "RpcServerListen");
Interceptor.attach(pRpcServerListen, {
onEnter: function(args) {
send("[>] Called RpcServerListen");
send(" |_ MinimumCallThreads: " + args[0].toInt32());
send(" |_ MaxCalls: " + args[1].toInt32());
send(" |_ DontWait: " + args[2].toInt32());
},
onLeave: function(retval) {
send("[<] RpcServerListen returned: " + retval);
}
});
}
function func_pRpcServerRegisterIf(){
let pRpcServerRegisterIf = Module.findExportByName("Rpcrt4.dll", "RpcServerRegisterIf");
Interceptor.attach(pRpcServerRegisterIf, {
onEnter: function(args) {
send("[>] Called RpcServerRegisterIf");
send(" |_ IfSpec: " + args[0]);
send(" |_ MgrTypeUuid: " + args[1]);
send(" |_ MgrEpv: " + args[2]);
},
onLeave: function(retval) {
send("[<] RpcServerRegisterIf returned: " + retval);
}
});
}
function func_pRpcAsyncCompleteCall(){
let pRpcAsyncCompleteCall = Module.findExportByName("Rpcrt4.dll", "RpcAsyncCompleteCall");
Interceptor.attach(pRpcAsyncCompleteCall, {
onEnter: function(args) {
send("[>] Called RpcAsyncCompleteCall");
send(" |_ pAsync: " + args[0]);
send(" |_ Reply: " + args[1]);
},
onLeave: function(retval) {
send("[<] RpcAsyncCompleteCall returned: " + retval);
}
});
}
function func_pRpcImpersonateClient(){
let pRpcImpersonateClient = Module.findExportByName("Rpcrt4.dll", "RpcImpersonateClient");
Interceptor.attach(pRpcImpersonateClient, {
onEnter: function(args) {
send("[>] Called RpcImpersonateClient");
send(" |_ BindingHandle: " + args[0]);
},
onLeave: function(retval) {
send("[<] RpcImpersonateClient returned: " + retval);
}
});
}
function func_pNdrClientCall2(){
let pNdrClientCall2 = Module.findExportByName("Rpcrt4.dll", "NdrClientCall2");
Interceptor.attach(pNdrClientCall2, {
onEnter: function(args) {
send("[>] Called NdrClientCall2");
send(" |_ pMIDL_STUB_DESC: " + args[0]);
send(" |_ pFormatString: " + args[1]);
send(" |_ StackArguments: " + args[2]);
},
onLeave: function(retval) {
send("[<] NdrClientCall2 returned: " + retval);
}
});
}
func_pNdrClientCall2();