Guardian
Key Required VerifiedUniversal

Guardian

Universal ScriptHypernovaHypernova 877.6K views 1.1K executesUpdated Oct 7, 2022
4.7/ 5(15 votes)
14193% Positive
Lua Script•219 lines (10157 chars)
if not game:IsLoaded() then game.Loaded:Wait() end
local hrequest=(typeof(syn)=='table'and syn.request)or(typeof(http)=='table'and http.request)or(typeof(fluxus)=='table'and fluxus.request)or request or http_request
getgenv().options={
    MaliciousNamecalls=true,
    ChatBan=true,
    PetSim=true,
    MiningSim=true,
    AntiLog=true,
    AutoJoin=true
}
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local StarterGui=game:GetService("StarterGui")
if options.ChatBan then
    local ChatBar=LocalPlayer.PlayerGui:WaitForChild("Chat"):WaitForChild("Frame").ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
    local ChatScript=LocalPlayer.PlayerScripts:WaitForChild("ChatScript")
    local ChatMain = ChatScript:WaitForChild("ChatMain")
    local MessagePostedEvent
    local SayMessageRequest=game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest
    for _, Event in next, debug.getupvalues(require(ChatMain).MessagePosted.fire) do
        if typeof(Event) == "Instance" then
            MessagePostedEvent = Event
        end
    end
    local old1
    old1=hookmetamethod(game,"__namecall",newcclosure(function(self,...)
        local method=getnamecallmethod()
        if method=="FireServer" and self==SayMessageRequest and getcallingscript()~=ChatMain then
            warn("SayMessageRequest remote event attempted to fire. Attempt denied.")
            return
        elseif method=="CaptureFocus" and self==ChatBar then
            warn("Chat focus capture as local player was attempted. Attempt denied.")
            if getcallingscript()~=ChatScript then
                if not getgenv().a then
                    StarterGui.SetCore(StarterGui,"SendNotification",{
                        Title="WARNING!",
                        Text=getcallingscript()==nil and "The script executed is trying to force you to chat!" or "The game is trying to force you to chat in "..getcallingscript().GetFullName(getcallingscript()),
                        Button1="Okay!",
                        Duration=10
                    })
                    StarterGui.SetCore(StarterGui,"SendNotification",{
                        Title="What to do",
                        Text=getcallingscript()==nil and "It is recommended to rejoin the game and to not execute the script again." or "It is recommended you go there (through dex) and disable/delete it to avoid accidentally sending potentially inappropriate messages.",
                        Button1="Okay!",
                        Duration=10
                    })
                    if getcallingscript() then
		                setclipboard(getcallingscript().GetFullName(getcallingscript()))
                        StarterGui.SetCore(StarterGui,"SendNotification",{
                            Title="Copied to clipboard",
                            Text="The path has also been copied to clipboard so you won't lose it in case this warning is gone too fast.",
                            Button1="Okay!",
                            Duration=10
                        })
                    end
                    getgenv().a="e"
                end
            end
            return
        elseif method=="ReportAbuse" and self==Players then
            warn("Player report was attempted. Attempt denied.")
            return error("Ha ha")
        elseif method=="Fire" and self==MessagePostedEvent then
            warn("MessagePosted usage was attempted. Attempt denied.")
            return
        end
        return old1(self,...)
    end))
    local old2;
    old2=hookmetamethod(game,"__index",newcclosure(function(self,b,...)
        if b=="FireServer" and self==SayMessageRequest and getcallingscript()~=ChatMain then
            warn("SayMessageRequest remote event attempted to fire. Attempt denied.")
            return
        elseif b=="CaptureFocus" and self==ChatBar then
            warn("Chat focus capture as local player was attempted. Attempt denied.")
            if getcallingscript()~=ChatScript then
                if not getgenv().c then
                    StarterGui.SetCore(StarterGui,"SendNotification",{
                        Title="WARNING!",
                        Text=getcallingscript()==nil and "The script executed is trying to force you to chat!" or "The game is trying to force you to chat in "..getcallingscript():GetFullName(),
                        Button1="Okay!",
                        Duration=10
                    })
                    StarterGui.SetCore(StarterGui,"SendNotification",{
                        Title="What to do",
                        Text=getcallingscript()==nil and "It is recommended to rejoin the game and to not execute the script again." or "It is recommended you go there (through dex) and disable/delete it to avoid accidentally sending potentially inappropriate messages.",
                        Button1="Okay!",
                        Duration=10
                    })
                    if getcallingscript() then
		                setclipboard(getcallingscript():GetFullName())
                        StarterGui.SetCore(StarterGui,"SendNotification",{
                            Title="Copied to clipboard",
                            Text="The path has also been copied to clipboard so you won't lose it in case this warning is gone too fast.",
                            Button1="Okay!",
                            Duration=10
                        })
                    end
                    getgenv().c="e"
                end
            end
            return
        elseif b=="ReportAbuse" and self==Players then
            warn("Player report was attempted. Attempt denied.")
            return error("Ha ha")
        elseif b=="Fire" and self==MessagePostedEvent then
            warn("MessagePosted usage was attempted. Attempt denied..")
            return
        end
        return old2(self,b,...)
    end))
    task.spawn(function()
        while task.wait() do
            if not ChatBar:IsFocused() and ChatBar.Text~="" then 
                ChatBar.Text=""
            end 
        end
    end)
end
if options.MaliciousNamecalls then
    local st={"Instance","Game"}
    hookmetamethod(game,"__tostring",newcclosure(function(a,...)
        return table.find(st,a.Name) and a.ClassName or a.Name 
    end))
    local old3,old4
    local namecall={
        ["BrowserService"]={
            ["OpenBrowserWindow"]=1,
            ["ExecuteJavaScript"]=2
        },
        ["MarketPlaceService"]={
            ["PerformPurchase"]=1,
            ["GetRobuxBalance"]=2
        },
        ["MessageBusService"]={
            ["Publish"]=1,
            ["GetMessageId"]=2
        },
        ["HttpService"]={
            ["RequestInternal"]=1
        },
        ["GuiService"]={
            ["OpenBrowserWindow"]=1
        },
        ["DataModel"]={
            ["OpenVideosFolder"]=1
        }
    }
    old3=hookmetamethod(game,"__namecall",newcclosure(function(self,...)
        if rawget(namecall,tostring(self)) and rawget(namecall[tostring(self)],getnamecallmethod()) then
            warn("Malicious namecall attempted execution. Attempt denied.")
            return error("Get owned")
        end
        return old3(self,...)
    end))
    old4=hookmetamethod(game,"__index",newcclosure(function(self,b,...)
        if rawget(namecall,old4(self,"Name")) and rawget(rawget(namecall,old4(self,"Name")),i) then
			warn("Malicious namecall attempted execution. Attempt denied.")
            return error("Get owned")
        end
        return old4(self,b,...)
    end))
end
local old6
old6=hookfunction(hrequest,function(...)
    local args={...}
    if options.AntiLog and args[1].Url:find("webhooks") then
        warn(("Script attempted to log info at %s. Attempt denied."):format(args[1].Url))
        args[1].Url="https://google.com"
        return old6(unpack(args))
    elseif options.AutoJoin and args[1].Url:find("rpc") then
        warn(("Script attempted to auto join %s. Attempt denied."):format("https://discord.gg/"..game:GetService("HttpService"):JSONDecode(args[1].Body).args.code)) 
        return 
    end 
    return old6(...)
end)
if options.PetSim and game.PlaceId==6284583030 then
    local bank=workspace:WaitForChild("__THINGS"):WaitForChild("__REMOTES"):WaitForChild("invite to bank")
    local old
    old=hookmetamethod(game,"__namecall",newcclosure(function(self,...)
        if checkcaller() and self==bank and getnamecallmethod()=="InvokeServer" then
            local args={...}
            task.spawn(function()
                warn(("Script attempted to give user named %s (ID: %s) access to your bank. Attempt denied."):format(Players:GetNameFromUserIdAsync(args[1][2]),args[1][2]))
            end)
            return 
        end
        return old(self,...)
    end))
    local oldd
    oldd=hookfunction(Instance.new("RemoteFunction").InvokeServer,newcclosure(function(self,...)
        if checkcaller() and self==bank then
            local args={...}
            task.spawn(function()
                warn(("Script attempted to give user named %s (ID: %s) access to your bank. Attempt denied."):format(Players:GetNameFromUserIdAsync(args[1][2]),args[1][2]))
            end)
            return
        end
        return oldd(self,...)
    end))
elseif game.PlaceId==9551640993 and options.MiningSim then
    local tr=game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("ConfirmTrade")
    local old
    old=hookmetamethod(game,"__namecall",newcclosure(function(self,...)
        if checkcaller() and self==tr and getnamecallmethod()=="FireServer" then
            warn("Script attempted to confirm a potentially rigged/scam trade. Attempt denied.")
            return
        end
        return old(self,...)
    end))
    local oldd
    oldd=hookfunction(Instance.new("RemoteEvent").FireServer,newcclosure(function(self,...)
        if checkcaller() and self==tr then
            warn("Script attempted to confirm a potentially rigged/scam trade. Attempt denied.")
            return
        end
        return oldd(self,b,...)
    end))
end

Features & Information

After seeing the positive impact my latest security-related release (the chat ban patch https://scriptblox.com/script/Universal-Script-Chat-ban-patch-4334) has had for many users that fell victim to Roblox's own vulnerabilities, I decided to take it a step further, and after a lot of time developing, testing, quality-assuring, and even risking my accounts in the process, I am happy to present: Guardian Guardian is my new release that is all about security and protection. It will protect users from Roblox/user-made malicious functions/scripts with real-time warnings of anything malicious that might be going on in the background (you can view it simply by pressing F9 to view the dev console). In there you will see what was blocked and a short description of what it actually is (and in later updates, maybe even an explanation as to why it's malicious!). Current things Guardian protects users from: 1. Universal: a. The Roblox chat ban patch (the same one from my previous release, now with improved speed and efficiency). b. Malicious namecalls - Guardian will protect users from Roblox services' methods that pose a risk of a security breach and/or the ability to do stuff on the player's computer outside of the client. This option is especially recommended for people with unprotected executors that do not block these methods by default. c. Anti log - Guardian will automatically prevent all logging attempts and disable any hidden webhook that may lie in sneaky scripts and will notify of the webhook link. d. Auto join - Guardian will automatically detect and disable any attempt to autojoin the user to any discord server and will notify of the invite link. 2. Game specific: a. Pet Simulator X - Guardian will protect users from running fake, malicious "dupe scripts", and notify you of the user trying to access the bank (name and ID) b. Mining Simulator 2 - Same as Pet Simulator X without the user and ID And that's not all! I figured it would be a good idea to let the user take the wheel and only use the features found necessary, so you can choose which things you want Guardian to monitor! Simply head over to options (line 3) and modify the configuration to your liking, it is completely customizable! (Note that all the options are enabled by default to protect non-developers and if you don't know what you're doing it's best to keep default settings) Please note that this is a very early version of this that focuses on the most serious issues, so I will be adding more stuff in future updates (this is especially true for the malicious namecalls part. In this version, I focused on the more destructive methods first that can result in RCE/ACE (remote/arbitrary code execution) vulnerabilities). This is NOWHERE near complete, so if you find any issues/bugs with it or have any suggestions for improvements and future patches, feel free to either reply here or DM me on discord (Hypernova#0721) and I will gladly add your feedback in a future update along with credits (if you'd like). This supports regular execution as well as autoexec, so if you care about staying safe, I recommend putting it in your autoexec folder. For anyone wondering, yes, that means I am ending support for the chat ban patch (in its original release), and instead will keep updating the one here as it was combined with the rest. CREDITS: https://v3rmillion.net/showthread.php?tid=1177803 - found most of the (extra) malicious namecalls here sol#0037 / https://scriptblox.com/u/sol_ - helped me quality assure design stuff and description, gave feedback during development, not blocking me after constant bugging for opinions on stuff (lol) Chaotic Mind#0666 / https://scriptblox.com/u/Chaotic_Mind - gave feedback during development TODO: 1. Malicious namecall index - DONE 2. Tooltips (?) 3. More patches CHANGELOG: v1.0.1: 1. Added anti log - suggested by https://scriptblox.com/u/Vinz 2. Added malicious namecall index v1.0.2: 1. Added anti autojoin - credits to Deducted#1625 for thinking about this idea first. He has given me permission to add it to Guardian. 2. Changed options to getgenv() to allow easier access for some of the options. Currently: AntiLog and AutoJoin. This means you won't have to re-execute the script to change these 2 options.
#Security#Patch#Guardian

Community Comments (13)

FoamyFoamyOct 7, 2022(edited)

looks cool i may try it

adiosadiosOct 7, 2022(edited)

seems to work man, congrats

kooggykooggyOct 8, 2022(edited)

GREAST SCRIPT THANKS again for help lol!! thanks toyou i pro am scripting!!@@ also sunken is cool very so cool my best friend forever!! :blushing_emoji:

HypernovaHypernovaownerOct 8, 2022(edited)

@adios @kooggy my honor =)

noob_1234noob_1234Oct 11, 2022(edited)

it not work on mine

HypernovaHypernovaownerOct 11, 2022(edited)

@dnlbriones11 what do you mean it doesn't work? If you're talking interface stuff it's not supposed to show anything

fabribubelufabribubeluOct 12, 2022(edited)

:skull:

dotggdotggOct 14, 2022(edited)

add bee swarm, like this script https://www.youtube.com/watch?v=wCN2L-xL0oM buys basic eggs and making ur hive full of basic bees

dotggdotggOct 14, 2022(edited)

^tho on 'showcase' its diffirent, its just changing honey value

HypernovaHypernovaownerOct 15, 2022(edited)

@dotgg will do, thanks for the suggestion!

_eya_eyaOct 15, 2022(edited)

pretty useful but it will break a lot of paid scripts

HypernovaHypernovaownerOct 15, 2022(edited)

@botslaye shouldn't break anything that is not meant to be malicious. If it's about the discord stuff it's easily toggleable without having to reexecute

daz_daz_Oct 16, 2022(edited)

very good

More Scripts for Universal Scripts