-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger-protection.lua
167 lines (158 loc) · 5.63 KB
/
logger-protection.lua
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
local function Import(LibName)
return loadstring(game:HttpGet(string.format("https://raw.githubusercontent.com/LegitH3x0R/Roblox-Scripts/main/UniversalLibs/%s.lua", LibName)))()
end
local BlockDiscordWebhooks = true
local DiscordWebhookCallback = function(Parsed, Old)
local Res = Old({
Url = Parsed.RawUrl,
Method = "POST",
Headers = {
["Content-Type"] = "application/json"
},
Body = '{"username":"WebProtection","avatar_url":"","content":"This webhook has been intercepted and deleted by WebProtection."}'
})
Old({ -- Delete the webhook
Url = Parsed.RawUrl,
Method = "DELETE" -- Script-Ware doesn't support DELETE?
})
warn("Webhook deleted.")
return Res
end
local URL = Import("Url")
local function CheckURL(Url, Old)
local Parsed = URL.Parse(Url)
if BlockDiscordWebhooks and (Parsed.Domain == "discord.com" or Parsed.Domain == "discordapp.com") and Parsed.Path[1] == "api" and Parsed.Path[2] == "webhooks" then
local Success, Res = pcall(DiscordWebhookCallback, Parsed, Old)
return Success and Res or {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = ""
}
elseif Parsed.Domain == "ident.me" then
return {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = "127.0.0.1"
}
elseif Parsed.Domain == "ipfy.org" then
return {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = "127.0.0.1"
}
elseif Parsed.Domain == "httpbin.org" then
elseif Parsed.Domain == "icanhazip.com" then
return {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = "127.0.0.1"
}
elseif Parsed.Domain == "seeip.org" then
local Body = "127.0.0.1"
if Parsed.Path[1] == "json" or Parsed.Path[1] == "jsonip" then
Body = '{"ip":"127.0.0.1"}'
elseif Parsed.Path[1] == "geoip" then
Body = '{"ip":"127.0.0.1","continent_code":"AN","country":"Australlia","country_code":"AU","country_code3":"AUS","region":"Tasmania","region_code":"TAS","city":"Tasmanian Devil\'s Cave","postal_code":"7000","latitude":0,"longitude":0,"timezone":"I LIVE IN ANTARTICA ITS ALWAYS NIGHT","offset":0,"asn":12345,"organization":"AS12345 Crappy Internet Services LLC."}'
end
return {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = Body
}
elseif Parsed.Domain == "ip-api.com" then
return {
Success = true,
StatusCode = 200,
StatusMessage = "OK",
Headers = {},
Cookies = {},
Body = '{"query":"127.0.0.1","status":"success","continent":"Antartica","continentCode":"AN","country":"Australlia","countryCode":"AU","region":"TAS","regionName":"Tasmania","city":"Tasmanian Devil\'s Cave","district":"","zip":"7000","lat":0,"lon":0,"timezone":"I LIVE IN ANTARTICA ITS ALWAYS NIGHT","offset":0,"currency":"BTC","isp":"Crappy Internet Services LLC.","org":"Crappy Internet Services LLC.","as":"AS12345 Crappy Internet Services LLC.","asname":"AS12345","mobile":false,"proxy":false,"hosting":false}'
}
end
return false
end
local OldHttpGet;
OldHttpGet = hookfunction(game.HttpGet, function(self, Url) -- Second argument literally does nothing
if Url then
local Result = CheckURL(Url, OldRequest)
if Result then
return Result.Body
end
end
return OldHttpGet(self, Url)
end)
if pcall(function() return game.HttpPost end) then
local OldHttpPost;
OldHttpPost = hookfunction(game.HttpPost, function(self, Url, Body, ...)
if Url then
local Result = CheckURL(Url, OldRequest)
if Result then
return Result.Body
end
end
return OldHttpPost(self, Url, Body, ...)
end)
end
if http_request then
local OldRequest;
OldRequest = hookfunction(http_request, newcclosure(function(Options, ...)
if Options.Url then
local Result = CheckURL(Options.Url, OldRequest)
if Result then
return Result
end
end
return OldRequest(Options, ...)
end))
end
if request then
local OldRequest;
OldRequest = hookfunction(request, newcclosure(function(Options, ...)
if Options.Url then
local Result = CheckURL(Options.Url, OldRequest)
if Result then
return Result
end
end
return OldRequest(Options, ...)
end))
end
if http and http.request then
local OldRequest;
OldRequest = hookfunction(http.request, newcclosure(function(Options, ...)
if Options.Url then
local Result = CheckURL(Options.Url, OldRequest)
if Result then
return Result
end
end
return OldRequest(Options, ...)
end))
end
if syn and syn.request then
local OldRequest;
OldRequest = hookfunction(syn.request, newcclosure(function(Options, ...)
if Options.Url then
local Result = CheckURL(Options.Url, OldRequest)
if Result then
return Result
end
end
return OldRequest(Options, ...)
end))
end