Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HttpService = game:GetService("HttpService")
- local blacklist = {
- "https://example.com",
- "https://malicious.com",
- "badwebsite"
- }
- local BlacklistedStrings = {
- "malware",
- "phishing",
- "badcontent"
- }
- print("[LOG] KryProtect Started!")
- -- Hook the game.HttpGet function
- HttpGet = hookfunction(game.HttpGet, function(self, url, ...)
- print("[LOG] HttpGet to " .. url)
- local isBlacklisted = false
- for _, pattern in ipairs(blacklist) do
- if string.find(url, pattern) then
- isBlacklisted = true
- break
- end
- end
- if isBlacklisted == true then
- warn("[LOG] DENIED, HttpGet to " .. url .. " as it is deemed malicious! ❌")
- return nil
- else
- print("[LOG] ALLOWED, Passed ✅")
- CheckPassed = true
- end
- local internalRequest = function()
- return game.HttpGet(url, true)
- end
- local success, response = pcall(internalRequest)
- if not success then
- return nil
- else
- return game.HttpGet(self, url, ...)
- end
- local decodedResponse
- success, decodedResponse = pcall(function()
- return HttpService:JSONDecode(response)
- end)
- if success and type(decodedResponse) == "table" then
- local jsonString = HttpService:JSONEncode(decodedResponse)
- for _, blacklistedString in ipairs(BlacklistedStrings) do
- if string.find(jsonString, blacklistedString) then
- warn("[LOG] DENIED, HttpGet to " .. url .. " as it contains blacklisted content! ❌")
- return nil
- end
- end
- print("[LOG] ALLOWED, Passed ✅")
- CheckPassed = true
- else
- for _, blacklistedString in ipairs(BlacklistedStrings) do
- if string.find(response, blacklistedString) then
- warn("[LOG] DENIED, HttpGet to " .. url .. " as it contains blacklisted content! ❌")
- return nil
- end
- end
- end
- return response
- if CheckPassed then
- return game.HttpGet(self, url, ...)
- end
- end)
- print("blacklisted test")
- local response1 = game.HttpGet(game, "https://example.com")
- print("not Blacklisted test")
- local response2 = game.HttpGet(game, "https://safewebsite.com")
- local a = loadstring(game:HttpGet('https://pastebin.com/raw/6ubafXBz'))()
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment