Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Constants for threat levels
- local ThreatLevels = {
- Low = "Low",
- Medium = "Medium",
- High = "High"
- }
- -- List of allowed scripts
- local allowed = {}
- -- Lists of threat levels
- local LOWthreatLevel = {
- "print",
- "Loadstring",
- "require"
- }
- local MEDthreatLevel = {
- "workspace.DistributedGameTime",
- "game:GetService",
- "game:service",
- "service",
- "game:HttpGet",
- "game:GetObjects",
- "game:GetService('HttpService'):GetAsync",
- "game:GetService('HttpService'):PostAsync",
- "game:GetService('HttpService'):JSONDecode",
- "game:GetService('HttpService'):JSONEncode",
- "game:GetService('HttpService'):GetAsync",
- "game:GetService('HttpService'):PostAsync"
- }
- local HIGHthreatLevel = {
- "os.",
- "io.",
- "filesystem.",
- "loadstring(",
- "writefile(",
- "readfile(",
- "rconsoleprint(",
- "writefile(",
- "readfile(",
- "rconsolename(",
- "rconsolewarn(",
- "rconsoleerror("
- }
- local virusNames = {
- "synapse",
- "serverlock",
- "freeexploit",
- "exe"
- }
- -- Function to create a template for displaying threats
- local function createTemplate(threatName, threatLevel, scriptName, script, isModule, moduleParent)
- local clone = script.ScanButton.Template:Clone()
- clone.Parent = script.ScanButton
- clone.Name = scriptName
- clone.Visible = true
- clone.ThreatLevel.Text = "Threat Level: " .. threatLevel
- clone.ThreatName.Text = "Threat: " .. threatName
- clone.ScriptName.Text = "Script: " .. scriptName
- -- Function to handle actions when the template buttons are clicked
- local function handleActions()
- for _, child in pairs(clone.ActionsButton:GetChildren()) do
- if child:IsA("TextButton") then
- child.Visible = true
- end
- end
- local allowBtn = clone.ActionsButton.Allow
- allowBtn.MouseButton1Click:Connect(function()
- clone:Destroy()
- table.insert(allowed, scriptName)
- end)
- local qBtn = clone.ActionsButton.quaraButton
- qBtn.MouseButton1Click:Connect(function()
- if isModule then
- local safeZone = game.ServerStorage:FindFirstChild("[MonkeDefender]Safe Zone") or Instance.new("Folder")
- safeZone.Name = "[MonkeDefender]Safe Zone"
- safeZone.Parent = game.ServerStorage
- script.Parent = safeZone
- if not script:IsA("ModuleScript") then
- script.Disabled = true
- end
- moduleParent.Parent = safeZone
- clone:Destroy()
- end
- end)
- end
- clone.ActionsButton.MouseButton1Click:Connect(handleActions)
- end
- -- Function to scan a script for threats
- local function scanScript(script, allowedScripts)
- for _, threatName in pairs(virusNames) do
- if script.Name:lower() == threatName:lower() then
- createTemplate(threatName, ThreatLevels.Medium, script.Name, script, false)
- end
- end
- for _, threatName in pairs(HIGHthreatLevel) do
- if script.Source:lower():find(threatName:lower()) then
- createTemplate(threatName, ThreatLevels.High, script.Name, script, true, script)
- end
- end
- for _, threatName in pairs(MEDthreatLevel) do
- if script.Source:lower():find(threatName:lower()) then
- createTemplate(threatName, ThreatLevels.Medium, script.Name, script, true, script)
- end
- end
- for _, threatName in pairs(LOWthreatLevel) do
- if script.Source:lower():find(threatName:lower()) then
- createTemplate(threatName, ThreatLevels.Low, script.Name, script, true, script)
- end
- end
- end
- -- Function to handle scan button click
- script.ScanButton.MouseButton1Click:Connect(function()
- script.labelclone.Visible = false
- script.novirus.Visible = false
- for _, child in pairs(game:GetDescendants()) do
- if child:IsA("Script") and not allowed[child.Name] then
- scanScript(child, allowed)
- end
- end
- if not script.ScanButton:GetChildren()[4] then
- script.novirus.Visible = true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement