This script allows you to stop backdoors by ‘rewriting’ the require with a whitelist soo it doesn’t execute some rando module script and get your game infected
This script is basically a Third-party asset blocker but with a whitelist
Debug allows you to see the debug message the script gives you about an id or module script
This is when you require a module in your game to make sure you trust this module
This is when a whitelisted require executed it will print out if debug is enabled and the lol is the main module I used
This is when the id isn’t whitelisted soo it errors (it will say the error even debug false)
How does it work?
Basically, when you execute the script in the command bar in studio it will get every script in the path you gave it and it will inject a script that will overwrite the require when the game is launched and the whitelist, etc
How do add an id to the whitelist?
to add multiple ids separate each id with a “,” example:{7020086929,7019417578}
How to remove the injected scripts from all of your scripts?
You put Mode into true and it will clean your scripts from the injected script from this script
(make sure you didn’t make a change to the script (like adding ids) because the script will not clean it
Does this work with obfuscated scripts that require?
Yes, surprisingly yes it does work
If you have any questions?
tell me in the comments of this thread ^^
Is this open source?
Yes, as long you give me credits I’m ok with that
Where to execute the script?
you execute the script in the command bar
What’s the seed?
put something random like example: “lolokokok”
soo it’s basically unique soo hackers can’t figure out how to replicate it and stop it from protecting
If you found a way to bypass it, please post it in the comments so I can see it
The script:
--[[Require Rewriter v1.4 allows you to stop or alert that there could be a backdoor executing
and allow to see what is requiring in the background
Made by Mimi
]]--
local Mode = false --True = remove the injected scripts from all your scripts false = add the inject the scripts on all your scripts
local Debug = true --Allows you to see the debug message whenever there is something
local path = game.Workspace --The path the script will look for scripts to inject
local Seed = "PUT RANDOM THINGS HERE" --Put some random things it's to stop hackers trying to stop it (basicly it will make it unique)
--PLEASE ONLY EDIT THE CONTENTS OF WHITELIST (the table) OR SEED IT COULD MESS UP THE SCRIPT ONLY EDIT THE REST OF THE SCRIPT IF YOU KNOW WHAT YOUR DOING!!
local lol = [[--Require rewriter made by Mimi 😎
local whitelist = {ID HERE}
local seed = "]]..tostring(Seed)..[["
local oldre = getfenv().require
local debug = ]]..tostring(Debug)..[[
getfenv().require = function(v)
if tostring(type(v)) == 'number' then
if table.find(whitelist,v) ~= nil then
if debug == true then
print("Security Debug :: Id:"..v)
end
return oldre(v)
else
error('Security :: This assetid hasnt been whitelisted id:'..v..' and will not be executed!')
end
elseif tostring(type(v)) == 'userdata' then
if debug == true then
warn('Security Debug :: Make sure you trust this instance because it will be executed Instance:'..v:GetFullName())
end
return oldre(v)
end
end
local debug = ""
local whitelist = ""
local seed = {}
local oldre = {}
local getfenv = function()
end
local cor = coroutine.wrap(function()
local cor = "same"
local compare = require
spawn(function()
while true do
game:GetService("RunService").Stepped:Wait()
if require ~= compare then
error("Security :: !!ALERT!! REQUIRE HAS BEEN OVERWRITTEN A BACKDOOR COULD HAVE BEEN EXECUTED SCRIPT:"..script:GetFullName())
end
end
end)
]]
local lol2 = [[
end)
cor()
]]
if Mode == false then
print("Require rewriter is currently adding a script to all your script.")
for i,v in pairs(path:GetDescendants()) do
local sus = string.lower(v.ClassName)
if sus:find("script") then
local funny = v.Source
if not funny:find(lol, 1, true) then
v.Source = lol..funny..lol2
v.LinkedSource = ""
else
print("Found already existing script in game."..v:GetFullName())
end
end
end
else
print("Require rewriter is currently removing the require rewriter script to all your script.")
for i,v in pairs(path:GetDescendants()) do
local sus = string.lower(v.ClassName)
if sus:find("script") then
local funny = v.Source
if funny:find(lol, 1, true) then
v.Source = string.split(funny,lol)[2]
local funny = v.Source
if funny:find(lol2, 1, true) then
v.Source = string.split(funny,lol2)[1]
end
end
end
end
end
print("Done! Thank you for using Require rewriter by Mimi!")
if you find any bugs please send a comment on the thread
Enjoy ^^