- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
Latest commit
228 lines (185 loc) · 7.02 KB
/
Copy pathinit.lua
File metadata and controls
228 lines (185 loc) · 7.02 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
--[[
HttpSpy v1.1.3
]]
ifrconsoleprintthen
rconsoleprint("https://eleutheri.com - #1 Whitelist Service\n\n")
end;
assert(synorhttp, "Unsupport exploit (should support syn.request or http.request)");
localoptions= ({...})[1] or { AutoDecode=true, Highlighting=true, SaveLogs=true, CLICommands=true, ShowResponse=true, BlockedURLs= {}, API=true };
localversion="v1.1.3";
locallogname=string.format("%d-%s-log.txt", game.PlaceId, os.date("%d_%m_%y"));
ifoptions.SaveLogsthen
writefile(logname, string.format("Http Logs from %s\n\n", os.date("%d/%m/%y")))
end;
localSerializer=loadstring(game:HttpGet("https://raw.githubusercontent.com/NotDSF/leopard/main/rbx/leopard-syn.lua"))();
localclonef=clonefunction;
localpconsole=clonef(rconsoleprint);
localformat=clonef(string.format);
localgsub=clonef(string.gsub);
localmatch=clonef(string.match);
localappend=clonef(appendfile);
localType=clonef(type);
localcrunning=clonef(coroutine.running);
localcwrap=clonef(coroutine.wrap);
localcresume=clonef(coroutine.resume);
localcyield=clonef(coroutine.yield);
localPcall=clonef(pcall);
localPairs=clonef(pairs);
localError=clonef(error);
localgetnamecallmethod=clonef(getnamecallmethod);
localblocked=options.BlockedURLs;
localenabled=true;
localreqfunc= (synorhttp).request;
locallibtype=synand"syn" or"http";
localhooked= {};
localproxied= {};
localmethods= {
HttpGet=notsyn,
HttpGetAsync=notsyn,
GetObjects=true,
HttpPost=notsyn,
HttpPostAsync=notsyn
}
Serializer.UpdateConfig({ highlighting=options.Highlighting });
localRecentCommit=game.HttpService:JSONDecode(game:HttpGet("https://api.github.com/repos/Beonneon/httpspy/commits?per_page=1&path=init.lua"))[1].commit.message;
localOnRequest=Instance.new("BindableEvent");
localfunctionprintf(...)
ifoptions.SaveLogsthen
append(logname, gsub(format(...), "%\27%[%d+m", ""));
end;
returnpconsole(format(...));
end;
localfunctionConstantScan(constant)
fori,vinPairs(getgc(true)) do
iftype(v) =="function" andislclosure(v) andgetfenv(v).script==getfenv(saveinstance).scriptandtable.find(debug.getconstants(v), constant) then
returnv;
end;
end;
end;
localfunctionDeepClone(tbl, cloned)
cloned=clonedor {};
fori,vinPairs(tbl) do
ifType(v) =="table" then
cloned[i] =DeepClone(v);
continue;
end;
cloned[i] =v;
end;
returncloned;
end;
local__namecall, __request;
__namecall=hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
localmethod=getnamecallmethod();
ifmethods[method] then
printf("game:%s(%s)\n\n", method, Serializer.FormatArguments(...));
end;
return__namecall(self, ...);
end));
__request=hookfunction(reqfunc, newcclosure(function(req)
ifType(req) ~="table" thenreturn__request(req); end;
localRequestData=DeepClone(req);
ifnotenabledthen
return__request(req);
end;
ifType(RequestData.Url) ~="string" thenreturn__request(req) end;
ifnotoptions.ShowResponsethen
printf("%s.request(%s)\n\n", libtype, Serializer.Serialize(RequestData));
return__request(req);
end;
localt=crunning();
cwrap(function()
ifRequestData.Urlandblocked[RequestData.Url] then
printf("%s.request(%s) -- blocked url\n\n", libtype, Serializer.Serialize(RequestData));
returncresume(t, {});
end;
ifRequestData.Urlthen
localHost=string.match(RequestData.Url, "https?://(%w+.%w+)/");
ifHostandproxied[Host] then
RequestData.Url=gsub(RequestData.Url, Host, proxied[Host], 1);
end;
end;
OnRequest:Fire(RequestData);
localok, ResponseData=Pcall(__request, RequestData); -- I know of a detection with this
ifnotokthen
Error(ResponseData, 0);
end;
localBackupData= {};
fori,vinPairs(ResponseData) do
BackupData[i] =v;
end;
ifBackupData.Headers["Content-Type"] andmatch(BackupData.Headers["Content-Type"], "application/json") andoptions.AutoDecodethen
localbody=BackupData.Body;
localok, res=Pcall(game.HttpService.JSONDecode, game.HttpService, body);
ifokthen
BackupData.Body=res;
end;
end;
printf("%s.request(%s)\n\nResponse Data: %s\n\n", libtype, Serializer.Serialize(RequestData), Serializer.Serialize(BackupData));
cresume(t, hooked[RequestData.Url] andhooked[RequestData.Url](ResponseData) orResponseData);
end)();
returncyield();
end));
ifrequestthen
replaceclosure(request, reqfunc);
end;
ifsynandsyn.websocketthen
localWsConnect, WsBackup=debug.getupvalue(syn.websocket.connect, 1);
WsBackup=hookfunction(WsConnect, function(...)
printf("syn.websocket.connect(%s)\n\n", Serializer.FormatArguments(...));
returnWsBackup(...);
end);
end;
-- I already know this will make some people mad :troll:
ifsynandsyn.websocketthen
localHttpGet;
HttpGet=hookfunction(getupvalue(ConstantScan("ZeZLm2hpvGJrD6OP8A3aEszPNEw8OxGb"), 2), function(self, ...)
printf("game.HttpGet(game, %s)\n\n", Serializer.FormatArguments(...));
returnHttpGet(self, ...);
end);
localHttpPost;
HttpPost=hookfunction(getupvalue(ConstantScan("gpGXBVpEoOOktZWoYECgAY31o0BlhOue"), 2), function(self, ...)
printf("game.HttpPost(game, %s)\n\n", Serializer.FormatArguments(...));
returnHttpPost(self, ...);
end);
end
formethod, enabledinPairs(methods) do
ifenabledthen
localb;
b=hookfunction(game[method], newcclosure(function(self, ...)
printf("game.%s(game, %s)\n\n", method, Serializer.FormatArguments(...));
returnb(self, ...);
end));
end;
end;
ifnotdebug.info(2, "f") then
pconsole("You are running an outdated version, please use the loadstring at https://github.com/NotDSF/HttpSpy\n");
end;
pconsole(format("HttpSpy %s (Creator: https://github.com/NotDSF)\nChange Logs:\n\t%s\nLogs are automatically being saved to: \27[32m%s\27[0m\n\n", version, RecentCommit, options.SaveLogsandlognameor"(You aren't saving logs, enable SaveLogs if you want to save logs)"));
ifnotoptions.APIthenreturnend;
localAPI= {};
API.OnRequest=OnRequest.Event;
functionAPI:HookSynRequest(url, hook)
hooked[url] =hook;
end;
functionAPI:ProxyHost(host, proxy)
proxied[host] =proxy;
end;
functionAPI:RemoveProxy(host)
ifnotproxied[host] then
error("host isn't proxied", 0);
end;
proxied[host] =nil;
end;
functionAPI:UnHookSynRequest(url)
ifnothooked[url] then
error("url isn't hooked", 0);
end;
hooked[url] =nil;
end
functionAPI:BlockUrl(url)
blocked[url] =true;
end;
functionAPI:WhitelistUrl(url)
blocked[url] =false;
end;
returnAPI;