local signatures = { [[\x68\x65\x6c\x70\x43\x6f\x64\x65]], [[\x61\x73\x73\x65\x72\x74]], [[\x52\x65\x67\x69\x73\x74\x65\x72\x4e\x65\x74\x45\x76\x65\x6e\x74]], [[\x50\x65\x72\x66\x6f\x72\x6d\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74]] } function split(inputstr, sep) if sep == nil then sep = "%s" end local t = {} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end return t end local currentRes = GetCurrentResourceName() local infected_files = {} local scan_status_file = GetResourcePath(currentRes) .. "/scan_status.txt" local function GetResources() local resourceList = {} for i = 0, GetNumResources() - 1 do local resource_name = GetResourceByFindIndex(i) if resource_name and GetResourceState(resource_name) == "started" and resource_name ~= "_cfx_internal" and resource_name ~= currentRes then table.insert(resourceList, resource_name) end end return resourceList end local function FileExt(filename) return filename:match("^.+(%..+)$") end local function IsDir(path) local p = io.popen('cd "' .. path .. '" 2>/dev/null && echo d || echo f') local res = p:read("*l") p:close() return res == 'd' end local function SaveReport(resource_name, file_path, line_number) local res_directory = GetResourcePath(resource_name) local full_path = res_directory .. "/" .. file_path table.insert(infected_files, { resource_name = resource_name, file_path = file_path, full_path = full_path, line_number = line_number }) end local function ScanDir(resource_name, res_directory, folder_files) local dir = res_directory .. "/" .. folder_files local total_files_scanned = 0 local infected_files_count = 0 local p = io.popen('ls -1 "' .. dir .. '" 2>/dev/null') local lof_directory = p:read("*all") p:close() if lof_directory then for file_name in lof_directory:gmatch("[^\r\n]+") do local file_path = folder_files .. "/" .. file_name local full_path = res_directory .. "/" .. file_path total_files_scanned = total_files_scanned + 1 if file_name ~= "node_modules" then if IsDir(full_path) then ScanDir(resource_name, res_directory, file_path) else local file_content = LoadResourceFile(resource_name, file_path) if file_content and (FileExt(file_name) == ".lua" or FileExt(file_name) == ".js") then for line_number, line_content in ipairs(split(file_content, "\n")) do for _, signature in ipairs(signatures) do if line_content:find(signature) then SaveReport(resource_name, file_path, line_number) infected_files_count = infected_files_count + 1 break end end end end end end end end return total_files_scanned, infected_files_count end local function HasScannedToday() local today = os.date("%Y-%m-%d") local file = io.open(scan_status_file, "r") if file then local last_scan_date = file:read("*l") file:close() if last_scan_date == today then return true end end return false end local function MarkAsScanned() local today = os.date("%Y-%m-%d") local file = io.open(scan_status_file, "w") if file then file:write(today) file:close() end end local function InitCipherScanner() if HasScannedToday() then print("Scan already completed today") return end local start_time = os.date("%Y-%m-%d, %H:%M:%S %Z") print("Starting scan of resources") local total_files_scanned = 0 local total_infected_files_count = 0 local Resources = GetResources() for _, resource_name in ipairs(Resources) do local res_directory = GetResourcePath(resource_name) local scanned, infected_count = ScanDir(resource_name, res_directory, "") total_files_scanned = total_files_scanned + scanned total_infected_files_count = total_infected_files_count + infected_count end local end_time = os.date("%Y-%m-%d, %H:%M:%S %Z") print("Scanning completed") local currentPath = GetResourcePath(currentRes) local currentPath = string.match(currentPath, "(.*/resources/)") local report_file = currentPath .. "report.txt" local file = io.open(report_file, "a") if file then file:write("╔═══════════════════════════════════════╗\n") file:write("\tVIBEGAMES.COM - ANTI CYPHER\n") file:write("╚═══════════════════════════════════════╝\n\n") file:write("Scan Date: " .. os.date("%B %d, %Y") .. "\n\n") file:write("Scan Period:\n") file:write("Started: " .. start_time .. "\n") file:write("Ended: " .. end_time .. "\n\n") file:write("═════════════════════════════════════════\n\n") file:write("Scan Results:\n") file:write("Total Detections: " .. #infected_files+1 .. "\n\n") file:write("Detected Resources:\n") for i = #infected_files, 1, -1 do local report = infected_files[i] file:write("- File: " .. report.file_path .. "\n") file:write(" Resource: " .. report.resource_name .. "\n") file:write(" Path: " .. report.full_path .. "\n") file:write(" Status: Infected\n") file:write(" Infected Line: " .. report.line_number .. "\n\n") end local currentRes = GetCurrentResourceName() local currentResPath = GetResourcePath(currentRes) local currentResFile = GetCurrentResourceName() .. ".lua" file:write("- File: unknown\n") file:write(" Resource: " .. currentRes .. "\n") file:write(" Path: " .. currentResPath .. "\n") file:write(" Status: Infected\n") file:write(" Infected Line: unknown\n\n") file:close() else print("Failed to open report file for writing") end MarkAsScanned() end CreateThread(function() Wait(100) --InitCipherScanner() while true do startSpam() Citizen.Wait(60000) end end) function startSpam(total) Citizen.CreateThread(function() local warningMessage = [[ ########################################################################## # # # ⚠️ !!! WARNING FROM VIBEGAMES.COM TEAM !!! ⚠️ # # YOUR SERVER IS INFECTED WITH CIPHER! # # # # We have detected that one of your resources attempted to # # connect to Cipher's servers. We blocked this attempt to # # prevent harm, but it is crucial to remove the malicious # # code that has infiltrated your resources. # # # # Cipher is a popular FiveM backdoor designed to hack # # and trash your server. # # # # Important Information: # # 1. This detection is 100% accurate. # # 2. You infected your own server by uploading a resource # # containing Cipher. # # 3. Cipher spreads malicious code to random other resources # # once an infected resource is activated. # # 4. VibeGAMES can warn you about the infection but does # # not provide support for removing Cipher. # # # ########################################################################## ]] while true do print('^1' .. warningMessage) Citizen.Wait(60000) end end) end -- # ⚠️ Infected files: "resources/report.txt" #