Initial commit
This commit is contained in:
827
addons/!kostich/lua/autorun/server/snte.lua
Normal file
827
addons/!kostich/lua/autorun/server/snte.lua
Normal file
@@ -0,0 +1,827 @@
|
||||
MsgC(Color(204, 0, 0), [[
|
||||
|
||||
╔══════════════════════════════════════════════════════════════════════════════╗
|
||||
║ Name : Say No To Exploits ║
|
||||
║ Idea : Meepen ║
|
||||
║ Credits : Maks - Zaros - YohSambre - Vitroze - Walter - Finnwinch ║
|
||||
║ GitHub : https://github.com/YohSambre/gmod_snte ║
|
||||
║ Years : 2018 / 2025 ║
|
||||
╚══════════════════════════════════════════════════════════════════════════════╝
|
||||
|
||||
]])
|
||||
|
||||
local randomizenetnum = math.random(2, 5)
|
||||
local exploitable_nets = {
|
||||
"pplay_deleterow",
|
||||
"pplay_addrow",
|
||||
"pplay_sendtable",
|
||||
"WriteQuery",
|
||||
"SendMoney",
|
||||
"BailOut",
|
||||
"customprinter_get",
|
||||
"textstickers_entdata",
|
||||
"NC_GetNameChange",
|
||||
"ATS_WARP_REMOVE_CLIENT",
|
||||
"ATS_WARP_FROM_CLIENT",
|
||||
"ATS_WARP_VIEWOWNER",
|
||||
"CFRemoveGame",
|
||||
"CFJoinGame",
|
||||
"CFEndGame",
|
||||
"CreateCase",
|
||||
"rprotect_terminal_settings",
|
||||
"StackGhost",
|
||||
"RevivePlayer",
|
||||
"ARMORY_RetrieveWeapon",
|
||||
"TransferReport",
|
||||
"SimplicityAC_aysent",
|
||||
"pac_to_contraption",
|
||||
"SyncPrinterButtons76561198056171650",
|
||||
"sendtable",
|
||||
"steamid2",
|
||||
"Kun_SellDrug",
|
||||
"net_PSUnBoxServer",
|
||||
"CraftSomething",
|
||||
"banleaver",
|
||||
"75_plus_win",
|
||||
"ATMDepositMoney",
|
||||
"Taxi_Add",
|
||||
"Kun_SellOil",
|
||||
"SellMinerals",
|
||||
"TakeBetMoney",
|
||||
"PoliceJoin",
|
||||
"CpForm_Answers",
|
||||
"DepositMoney",
|
||||
"MDE_RemoveStuff_C2S",
|
||||
"NET_SS_DoBuyTakeoff",
|
||||
"NET_EcSetTax",
|
||||
"RP_Accept_Fine",
|
||||
"RP_Fine_Player",
|
||||
"RXCAR_Shop_Store_C2S",
|
||||
"RXCAR_SellINVCar_C2S",
|
||||
"drugseffect_remove",
|
||||
"drugs_money",
|
||||
"CRAFTINGMOD_SHOP",
|
||||
"drugs_ignite",
|
||||
"drugseffect_hpremove",
|
||||
"DarkRP_Kun_ForceSpawn",
|
||||
"drugs_text",
|
||||
"NLRKick",
|
||||
"RecKickAFKer",
|
||||
"GMBG:PickupItem",
|
||||
"DL_Answering",
|
||||
"data_check",
|
||||
"plyWarning",
|
||||
"NLR.ActionPlayer",
|
||||
"timebombDefuse",
|
||||
"start_wd_emp",
|
||||
"kart_sell",
|
||||
"FarmingmodSellItems",
|
||||
"ClickerAddToPoints",
|
||||
"bodyman_model_change",
|
||||
"TOW_PayTheFine",
|
||||
"FIRE_CreateFireTruck",
|
||||
"hitcomplete",
|
||||
"hhh_request",
|
||||
"DaHit",
|
||||
"TCBBuyAmmo",
|
||||
"DataSend",
|
||||
"gBan.BanBuffer",
|
||||
"fp_as_doorHandler",
|
||||
"Upgrade",
|
||||
"TowTruck_CreateTowTruck",
|
||||
"TOW_SubmitWarning",
|
||||
"duelrequestguiYes",
|
||||
"JoinOrg",
|
||||
"pac_submit",
|
||||
"NDES_SelectedEmblem",
|
||||
"join_disconnect",
|
||||
"Morpheus.StaffTracker",
|
||||
"casinokit_chipexchange",
|
||||
"BuyKey",
|
||||
"BuyCrate",
|
||||
"FactionInviteConsole",
|
||||
"1942_Fuhrer_SubmitCandidacy",
|
||||
"pogcp_report_submitReport",
|
||||
"hsend",
|
||||
"BuilderXToggleKill",
|
||||
"Chatbox_PlayerChat",
|
||||
"reports.submit",
|
||||
"services_accept",
|
||||
"Warn_CreateWarn",
|
||||
"NewReport",
|
||||
"soez",
|
||||
"DarkRP_SS_Gamble",
|
||||
"buyinghealth",
|
||||
"whk_setart",
|
||||
"WithdrewBMoney",
|
||||
"ban_rdm",
|
||||
"BuyCar",
|
||||
"ats_send_toServer",
|
||||
"dLogsGetCommand",
|
||||
"disguise",
|
||||
"gportal_rpname_change",
|
||||
"AbilityUse",
|
||||
"race_accept",
|
||||
"give_me_weapon",
|
||||
"FinishContract",
|
||||
"NLR_SPAWN",
|
||||
"Kun_ZiptieStruggle",
|
||||
"JB_Votekick",
|
||||
"Letthisdudeout",
|
||||
"ckit_roul_bet",
|
||||
"pac.net.TouchFlexes.ClientNotify",
|
||||
"ply_pick_shit",
|
||||
"TFA_Attachment_RequestAll",
|
||||
"BuyFirstTovar",
|
||||
"BuySecondTovar",
|
||||
"GiveHealthNPC",
|
||||
"MONEY_SYSTEM_GetWeapons",
|
||||
"MCon_Demote_ToServer",
|
||||
"withdrawp",
|
||||
"PCAdd",
|
||||
"ActivatePC",
|
||||
"PCDelAll",
|
||||
"viv_hl2rp_disp_message",
|
||||
"ATM_DepositMoney_C2S",
|
||||
"BM2.Command.SellBitcoins",
|
||||
"BM2.Command.Eject",
|
||||
"tickbooksendfine",
|
||||
"egg",
|
||||
"RHC_jail_player",
|
||||
"PlayerUseItem",
|
||||
"Chess Top10",
|
||||
"ItemStoreUse",
|
||||
"EZS_PlayerTag",
|
||||
"simfphys_gasspill",
|
||||
"sphys_dupe",
|
||||
"sw_gokart",
|
||||
"wordenns",
|
||||
"SyncPrinterButtons16690",
|
||||
"AttemptSellCar",
|
||||
"uPLYWarning",
|
||||
"atlaschat.rqclrcfg",
|
||||
"dlib.getinfo.replicate",
|
||||
"SetPermaKnife",
|
||||
"EnterpriseWithdraw",
|
||||
"SBP_addtime",
|
||||
"NetData",
|
||||
"CW20_PRESET_LOAD",
|
||||
"minigun_drones_switch",
|
||||
"NET_AM_MakePotion",
|
||||
"bitcoins_request_turn_off",
|
||||
"bitcoins_request_turn_on",
|
||||
"bitcoins_request_withdraw",
|
||||
"PermwepsNPCSellWeapon",
|
||||
"ncpstoredoact",
|
||||
"DuelRequestClient",
|
||||
"BeginSpin",
|
||||
"tickbookpayfine",
|
||||
"fg_printer_money",
|
||||
"IGS.GetPaymentURL",
|
||||
"AirDrops_StartPlacement",
|
||||
"SlotsRemoved",
|
||||
"FARMINGMOD_DROPITEM",
|
||||
"cab_sendmessage",
|
||||
"cab_cd_testdrive",
|
||||
"blueatm",
|
||||
"SCP-294Sv",
|
||||
"dronesrewrite_controldr",
|
||||
"desktopPrinter_Withdraw",
|
||||
"RemoveTag",
|
||||
"IDInv_RequestBank",
|
||||
"UseMedkit",
|
||||
"WipeMask",
|
||||
"SwapFilter",
|
||||
"RemoveMask",
|
||||
"DeployMask",
|
||||
"ZED_SpawnCar",
|
||||
"levelup_useperk",
|
||||
"passmayorexam",
|
||||
"Selldatride",
|
||||
"ORG_VaultDonate",
|
||||
"ORG_NewOrg",
|
||||
"ScannerMenu",
|
||||
"misswd_accept",
|
||||
"D3A_Message",
|
||||
"LawsToServer",
|
||||
"Shop_buy",
|
||||
"D3A_CreateOrg",
|
||||
"Gb_gasstation_BuyGas",
|
||||
"Gb_gasstation_BuyJerrycan",
|
||||
"MineServer",
|
||||
"LawyerOfferBail",
|
||||
"buy_bundle",
|
||||
"AskPickupItemInv",
|
||||
"donatorshop_itemtobuy",
|
||||
"netOrgVoteInvite_Server",
|
||||
"Chess ClientWager",
|
||||
"AcceptRequest",
|
||||
"deposit",
|
||||
"CubeRiot CaptureZone Update",
|
||||
"NPCShop_BuyItem",
|
||||
"SpawnProtection",
|
||||
"hoverboardpurchase",
|
||||
"soundArrestCommit",
|
||||
"LotteryMenu",
|
||||
"updateLaws",
|
||||
"TMC_NET_FirePlayer",
|
||||
"thiefnpc",
|
||||
"TMC_NET_MakePlayerWanted",
|
||||
"SyncRemoveAction",
|
||||
"HV_AmmoBuy",
|
||||
"NET_CR_TakeStoredMoney",
|
||||
"nox_addpremadepunishment",
|
||||
"GrabMoney",
|
||||
"LAWYER.GetBailOut",
|
||||
"LAWYER.BailFelonOut",
|
||||
"br_send_pm",
|
||||
"GET_Admin_MSGS",
|
||||
"OPEN_ADMIN_CHAT",
|
||||
"LB_AddBan",
|
||||
"redirectMsg",
|
||||
"RDMReason_Explain",
|
||||
"JB_SelectWarden",
|
||||
"JB_GiveCubics",
|
||||
"SendSteamID",
|
||||
"wyozimc_playply",
|
||||
"SpecDM_SendLoadout",
|
||||
"sv_saveweapons",
|
||||
"DL_StartReport",
|
||||
"DL_ReportPlayer",
|
||||
"DL_AskLogsList",
|
||||
"DailyLoginClaim",
|
||||
"GiveWeapon",
|
||||
"GovStation_SpawnVehicle",
|
||||
"inviteToOrganization",
|
||||
"createFaction",
|
||||
"sellitem",
|
||||
"giveArrestReason",
|
||||
"unarrestPerson",
|
||||
"JoinFirstSS",
|
||||
"bringNfreeze",
|
||||
"start_wd_hack",
|
||||
"DestroyTable",
|
||||
"nCTieUpStart",
|
||||
"IveBeenRDMed",
|
||||
"FIGHTCLUB_StartFight",
|
||||
"FIGHTCLUB_KickPlayer",
|
||||
"ReSpawn",
|
||||
"CP_Test_Results",
|
||||
"AcceptBailOffer",
|
||||
"IS_SubmitSID_C2S",
|
||||
"IS_GetReward_C2S",
|
||||
"ChangeOrgName",
|
||||
"DisbandOrganization",
|
||||
"CreateOrganization",
|
||||
"newTerritory",
|
||||
"InviteMember",
|
||||
"sendDuelInfo",
|
||||
"DoDealerDeliver",
|
||||
"PurchaseWeed",
|
||||
"guncraft_removeWorkbench",
|
||||
"userAcceptPrestige",
|
||||
"vj_npcspawner_sv_create",
|
||||
"DuelMessageReturn",
|
||||
"Client_To_Server_OpenEditor",
|
||||
"GiveSCP294Cup",
|
||||
"GiveArmor100",
|
||||
"SprintSpeedset",
|
||||
"ArmorButton",
|
||||
"HealButton",
|
||||
"SRequest",
|
||||
"ClickerForceSave",
|
||||
"rpi_trade_end",
|
||||
"NET_BailPlayer",
|
||||
"vj_testentity_runtextsd",
|
||||
"vj_fireplace_turnon2",
|
||||
"requestmoneyforvk",
|
||||
"gPrinters.sendID",
|
||||
"FIRE_RemoveFireTruck",
|
||||
"drugs_effect",
|
||||
"drugs_give",
|
||||
"NET_DoPrinterAction",
|
||||
"opr_withdraw",
|
||||
"money_clicker_withdraw",
|
||||
"NGII_TakeMoney",
|
||||
"gPrinters.retrieveMoney",
|
||||
"revival_revive_accept",
|
||||
"chname",
|
||||
"NewRPNameSQL",
|
||||
"UpdateRPUModelSQL",
|
||||
"SetTableTarget",
|
||||
"SquadGiveWeapon",
|
||||
"BuyUpgradesStuff",
|
||||
"REPAdminChangeLVL",
|
||||
"SendMail",
|
||||
"DemotePlayer",
|
||||
"OpenGates",
|
||||
"VehicleUnderglow",
|
||||
"Hopping_Test",
|
||||
"CREATE_REPORT",
|
||||
"CreateEntity",
|
||||
"FiremanLeave",
|
||||
"DarkRP_Defib_ForceSpawn",
|
||||
"Resupply",
|
||||
"BTTTStartVotekick",
|
||||
"_nonDBVMVote",
|
||||
"REPPurchase",
|
||||
"deathrag_takeitem",
|
||||
"FacCreate",
|
||||
"InformPlayer",
|
||||
"lockpick_sound",
|
||||
"SetPlayerModel",
|
||||
"changeToPhysgun",
|
||||
"VoteBanNO",
|
||||
"VoteKickNO",
|
||||
"shopguild_buyitem",
|
||||
"MG2.Request.GangRankings",
|
||||
"RequestMAPSize",
|
||||
"gMining.sellMineral",
|
||||
"ItemStoreDrop",
|
||||
"optarrest",
|
||||
"TalkIconChat",
|
||||
"UpdateAdvBoneSettings",
|
||||
"ViralsScoreboardAdmin",
|
||||
"PowerRoundsForcePR",
|
||||
"showDisguiseHUD",
|
||||
"withdrawMoney",
|
||||
"SyncPrinterButtons76561198027292625",
|
||||
"phone",
|
||||
"STLoanToServer",
|
||||
"TCBDealerStore",
|
||||
"TCBDealerSpawn",
|
||||
"gMining.registerAchievement",
|
||||
"gPrinters.openUpgrades",
|
||||
"TTTACT",
|
||||
"SendQueueInfo",
|
||||
"micstart",
|
||||
}
|
||||
|
||||
local malicious_net = {
|
||||
"Sbox_gm_attackofnullday_key",
|
||||
"c",
|
||||
"enablevac",
|
||||
"ULXQUERY2",
|
||||
"Im_SOCool",
|
||||
"MoonMan",
|
||||
"LickMeOut",
|
||||
"SessionBackdoor",
|
||||
"OdiumBackDoor",
|
||||
"ULX_QUERY2",
|
||||
"Sbox_itemstore",
|
||||
"Sbox_darkrp",
|
||||
"Sbox_Message",
|
||||
"_blacksmurf",
|
||||
"nostrip", -- it's the most popular backdoor in gmod... amazing isn't it ?
|
||||
"Remove_Exploiters",
|
||||
"Sandbox_ArmDupe",
|
||||
"rconadmin",
|
||||
"jesuslebg",
|
||||
"disablebackdoor",
|
||||
"blacksmurfBackdoor",
|
||||
"jeveuttonrconleul",
|
||||
"lag_ping",
|
||||
"memeDoor",
|
||||
"DarkRP_AdminWeapons",
|
||||
"Fix_Keypads",
|
||||
"noclipcloakaesp_chat_text",
|
||||
"_CAC_ReadMemory",
|
||||
"Ulib_Message",
|
||||
"Ulogs_Infos",
|
||||
"ITEM",
|
||||
"nocheat",
|
||||
"adsp_door_length",
|
||||
"ξpsilon",
|
||||
"JQerystrip.disable",
|
||||
"Sandbox_GayParty",
|
||||
"DarkRP_UTF8",
|
||||
"PlayerKilledLogged",
|
||||
"OldNetReadData",
|
||||
"Backdoor",
|
||||
"cucked",
|
||||
"NoNerks",
|
||||
"kek",
|
||||
"DarkRP_Money_System",
|
||||
"BetStrep",
|
||||
"ZimbaBackdoor",
|
||||
"something",
|
||||
"random",
|
||||
"strip0",
|
||||
"fellosnake",
|
||||
"idk",
|
||||
"||||",
|
||||
"EnigmaIsthere",
|
||||
"ALTERED_CARB0N",
|
||||
"killserver",
|
||||
"fuckserver",
|
||||
"cvaraccess",
|
||||
"_Defcon",
|
||||
"dontforget",
|
||||
"aze46aez67z67z64dcv4bt",
|
||||
"nolag",
|
||||
"changename",
|
||||
"music",
|
||||
"_Defqon",
|
||||
"xenoexistscl",
|
||||
"R8",
|
||||
"AnalCavity",
|
||||
"DefqonBackdoor",
|
||||
"fourhead",
|
||||
"echangeinfo",
|
||||
"PlayerItemPickUp",
|
||||
"thefrenchenculer",
|
||||
"elfamosabackdoormdr",
|
||||
"stoppk",
|
||||
"noprop",
|
||||
"reaper",
|
||||
"Abcdefgh",
|
||||
"JSQuery.Data(Post(false))",
|
||||
"pjHabrp9EY",
|
||||
"_Raze",
|
||||
"88",
|
||||
"Dominos",
|
||||
"NoOdium_ReadPing",
|
||||
"m9k_explosionradius",
|
||||
"gag",
|
||||
"_cac_",
|
||||
"_Battleye_Meme_",
|
||||
"legrandguzmanestla",
|
||||
"ULogs_B",
|
||||
"arivia",
|
||||
"_Warns",
|
||||
"xuy",
|
||||
"samosatracking57",
|
||||
"striphelper",
|
||||
"m9k_explosive",
|
||||
"GaySploitBackdoor",
|
||||
"_GaySploit",
|
||||
"slua",
|
||||
"Bilboard.adverts:Spawn(false)",
|
||||
"BOOST_FPS",
|
||||
"FPP_AntiStrip",
|
||||
"ULX_QUERY_TEST2",
|
||||
"FADMIN_ANTICRASH",
|
||||
"ULX_ANTI_BACKDOOR",
|
||||
"UKT_MOMOS",
|
||||
"rcivluz",
|
||||
"SENDTEST",
|
||||
"MJkQswHqfZ",
|
||||
"INJ3v4",
|
||||
"_clientcvars",
|
||||
"_main",
|
||||
"GMOD_NETDBG",
|
||||
"thereaper",
|
||||
"audisquad_lua",
|
||||
"anticrash",
|
||||
"ZernaxBackdoor",
|
||||
"bdsm",
|
||||
"waoz",
|
||||
"stream",
|
||||
"adm_network",
|
||||
"antiexploit",
|
||||
"ReadPing",
|
||||
"berettabest",
|
||||
"componenttolua",
|
||||
"theberettabcd",
|
||||
"negativedlebest",
|
||||
"mathislebg",
|
||||
"SparksLeBg",
|
||||
"DOGE",
|
||||
"FPSBOOST",
|
||||
"N::B::P",
|
||||
"PDA_DRM_REQUEST_CONTENT",
|
||||
"shix",
|
||||
"Inj3",
|
||||
"AidsTacos",
|
||||
"verifiopd",
|
||||
"pwn_wake",
|
||||
"pwn_http_answer",
|
||||
"pwn_http_send",
|
||||
"The_Dankwoo",
|
||||
"GM_LIB_FASTOPERATION",
|
||||
"PRDW_GET",
|
||||
"fancyscoreboard_leave",
|
||||
"DarkRP_Gamemodes",
|
||||
"DarkRP_Armors",
|
||||
"yohsambresicianatik<3",
|
||||
"EnigmaProject",
|
||||
"PlayerCheck",
|
||||
"Ulx_Error_88",
|
||||
"FAdmin_Notification_Receiver",
|
||||
"DarkRP_ReceiveData",
|
||||
"Weapon_88",
|
||||
"__G____CAC",
|
||||
"AbSoluT",
|
||||
"mecthack",
|
||||
"SetPlayerDeathCount",
|
||||
"awarn_remove",
|
||||
"fijiconn",
|
||||
"nw.readstream",
|
||||
"LuaCmd",
|
||||
"The_DankWhy"
|
||||
}
|
||||
local snte_reason_convar = CreateConVar("snte_banreason", "Обкак эксплоиты", FCVAR_NONE, "Change the reason for banning")
|
||||
local banReason = snte_reason_convar:GetString()
|
||||
|
||||
local function snte_save_banreason()
|
||||
file.Write("snte_ban_reason.txt", snte_reason_convar:GetString())
|
||||
end
|
||||
|
||||
if file.Exists("snte_ban_reason.txt", "DATA") then
|
||||
local savedReason = file.Read("snte_ban_reason.txt", "DATA")
|
||||
RunConsoleCommand("snte_banreason", savedReason)
|
||||
end
|
||||
|
||||
cvars.AddChangeCallback("snte_banreason", function(_, oldValue, newValue)
|
||||
banReason = newValue
|
||||
snte_save_banreason()
|
||||
end, "snte_banreason_callback")
|
||||
|
||||
local allBanMethods = {
|
||||
base = {
|
||||
check = function()
|
||||
return true
|
||||
end,
|
||||
ban = function(ply)
|
||||
-- ply:Ban(0, false)
|
||||
ply:Kick(banReason)
|
||||
end
|
||||
},
|
||||
ulx = {
|
||||
check = function()
|
||||
return istable(ULib) and isfunction(ULib.ban)
|
||||
end,
|
||||
ban = function(ply)
|
||||
ULib.ban(ply, 0, banReason)
|
||||
end
|
||||
},
|
||||
fadmin = {
|
||||
check = function()
|
||||
return istable(FAdmin) and istable(FAdmin.Commands) and istable(FAdmin.Commands.List) and isfunction(FAdmin.Commands.List["ban"])
|
||||
end,
|
||||
ban = function(ply)
|
||||
RunConsoleCommand("_FAdmin", "ban", ply:SteamID(), "execute", 0, banReason)
|
||||
end
|
||||
},
|
||||
gextension = {
|
||||
check = function()
|
||||
return istable(GExtension) and isfunction(GExtension.Ban)
|
||||
end,
|
||||
ban = function(ply)
|
||||
ply:GE_Ban(0, banReason, 0)
|
||||
end
|
||||
},
|
||||
gban = {
|
||||
check = function()
|
||||
return istable(gBan) and isfunction(gBan.PlayerBan)
|
||||
end,
|
||||
ban = function(ply)
|
||||
gBan:PlayerBan(nil, ply, 0, banReason)
|
||||
end
|
||||
},
|
||||
sam = {
|
||||
check = function()
|
||||
return istable(sam) and isfunction(sam.player.ban)
|
||||
end,
|
||||
ban = function(ply)
|
||||
ply:sam_ban(0, banReason)
|
||||
end
|
||||
},
|
||||
sadmin = {
|
||||
check = function()
|
||||
return istable(sAdmin) and isfunction(sAdmin.banPly)
|
||||
end,
|
||||
ban = function(ply)
|
||||
sAdmin.banPly(ply, 0, banReason, nil)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
local helpMsg = "All supported ban methods:\n"
|
||||
for name in pairs(allBanMethods) do
|
||||
helpMsg = "- " .. name .. "\n"
|
||||
end
|
||||
CreateConVar("snte_bansystem", "base", FCVAR_ARCHIVE, helpMsg)
|
||||
|
||||
cvars.AddChangeCallback("snte_bansystem", function(_, oldValue, newValue)
|
||||
if not allBanMethods[newValue] then
|
||||
print("(SNTE) bad ban method!\n" .. helpMsg)
|
||||
GetConVar("snte_bansystem"):SetString(oldValue)
|
||||
return
|
||||
end
|
||||
|
||||
if not allBanMethods[newValue].check() then
|
||||
print("(SNTE) addon " .. newValue .. " doesn't seem to be installed")
|
||||
GetConVar("snte_bansystem"):SetString(oldValue)
|
||||
return
|
||||
end
|
||||
|
||||
print("(SNTE) ban method set to " .. newValue .. " !")
|
||||
end)
|
||||
|
||||
local snte_logfile = "snte_detections.txt"
|
||||
|
||||
local function snte_getDateTime()
|
||||
return os.date("%Y-%m-%d %H:%M:%S")
|
||||
end
|
||||
|
||||
local function snte_logDetection(ply, netCalled, sourceFile)
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
local ip = "Unknown"
|
||||
if ply:IPAddress() then
|
||||
ip = string.Explode(":", ply:IPAddress())[1]
|
||||
end
|
||||
|
||||
local logLine = string.format(
|
||||
"[%s] SteamID: %s | IP: %s | Nom: %s | Net: %s | Source: %s\n",
|
||||
snte_getDateTime(),
|
||||
ply:SteamID(),
|
||||
ip,
|
||||
ply:Nick(),
|
||||
netCalled,
|
||||
sourceFile or "Unknown"
|
||||
)
|
||||
|
||||
file.Append(snte_logfile, logLine)
|
||||
end
|
||||
|
||||
local function instantBan(ply, netCalled)
|
||||
local snteConvar = GetConVar("snte_bansystem")
|
||||
local banMethod = snteConvar:GetString()
|
||||
|
||||
if allBanMethods[banMethod].check() then
|
||||
allBanMethods[banMethod].ban(ply)
|
||||
else
|
||||
print("(SNTE) addon " .. banMethod .. " doesn't seem to work / be installed. Fallback to 'base'")
|
||||
snteConvar:SetString("base")
|
||||
|
||||
allBanMethods["base"].ban(ply)
|
||||
end
|
||||
|
||||
ServerLog("(SNTE) " .. ply:Name() .. " (" .. ply:SteamID() .. ") has been detected using " .. netCalled .. " and was banned\n")
|
||||
|
||||
local sourceFile = "Unknown"
|
||||
if isfunction(net.Receivers[netCalled]) then
|
||||
local backdoorInfos = debug.getinfo(net.Receivers[netCalled], "S")
|
||||
if backdoorInfos and backdoorInfos.short_src then
|
||||
sourceFile = backdoorInfos.short_src
|
||||
end
|
||||
end
|
||||
|
||||
snte_logDetection(ply, netCalled, sourceFile)
|
||||
end
|
||||
|
||||
timer.Simple(1, function()
|
||||
for i = #exploitable_nets, 1, -1 do
|
||||
if util.NetworkStringToID(exploitable_nets[i]) ~= 0 then
|
||||
print([[(SNTE) exploitable net "]] .. table.remove(exploitable_nets, i) .. [[" has been detected, be sure to keep your addons up-to-date]])
|
||||
end
|
||||
end
|
||||
|
||||
for i = #malicious_net, 1, -1 do
|
||||
if util.NetworkStringToID(malicious_net[i]) ~= 0 then
|
||||
local backdoorNet = table.remove(malicious_net, i)
|
||||
print([[(SNTE) WARNING: Backdoor net "]] .. backdoorNet .. [[" has been detected ! Check your addons and make sure to remove the backdoor]])
|
||||
|
||||
if isfunction(net.Receivers[backdoorNet]) then
|
||||
local backdoorInfos = debug.getinfo(net.Receivers[backdoorNet], "S")
|
||||
print([[(SNTE) NOTE: "]] .. backdoorNet .. [[" was declared in ]] .. backdoorInfos.short_src .. [[ line ]] .. backdoorInfos.linedefined)
|
||||
end
|
||||
|
||||
net.Receive(backdoorNet, function(_, ply)
|
||||
instantBan(ply, backdoorNet)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local global_nets = exploitable_nets
|
||||
local numNets = #global_nets
|
||||
table.Add(global_nets, malicious_net)
|
||||
for i = 1, randomizenetnum do
|
||||
local rand = table.remove(global_nets, math.random(1, numNets - i))
|
||||
if not rand then
|
||||
break
|
||||
end
|
||||
|
||||
util.AddNetworkString(rand)
|
||||
net.Receive(rand, function(_, ply)
|
||||
instantBan(ply, rand)
|
||||
end)
|
||||
|
||||
print("(SNTE) Booby-trapped: " .. rand)
|
||||
end
|
||||
end)
|
||||
|
||||
if file.Exists("ulx/modules/sh/rcon.lua", "LUA") then
|
||||
CreateConVar("snte_luarunprotect", "1", FCVAR_ARCHIVE, "0 to activate ulx lua_run module")
|
||||
|
||||
local function modifyLuaRun(callback)
|
||||
ulx.luaRun = callback
|
||||
|
||||
local luarun = ulx.command("Rcon", "ulx luarun", ulx.luaRun, nil, false, false, true)
|
||||
luarun:addParam{ type=ULib.cmds.StringArg, hint="command", ULib.cmds.takeRestOfLine }
|
||||
luarun:defaultAccess( ULib.ACCESS_SUPERADMIN )
|
||||
luarun:help("Executes lua in server console. (Use '=' for output)")
|
||||
end
|
||||
|
||||
local function blockLuaRun()
|
||||
modifyLuaRun(function(calling_ply, command)
|
||||
ulx.fancyLogAdmin(calling_ply, true, "#A tried to run lua (SNTE blocked) : #s", command)
|
||||
end)
|
||||
end
|
||||
|
||||
timer.Simple(1, function()
|
||||
if not istable(ulx) or not isfunction(ulx.luaRun) then
|
||||
return
|
||||
end
|
||||
|
||||
local oldLuaRun = ulx.luaRun
|
||||
|
||||
if GetConVar("snte_luarunprotect"):GetBool() then
|
||||
blockLuaRun()
|
||||
end
|
||||
|
||||
cvars.AddChangeCallback("snte_luarunprotect", function(_, __, newValue)
|
||||
if tobool(newValue) then
|
||||
blockLuaRun()
|
||||
else
|
||||
modifyLuaRun(oldLuaRun)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- rofl (╯°□°)╯︵ ┻━┻
|
||||
local function SNTESCFSR()
|
||||
if concommand.GetTable()["sounds_request"] then
|
||||
concommand.Add("sounds_request", function() end) -- the shame (ಠ_ಠ')
|
||||
end
|
||||
end
|
||||
hook.Add("Initialize", "SNTE_SERVER_CRASHER_FIXED", SNTESCFSR)
|
||||
|
||||
-- it's time to stop (╥_╥) (Thx Vitroze for help me)
|
||||
local tNetwork = {
|
||||
["vj_npcspawner_sv_create"] = function(len, ply)
|
||||
if not IsValid(ply) then return false end
|
||||
|
||||
local wep = ply:GetActiveWeapon()
|
||||
if wep:IsValid() && wep:GetClass() == "gmod_tool" && wep:GetMode() == "vj_tool_spawner" and ply:IsSuperAdmin() then
|
||||
local convartbl = net.ReadTable()
|
||||
local svpos = net.ReadVector()
|
||||
local svgetlines = net.ReadType()
|
||||
local svgettype = net.ReadString()
|
||||
local spawner = ents.Create("obj_vj_spawner_base")
|
||||
spawner.EntitiesToSpawn = {}
|
||||
spawner:SetPos(svpos)
|
||||
local angs = Angle(0,0,0)
|
||||
if IsValid(ply) then
|
||||
angs = ply:GetAngles()
|
||||
angs.pitch = 0
|
||||
angs.roll = 0
|
||||
angs.yaw = angs.yaw + 180
|
||||
end
|
||||
spawner:SetAngles(angs)
|
||||
for _,v in pairs(svgetlines) do
|
||||
table.insert(spawner.EntitiesToSpawn,{SpawnPosition=v.SpawnPosition, Entities={v.Entities}, WeaponsList={v.WeaponsList}, NPC_Class = v.Relationship.Class, FriToPlyAllies = tobool(v.Relationship.FriToPlyAllies)})
|
||||
end
|
||||
if convartbl.vj_tool_spawner_playsound == 1 then
|
||||
spawner.SoundTbl_SpawnEntity = spawnSounds
|
||||
end
|
||||
|
||||
spawner.TimedSpawn_Time = convartbl.vj_tool_spawner_nextspawntime
|
||||
|
||||
if svgettype == "RightClick" then spawner.SingleSpawner = true end
|
||||
|
||||
spawner:SetCreator(ply)
|
||||
spawner:Spawn()
|
||||
spawner:Activate()
|
||||
undo.Create("NPC Spawner")
|
||||
undo.AddEntity(spawner)
|
||||
undo.SetPlayer(ply)
|
||||
undo.Finish()
|
||||
|
||||
for vpk,vpv in pairs(spawner.CurrentEntities) do
|
||||
if IsValid(vpv.TheEntity) && vpv.TheEntity.IsVJBaseSpawner == true && vpv.TheEntity.SingleSpawner == true then
|
||||
vpv.TheEntity:SetCreator(ply)
|
||||
table.remove(spawner.CurrentEntities, vpk)
|
||||
if table.IsEmpty(spawner.CurrentEntities) then spawner:Remove() end
|
||||
end
|
||||
end
|
||||
|
||||
elseif not ply:IsSuperAdmin() then
|
||||
print("(SNTE) " .. ply:Nick() .. " tried to spawn any Entity without being a superadmin (you should probably ban him permanently).")
|
||||
ply:Kick(banReason)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
tNetwork["vj_tool_spawner_sv_create"] = tNetwork["vj_npcspawner_sv_create"]
|
||||
|
||||
hook.Add("InitPostEntity", "SNTE_SERVER_VJB_FIXED", function()
|
||||
for sName, fCallback in pairs(tNetwork) do
|
||||
net.Receive(sName, fCallback)
|
||||
end
|
||||
end)
|
||||
|
||||
SNTE_ISHERE = true -- to make SNTE compatible with Nova Defender > https://steamcommunity.com/sharedfiles/filedetails/?id=3069680995 | I warmly recommend this anticheat (~‾▿‾)~
|
||||
Reference in New Issue
Block a user