├── webhook.lua ├── config.lua ├── fxmanifest.lua ├── cl_core.lua ├── sv_guard.lua ├── LICENSE ├── whitelist.lua ├── fsguard.sql ├── cl_guard.lua ├── README.md └── sv_core.lua /webhook.lua: -------------------------------------------------------------------------------- 1 | WebhookUrl = "" -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | DebugMode = false -- Enable debug mode (true/false) -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version "cerulean" 2 | game "gta5" 3 | author 'FutureSeekerTech' 4 | description 'FS Guard V2' 5 | lua54 'yes' 6 | version '2.3.0' 7 | 8 | shared_scripts { 9 | '@ox_lib/init.lua', 10 | 'config.lua', 11 | } 12 | 13 | client_scripts { 14 | 'cl_core.lua', 15 | 'cl_guard.lua', 16 | } 17 | 18 | server_scripts { 19 | 'whitelist.lua', 20 | 'webhook.lua', 21 | 'sv_core.lua', 22 | 'sv_guard.lua', 23 | '@oxmysql/lib/MySQL.lua', 24 | } 25 | 26 | dependencies { 27 | 'ox_lib', 28 | 'oxmysql', 29 | } -------------------------------------------------------------------------------- /cl_core.lua: -------------------------------------------------------------------------------- 1 | -- OnResourceStart 2 | local Debug = DebugMode or false 3 | local SafeCallEvent = TriggerServerEvent 4 | local init = false 5 | local wl = {} 6 | AddEventHandler("onResourceStart", function(resourceName) 7 | if GetCurrentResourceName() == resourceName then 8 | SafeCallEvent("fs-guard:it", GlobalState["fs-guard"]) 9 | SafeCallEvent("fs-guard:server:wl") 10 | init = true 11 | end 12 | end) 13 | 14 | RegisterNetEvent('fs-guard:client:wl', function(data) 15 | wl = data 16 | end) 17 | 18 | function whitelist(name) 19 | if #wl > 0 then 20 | return wl[name] or false 21 | end 22 | end exports('whitelist', whitelist) 23 | 24 | CreateThread(function() 25 | while not init do 26 | Wait(10000) 27 | SafeCallEvent("fs-guard:it", GlobalState["fs-guard"]) 28 | SafeCallEvent("fs-guard:server:wl") 29 | init = true 30 | end 31 | end) -------------------------------------------------------------------------------- /sv_guard.lua: -------------------------------------------------------------------------------- 1 | SafeEventHandler = AddEventHandler 2 | -- Token Check Event Handler 3 | -- @@ Check token when player trigger server event 4 | GuardEventHandler = function(eventName, callback) 5 | AddEventHandler('onResourceStart', function(resource) 6 | if resource == "fs-guard" or resource == GetCurrentResourceName() then 7 | CreateThread(function() 8 | while GetResourceState("fs-guard") ~= "started" do 9 | Wait(0) 10 | end 11 | exports['fs-guard']:EventRegister(eventName) 12 | end) 13 | end 14 | end) 15 | AddEventHandler(eventName, function(token, ...) 16 | local player = source 17 | local playerName = GetPlayerName(player) 18 | local checkToken = exports['fs-guard']:tc(player, token) 19 | if not checkToken then 20 | exports['fs-guard']:GuardBanPlayer(source, eventName) 21 | CancelEvent() 22 | return 23 | end 24 | callback(table.unpack({ ... })) 25 | end) 26 | end 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 FutureSeekerTech 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /whitelist.lua: -------------------------------------------------------------------------------- 1 | local resources = {} 2 | 3 | function GetAllResources() 4 | for resIdx = 0, GetNumResources() - 1 do 5 | local resource = GetResourceByFindIndex(resIdx) 6 | resources[resource] = true 7 | end 8 | end 9 | GetAllResources() 10 | 11 | RegisterNetEvent('fs-guard:server:wl', function() 12 | print("fs-guard:server:wl") 13 | _source = source 14 | TriggerClientEvent("fs-guard:client:wl", _source, resources) 15 | end) 16 | 17 | AddEventHandler('onResourceStart', function(resource) 18 | if resources[resource] == nil or resources[resource] == false then 19 | GetAllResources() 20 | TriggerClientEvent("fs-guard:client:wl", -1, resources) 21 | end 22 | end) 23 | 24 | AddEventHandler('onResourceStop', function(resource) 25 | resources[resource] = nil 26 | TriggerClientEvent("fs-guard:client:wl", -1, resources) 27 | end) 28 | 29 | RegisterCommand("rcperm", function(source, args, rawCommand) 30 | if args[1] == nil or args[1] == "" then 31 | print("Gunakan rcperm ") 32 | end 33 | -- If the source is > 0, then that means it must be a player. 34 | if (source > 0) then 35 | return false 36 | -- If it's not a player, then it must be RCON, a resource, or the server console directly. 37 | else 38 | print("permission resource:" .. args[1].." : "..tostring(resources[args[1]])) 39 | end 40 | end, true) 41 | 42 | 43 | -------------------------------------------------------------------------------- /fsguard.sql: -------------------------------------------------------------------------------- 1 | -- -------------------------------------------------------- 2 | -- Host: 127.0.0.1 3 | -- Server version: 10.4.27-MariaDB - mariadb.org binary distribution 4 | -- Server OS: Win64 5 | -- HeidiSQL Version: 11.3.0.6295 6 | -- -------------------------------------------------------- 7 | 8 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 9 | /*!40101 SET NAMES utf8 */; 10 | /*!50503 SET NAMES utf8mb4 */; 11 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 12 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 13 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 14 | 15 | -- Dumping structure for table esxlegacy.fsguard 16 | CREATE TABLE IF NOT EXISTS `fsguard` ( 17 | `id` int(11) NOT NULL, 18 | `name` varchar(255) DEFAULT NULL, 19 | `license` varchar(55) DEFAULT NULL, 20 | `steam` varchar(255) DEFAULT NULL, 21 | `hwid` varchar(255) DEFAULT NULL, 22 | `discord` varchar(255) DEFAULT NULL, 23 | `ip` varchar(255) DEFAULT NULL, 24 | `reason` text DEFAULT NULL, 25 | PRIMARY KEY (`id`), 26 | KEY `license` (`license`), 27 | KEY `discord` (`discord`), 28 | KEY `ip` (`ip`) 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; 30 | 31 | -- Data exporting was unselected. 32 | 33 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; 34 | /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; 35 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 36 | /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */; 37 | -------------------------------------------------------------------------------- /cl_guard.lua: -------------------------------------------------------------------------------- 1 | GuardServerEvent = TriggerServerEvent 2 | ATriggerServerEvent = TriggerServerEvent 3 | SafeCallEvent = TriggerServerEvent 4 | 5 | -- New Patch Token updater 6 | function fsgencrypt(key) 7 | local hash = tostring(key) 8 | local newhash = "" 9 | for i = 1, #hash do 10 | currentvalue = hash:sub(i, i) 11 | if currentvalue == '1' then 12 | newhash = newhash .. "2" 13 | end 14 | if currentvalue == '2' then 15 | newhash = newhash .. "4" 16 | end 17 | if currentvalue == '3' then 18 | newhash = newhash .. "3" 19 | end 20 | if currentvalue == '4' then 21 | newhash = newhash .. "8" 22 | end 23 | if currentvalue == '5' then 24 | newhash = newhash .. "1" 25 | end 26 | if currentvalue == '6' then 27 | newhash = newhash .. "2" 28 | end 29 | if currentvalue == '7' then 30 | newhash = newhash .. "4" 31 | end 32 | if currentvalue == '8' then 33 | newhash = newhash .. "6" 34 | end 35 | if currentvalue == '9' then 36 | newhash = newhash .. "8" 37 | end 38 | if currentvalue == '0' then 39 | newhash = newhash .. "0" 40 | end 41 | end 42 | newhash = tonumber(newhash) 43 | modulo = newhash % 2 44 | if modulo == 0 then 45 | newhash = newhash + 57231323 46 | else 47 | newhash = newhash - 12341723 48 | end 49 | return newhash 50 | end 51 | 52 | 53 | TriggerServerEvent = function(eventName, ...) 54 | if string.find(eventName, "__ox_cb") then 55 | return ATriggerServerEvent(eventName, ...) 56 | elseif not lib.callback.await('fs-guard:server:watchdog', false, eventName) then 57 | return ATriggerServerEvent(eventName, ...) 58 | else 59 | local ct = LocalPlayer.state[GlobalState["fs-guard"]] or 0 60 | local nt = fsgencrypt(ct) 61 | LocalPlayer.state:set(GlobalState["fs-guard"], nt, false) 62 | return GuardServerEvent(eventName, ct, ...) 63 | end 64 | end 65 | 66 | GuardEventHandler = function(eventName, callback) 67 | AddEventHandler(eventName, function(...) 68 | invoking = GetInvokingResource() 69 | if invoking == nil or invoking == GetCurrentResourceName() or exports['fs-guard']:whitelist(invoking) then 70 | callback(table.unpack({ ... })) 71 | else 72 | CancelEvent() 73 | SafeCallEvent("fs-guard:server:clientvalidation", invoking, eventName) 74 | end 75 | end) 76 | end 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UPDATE 7 December 2024 2 | - Add anti ox lib callback exploit (Join discord for more info) 3 | # UPDATE 24 October 2024 4 | 5 | The latest update available, for the detail join discord FutureSeekerTech: https://discord.gg/TRwcswBhg3 or https://futureseekertech.tebex.io/ 6 | 7 | Video Showcase: https://youtu.be/jwr8_fYO7vs 8 | 9 | Current Feature: 10 | - Anti Event Exploit (included with encryption method to make sure communication between client and server is safe. All parameter that send to server event is encrypted to prevent to be readed with event logger). 11 | - Anti Exports Exploit 12 | - Discord Logs With ScreenShot 13 | - Hide Server Event Call Feature. Now you can hide server event call from client to be readed with event logger. You can enable or disable this feature 14 | 15 |

16 | 17 |

18 | 19 | # FS-GUARD 20 | 21 | FiveM script untuk mengamankan server event dari Trigger Exploit yang digunakan pada EULEN/RedEngine dan cheat trigger lainnya, dan melakukan auto banned pada player yang menggunakan trigger event pada resource yang telah diprotect dengan FS-GUARD. 22 | 23 | ![preview](https://alfaritsii.github.io/assets/image/fsguard-preview.png) 24 | 25 | ## Installation 26 | 27 | 1. Download/clone repository ini 28 | 2. Extract/Paste folder repository di folder resource server kalian. Pastikan nama foldernya adalah fs-guard 29 | 3. Pastikan start/ensure fs-guard pada server.cfg setelah core framework kalian 30 | 31 | ## Dependency 32 | 1. OXMYSQL 33 | 2. OX_LIB 34 | 35 | ## Penggunaan 36 | 1. Pada resource fs-guard rubah webhook pada sv_core.lua ke discord webhook kalian 37 | 38 | 2. Pada fxmanifest script yang ingin kalian amankan tambahkan: 39 | 40 | '@fs-guard/cl_guard.lua' -> tambahkan dibagian client script dipaling atas/sebelum client script kalian 41 | '@fs-guard/sv_guard.lua' -> tambahkan dibagian server script dipaling atas/sebelum server script kalian 42 | 43 | ![fxmanifest](https://alfaritsii.github.io/assets/image/secure-event.png) 44 | 45 | 3. Pada server script kalian tambahkan GuardEventHandler ketika RegisterNetEvent. Terapkan hal ini pada seluruh RegisterNetEvent 46 | kalian pada resource yang ingin diamankan 47 | 48 | 4. Hal ini juga pada client script, kalian tambahkan GuardEventHandler ketika RegisterNetEvent untuk secure client script 49 | 50 | ![serverscript](https://alfaritsii.github.io/assets/image/fxmanifest-fsguard.png) 51 | 52 | ## Notifikasi Discord 53 | ![notifikasi](https://alfaritsii.github.io/assets/image/notif-fsguard.png) 54 | -------------------------------------------------------------------------------- /sv_core.lua: -------------------------------------------------------------------------------- 1 | local discordWebHook = WebhookUrl or '' 2 | local Debug = DebugMode or false 3 | local isBanDataLoaded = false 4 | local ListBan = {} 5 | local ListSecuredEvent = {} 6 | -- random word hash generator 7 | function hg() 8 | local a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" 9 | local b = "" 10 | for i = 1, 6 do 11 | b = b .. string.char(string.byte(a, math.random(1, #a))) 12 | end 13 | return b 14 | end 15 | 16 | -- random number hash generator for updater 17 | function hg2() 18 | local a = math.random(1, 999999) 19 | return a 20 | end 21 | 22 | -- token generator 23 | function tg() 24 | local a = math.random(1000000000000000, 9999999999999999) 25 | return a 26 | end 27 | 28 | -- token checker (Dont Change) 29 | function tc(src, token) 30 | -- var token server 31 | local ts = Player(src).state[GlobalState["fs-guard"]] 32 | -- var token client 33 | local tc = token 34 | -- check token 35 | if ts == tc then 36 | -- update token even token is correct 37 | if Debug then 38 | pName = GetPlayerName(src) 39 | print("token checker for client "..src.." ("..pName..") is correct") 40 | print("token server: "..ts) 41 | print("token client: "..tc) 42 | end 43 | tu(src, tc) 44 | return true 45 | else 46 | -- Update token 47 | if Debug then 48 | pName = GetPlayerName(src) 49 | print("token checker for client "..src.." ("..pName..") is correct") 50 | print("token checker for client "..src.." is wrong") 51 | print("token server: "..tostring(ts)) 52 | print("token client: "..tostring(tc)) 53 | end 54 | return false 55 | end 56 | end exports("tc", tc) 57 | 58 | -- Token Init 59 | function ti(src) 60 | Player(src).state:set(GlobalState["fs-guard"], tg(), true) 61 | if Debug then 62 | print("token init->id "..src.."->"..Player(src).state[GlobalState["fs-guard"]]) 63 | end 64 | end 65 | 66 | -- New Patch Token updater 67 | function fsgencrypt(key) 68 | local hash = tostring(key) 69 | local newhash = "" 70 | for i = 1, #hash do 71 | currentvalue = hash:sub(i, i) 72 | if currentvalue == '1' then 73 | newhash = newhash .. "2" 74 | end 75 | if currentvalue == '2' then 76 | newhash = newhash .. "4" 77 | end 78 | if currentvalue == '3' then 79 | newhash = newhash .. "3" 80 | end 81 | if currentvalue == '4' then 82 | newhash = newhash .. "8" 83 | end 84 | if currentvalue == '5' then 85 | newhash = newhash .. "1" 86 | end 87 | if currentvalue == '6' then 88 | newhash = newhash .. "2" 89 | end 90 | if currentvalue == '7' then 91 | newhash = newhash .. "4" 92 | end 93 | if currentvalue == '8' then 94 | newhash = newhash .. "6" 95 | end 96 | if currentvalue == '9' then 97 | newhash = newhash .. "8" 98 | end 99 | if currentvalue == '0' then 100 | newhash = newhash .. "0" 101 | end 102 | end 103 | newhash = tonumber(newhash) 104 | modulo = newhash % 2 105 | if modulo == 0 then 106 | newhash = newhash + 57231323 107 | else 108 | newhash = newhash - 12341723 109 | end 110 | return newhash 111 | end 112 | 113 | -- Update Token 114 | function tu(src, ct) 115 | -- new token 116 | local nt = fsgencrypt(ct) 117 | Player(src).state:set(GlobalState["fs-guard"], nt, false) 118 | if Debug then 119 | print("tu->"..src.."->"..Player(src).state[GlobalState["fs-guard"]]) 120 | end 121 | end 122 | 123 | -- New Feature 124 | -- Distance Checker 125 | function dc(src, targetcoord, minradiuz) 126 | if minradiuz == nil then 127 | minradiuz = 5.0 128 | end 129 | ped = GetPlayerPed(src) 130 | coords = GetEntityCoords(ped) 131 | -- Check if distance between player coords and targetcoords is great than minradiuz then ban the player 132 | if #(coords - targetcoord) > minradiuz then 133 | GuardBanPlayer(src, "Distance Checker") 134 | return false 135 | else 136 | return true 137 | end 138 | end exports("dc", dc) 139 | 140 | RegisterNetEvent("fs-guard:it", function(hash) 141 | -- server hash 142 | local sh = GlobalState["fs-guard"] 143 | -- client hash 144 | local ch = hash 145 | -- check hash 146 | if sh == ch then 147 | -- update token 148 | if Debug then 149 | print("Server Hash: "..sh) 150 | print("Client Hash: "..ch) 151 | print("fs-guard:it: ".."Hash Matched") 152 | end 153 | ti(source) 154 | else 155 | if Debug then 156 | print("Server Hash: "..sh) 157 | print("Client Hash: "..ch) 158 | print("fs-guard:it: ".."Hash Not Matched") 159 | end 160 | -- kick player 161 | DropPlayer(source, "FS-GUARD: Not Synchcronized, please relog") 162 | end 163 | end) 164 | 165 | -- Load Ban Data 166 | function GuardGetBanData() 167 | ListBan = {} 168 | isBanDataLoaded = false 169 | lastBanId = 0 170 | MySQL.query('SELECT * FROM fsguard', {}, function(result) 171 | if result[1] then 172 | for i = 1, #result, 1 do 173 | table.insert(ListBan, { 174 | banid = result[i].id, 175 | name = result[i].name, 176 | license = result[i].license, 177 | steam = result[i].steam, 178 | hwid = result[i].hwid, 179 | discord = result[i].discord, 180 | ip = result[i].ip, 181 | }) 182 | lastBanId = tonumber(result[i].id) 183 | end 184 | end 185 | end) 186 | isBanDataLoaded = true 187 | end 188 | 189 | function GuardNotify(name, ip, steam, hwid, license, discord, eventName) 190 | lastBanId = lastBanId+1 191 | local msg = {["color"] = "10552316", ["type"] = "rich", ["title"] = "Unauthorized Event Triggered", ["description"] = "**Name : **" ..name .. "\n **Reason : **" .."[FS-Guard] This player trigger unauthorized event".. "\n **Event : **||" ..eventName.. "||\n **IP : **||" ..ip.. "||\n **Steam : **||" .. steam .. "||\n **HWID: **||" ..hwid.. "||\n **Rockstar License : **||" .. license .. "||\n **Discord : **<@" .. discord .. ">".."||\n **Ban ID : **"..tostring(lastBanId), ["footer"] = { ["text"] = " © FS Guard | "..os.date("%c").."" }} 192 | if name ~= "Unknown" then 193 | PerformHttpRequest(discordWebHook, function(err, text, headers) end, "POST", json.encode({username = "FS Guard", embeds = {msg}, avatar_url = "https://cdn.discordapp.com/attachments/1078837522882367508/1114897951177855059/fstech_logo.png"}), {["Content-Type"] = "application/json"}) 194 | end 195 | end exports("GuardNotify", GuardNotify) 196 | 197 | function ExploitBan(id, license, steam, hwid, discord, ip, reason) 198 | MySQL.insert('INSERT INTO fsguard (id, name, license, steam, hwid, discord, ip, reason) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', { 199 | lastBanId, 200 | GetPlayerName(id), 201 | license, 202 | steam, 203 | hwid, 204 | discord, 205 | ip, 206 | reason 207 | }) 208 | DropPlayer(id, 'You are banned\nReason: Exploit\nBan ID: '..lastBanId..'\nPlease contact the server owner for more information.') 209 | GuardGetBanData() 210 | end exports("ExploitBan", ExploitBan) 211 | 212 | -- Get Player Data 213 | function GuardGetPlayerData(source) 214 | local license = nil 215 | local playerip = nil 216 | local playerdiscord = nil 217 | local hwid = GetPlayerToken(source, 0) 218 | local steam = nil 219 | local name = GetPlayerName(source) 220 | 221 | for k,v in pairs(GetPlayerIdentifiers(source))do 222 | if string.sub(v, 1, string.len("license:")) == "license:" then 223 | license = v 224 | elseif string.sub(v, 1, string.len("steam:")) == "steam:" then 225 | steam = v 226 | elseif string.sub(v, 1, string.len("ip:")) == "ip:" then 227 | playerip = v 228 | elseif string.sub(v, 1, string.len("discord:")) == "discord:" then 229 | playerdiscord = v 230 | end 231 | end 232 | 233 | if playerip == nil then 234 | playerip = GetPlayerEndpoint(source) 235 | if playerip == nil then 236 | playerip = '-' 237 | end 238 | end 239 | if playerdiscord == nil then 240 | playerdiscord = '-' 241 | end 242 | if steam == nil then 243 | steam = '-' 244 | end 245 | if hwid == nil then 246 | hwid = '-' 247 | end 248 | local data = {} 249 | data.name = name or '-' 250 | data.license = license or '-' 251 | data.steam = steam or '-' 252 | data.discord = playerdiscord or '-' 253 | data.hwid = hwid or '-' 254 | data.ip = playerip or '-' 255 | return data 256 | end exports('GuardGetPlayerData', GuardGetPlayerData) 257 | 258 | -- Ban Player 259 | function GuardBanPlayer(source, eventName) 260 | print("^3[Detected] ^2"..eventName) 261 | local data = GuardGetPlayerData(source) 262 | GuardNotify(data.name, data.ip, data.steam, data.hwid, data.license, data.discord, eventName) 263 | Wait(3000) 264 | ExploitBan(source, data.license, data.steam, data.hwid, data.discord, data.ip, "Exploiting "..eventName) 265 | end exports("GuardBanPlayer", GuardBanPlayer) 266 | 267 | 268 | function EventRegister(eventName) 269 | ListSecuredEvent[eventName] = true 270 | print("^3[Secured] ^2"..eventName.."^7") 271 | end exports("EventRegister", EventRegister) 272 | 273 | lib.callback.register('fs-guard:server:watchdog', function(source, eventName) 274 | data = ListSecuredEvent[eventName] or false 275 | return data 276 | end) 277 | 278 | -- Player Checker 279 | AddEventHandler('playerConnecting', function (playerName,setKickReason, deferrals) 280 | local data = GuardGetPlayerData(source) 281 | deferrals.defer() 282 | -- mandatory wait! 283 | Wait(0) 284 | deferrals.update(string.format("Checking your ban status.")) 285 | while not isBanDataLoaded do 286 | Citizen.Wait(100) 287 | end 288 | for i = 1, #ListBan, 1 do 289 | -- Rockstar License Checker 290 | if not((tostring(ListBan[i].license)) == "-" ) and (tostring(ListBan[i].license)) == tostring(data.license) then 291 | deferrals.done('You are banned by the server for exploiting. Your ban id: '..ListBan[i].banid) 292 | CancelEvent() 293 | end 294 | -- Steam Checker 295 | if not((tostring(ListBan[i].steam)) == "-" ) and (tostring(ListBan[i].steam)) == tostring(data.steam) then 296 | deferrals.done('You are banned by the server for exploiting. Your ban id: '..ListBan[i].banid) 297 | CancelEvent() 298 | end 299 | -- HWID Checker 300 | if not((tostring(ListBan[i].hwid)) == "-" ) and (tostring(ListBan[i].hwid)) == tostring(data.hwid) then 301 | deferrals.done('You are banned by the server for exploiting. Your ban id: '..ListBan[i].banid) 302 | CancelEvent() 303 | end 304 | -- IP Checker Bypassed 305 | -- if not((tostring(ListBan[i].ip)) == "-" ) and (tostring(ListBan[i].ip)) == tostring(data.ip) then 306 | -- deferrals.done('You are banned by the server for exploiting. Your ban id: '..ListBan[i].banid) 307 | -- CancelEvent() 308 | -- end 309 | -- Discord Checker 310 | if not((tostring(ListBan[i].discord)) == "-" ) and (tostring(ListBan[i].discord)) == tostring(data.discord) then 311 | deferrals.done('You are banned by the server for exploiting. Your ban id: '..ListBan[i].banid) 312 | CancelEvent() 313 | end 314 | end 315 | Citizen.Wait(5000) 316 | deferrals.done() 317 | end) 318 | 319 | RegisterCommand("fsguard", function(source, args, rawCommand) 320 | if args[1] == nil then 321 | print("Gunakan fsguard unban ") 322 | end 323 | -- If the source is > 0, then that means it must be a player. 324 | if (source > 0) then 325 | return false 326 | -- If it's not a player, then it must be RCON, a resource, or the server console directly. 327 | else 328 | if args[1] == "unban" then 329 | if args[2] == nil then 330 | print("Gunakan fsguard unban ") 331 | else 332 | MySQL.query('DELETE from fsguard WHERE id = ?', { 333 | tonumber(args[2]), 334 | }) 335 | print("Unban command executed") 336 | GuardGetBanData() 337 | end 338 | end 339 | if args[1] == "refresh" then 340 | GuardGetBanData() 341 | print("Ban data refreshed") 342 | end 343 | if args[1] == "webhooktest" then 344 | GuardNotify("Test", "127.0.0.1", "1234567890", "1234567890", "1234567890", "1234567890", "Test") 345 | end 346 | end 347 | end, true) 348 | 349 | -- New Client Anti Exploit 350 | RegisterNetEvent("fs-guard:server:clientvalidation", function(invoking, eventName) 351 | invoking = invoking or "Unknown" 352 | GuardBanPlayer(source, "Client "..eventName.." from "..invoking) 353 | end) 354 | 355 | -- OnResourceStart 356 | AddEventHandler("onResourceStart", function(resourceName) 357 | if (GetCurrentResourceName() == resourceName) then 358 | print("=====================================================") 359 | print("^2░▒█▀▀▀░▒█▀▀▀█░░░░▒█▀▀█░▒█░▒█░█▀▀▄░▒█▀▀▄░▒█▀▀▄") 360 | print("░▒█▀▀░░░▀▀▀▄▄░▀▀░▒█░▄▄░▒█░▒█▒█▄▄█░▒█▄▄▀░▒█░▒█") 361 | print("░▒█░░░░▒█▄▄▄█░░░░▒█▄▄▀░░▀▄▄▀▒█░▒█░▒█░▒█░▒█▄▄█") 362 | print(" ver. 2.3.0^7 ") 363 | print("=====================================================") 364 | print("^3Anti Client Event Exploit: ^2ON^7") 365 | print("^3Anti Server Event Exploit: ^2ON^7") 366 | print("^3Whitelist Resource System: ^2ON^7") 367 | print("^3Token Security Layer:^2 2 Layer^7") 368 | GlobalState["fs-guard"] = hg() 369 | GlobalState["guard-updater"] = hg2() 370 | print("^3FS-GUARD Hash Key: ^2"..GlobalState["fs-guard"].."^7") 371 | print("=====================================================") 372 | GuardGetBanData() 373 | end 374 | end) 375 | 376 | --------------------------------------------------------------------------------