LynXS_

Untitled

Jul 20th, 2024 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2.  
  3. local blacklist = {
  4. "https://example.com",
  5. "https://malicious.com",
  6. "badwebsite"
  7. }
  8.  
  9. local BlacklistedStrings = {
  10. "malware",
  11. "phishing",
  12. "badcontent"
  13. }
  14.  
  15. print("[LOG] KryProtect Started!")
  16.  
  17. -- Hook the game.HttpGet function
  18. HttpGet = hookfunction(game.HttpGet, function(self, url, ...)
  19. print("[LOG] HttpGet to " .. url)
  20. local isBlacklisted = false
  21. for _, pattern in ipairs(blacklist) do
  22. if string.find(url, pattern) then
  23. isBlacklisted = true
  24. break
  25. end
  26. end
  27. if isBlacklisted == true then
  28. warn("[LOG] DENIED, HttpGet to " .. url .. " as it is deemed malicious! ❌")
  29. return nil
  30. else
  31. print("[LOG] ALLOWED, Passed ✅")
  32. CheckPassed = true
  33. end
  34. local internalRequest = function()
  35. return game.HttpGet(url, true)
  36. end
  37. local success, response = pcall(internalRequest)
  38. if not success then
  39. return nil
  40. else
  41. return game.HttpGet(self, url, ...)
  42. end
  43. local decodedResponse
  44. success, decodedResponse = pcall(function()
  45. return HttpService:JSONDecode(response)
  46. end)
  47. if success and type(decodedResponse) == "table" then
  48. local jsonString = HttpService:JSONEncode(decodedResponse)
  49. for _, blacklistedString in ipairs(BlacklistedStrings) do
  50. if string.find(jsonString, blacklistedString) then
  51. warn("[LOG] DENIED, HttpGet to " .. url .. " as it contains blacklisted content! ❌")
  52. return nil
  53. end
  54. end
  55. print("[LOG] ALLOWED, Passed ✅")
  56. CheckPassed = true
  57. else
  58. for _, blacklistedString in ipairs(BlacklistedStrings) do
  59. if string.find(response, blacklistedString) then
  60. warn("[LOG] DENIED, HttpGet to " .. url .. " as it contains blacklisted content! ❌")
  61. return nil
  62. end
  63. end
  64. end
  65. return response
  66. if CheckPassed then
  67. return game.HttpGet(self, url, ...)
  68. end
  69. end)
  70.  
  71. print("blacklisted test")
  72. local response1 = game.HttpGet(game, "https://example.com")
  73.  
  74. print("not Blacklisted test")
  75. local response2 = game.HttpGet(game, "https://safewebsite.com")
  76.  
  77. local a = loadstring(game:HttpGet('https://pastebin.com/raw/6ubafXBz'))()
  78. print(a)
Advertisement
Add Comment
Please, Sign In to add comment