PDA

View Full Version : Anti-Cheat Solution for COD2 1.0?



CaptainSlow
11th September 2015, 00:57
As we all know, no Punkbuster is implemented in COD2 1.0. However COD2 1.0 is still an active community.
How do you guys deal with cheaters on COD2 1.0? Is there some sort of punkbuster mod alternative server admins can use to automatically detect/ban cheaters?
Currently we import all cheaters listed on PBBans and manually ban them in our firewall. It's not much but it's the best I could come up with for now. And ofcourse, we run a pure server to prevent .iwd modding but that hasn't stopped any cheater so far I think ;)

maxdamage99
11th September 2015, 14:52
Method NL-TEAM:
Make screenshot violator, "/screenshotJpeg", make huds with today's date, and then the offender will have to upload your screenshot manually administrators. According to Yuri this way you can detect most of the offenders.
sry bad english

Ni3ls
11th September 2015, 15:31
Method NL-TEAM:
Make screenshot violator, "/screenshotJpeg", make huds with today's date, and then the offender will have to upload your screenshot manually administrators. According to Yuri this way you can detect most of the offenders.
sry bad english

But then the "hacker" must upload them to the admin themself? Thats not a good method I think.

You can make a headshot counter. If a player makes only headshots, its most of the time a hack. You can also count the name changes or duplicated names. Mombot has renamer so u can caught them with this method.

CaptainSlow
11th September 2015, 23:37
Thanks for the replies guys, appreciate it.

Hmm yes something that reads the logfile, counts the amount of namechanges per IP and/or headshots per player and bans it when it exceeds a threshold sounds like a good idea.
I'll see if I can hack something together in a PowerShell script.

Thanks for the idea guys.

BTW Does anyone know how to enforce this on COD2 1.0? Seems like it's not possible right, due to using Punkbuster? http://killtube.org/showthread.php?1234-Anti-cheat&p=11833&viewfull=1#post11833

filthy_freak_
12th September 2015, 06:16
Here is a script I made for detecting name changers;



antiCheat()
{
self endon("disconnect");

if(isDefined(self.isBot))
return;

oldName = self.name;
count = 0;
reset = 0;

while(true)
{
if(oldName != self.name)
{
oldName = self.name;

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] == self)
continue;

if(oldName == players[i].name + " ^1" || oldName == players[i].name + " ^1 ^2 ^9")
{
count++;
break;
}
}
}

if(count >= 5)
{
//Cheater detected, do ban here.
kick(self getEntityNumber());
}
else if(count != 0)
{
if(reset == 60)
{
count = 0;
reset = 0;
}
else
reset++;
}
wait 1;
}
}


If you use libcod, you can detect and check what the player sends via chat. Then compare it against this list and ban;


bannedText()
{
text = [];

text[text.size] = "^1>^0> ^0You got a free travel to ^1hell ^7";
text[text.size] = "^1>^0> ^1You're finished ^7";
text[text.size] = "^1>^0> ^1Enjoy my bullets ^7";
text[text.size] = "^1>^0> ^1Even ^0a ^1blind person ^0could ^1kill ^7";
text[text.size] = "^1>^0> ^1Noob ! ^7";
text[text.size] = "^1>^0> ^1You suck ^7";
text[text.size] = "^1>^0> ^1You're ^0a ^1Bitch ^7";
text[text.size] = "^1>^0> ^1Suck ^0it up ^7";
text[text.size] = "^1>^0> ^0You're just a ^1piece of crap ^7";
text[text.size] = "^1>^0> ^1Haha ^7";
text[text.size] = "^1>^0> ^1Have fun ^7";
text[text.size] = "^1>^0> ^1Lick ^0my ^1ass ^7";
text[text.size] = "^1>^0> ^1You fight ^0like a 3 years old ^1Baby ^7";
text[text.size] = "^1>^0> ^1Game Over ^7";
text[text.size] = "^1>^0> ^1Shut ^0up and Stay ^1Down ^7";
text[text.size] = "^1>^0> ^1Yeaaaaaa ^7";
text[text.size] = "^1>^0> ^1Aye Caramba ^7";
text[text.size] = "^1>^0> ^0I told you to ^1get cover ^7";
text[text.size] = "^1>^0> ^1You're ^0my ^1bitch slave ^7";
text[text.size] = "^1>^0> ^0You got a free travel to ^1hell ^7";
text[text.size] = "^1>^0> ^1Go ^0play ^1barbies ^7";
text[text.size] = "^1>^0> ^1I Killed ^7";
text[text.size] = "^1>^0> ^1Die ^7";
text[text.size] = "^1>^0> ^1Get out ^0of there ^7";
text[text.size] = "^1>^0> ^1Get out ^0of my ^1way ^7";
text[text.size] = "^1>^0> ^1Bitch, ^0suck my ^112 inch ^7";
text[text.size] = "^1>^0> ^1Yeaaaaaa ^7";
text[text.size] = "^7Took a ^3HEADSHOT ^7by ^3JDK^1bot [^5PUBLIC^1]";
text[text.size] = "^0got Helix'd by Helix CoD2 Private !";
text[text.size] = "^1LIKE TEH WAY I IS PWNZ?=";
text[text.size] = "^3Using ^3Public ^3LudixBot!!^4(^2h4x bY";
text[text.size] = "^7- ^1you took headshoot ^0[^1PUBLIC HOOK BY PIXEE^0]";
text[text.size] = "^7- ^1you took headshoot ^0[^1LUXHOOK by luxbot.tk!<-";
text[text.size] = "^9J^2ust ^9G^2ot ^9O^2wned!^0]- ^0-[^9T^2otal ^2K^9ills";
text[text.size] = "^7was killed by a ^5Headshot ^7with ^4JdkBOT";

return text;
}


Something like


chattext = args[0];
bannedtext = bannedText();

for(i = 0; i < bannnedtext.size; i++)
{
if(isSubStr(chattext, level.bannedText[i]))
{
//Cheater detected, do ban here.
kick(self getEntityNumber());
}
}

CaptainSlow
12th September 2015, 11:04
Here is a script I made for detecting name changers;

Thank you very much for the script! I'm not using libcod as I'm running Windows, but I can still use the first script, right?
If so, how do I install it? Which file do I need to alter/create? Sorry for asking, first time I install a script.

Thanks!

filthy_freak_
12th September 2015, 15:39
Thank you very much for the script! I'm not using libcod as I'm running Windows, but I can still use the first script, right?
If so, how do I install it? Which file do I need to alter/create? Sorry for asking, first time I install a script.

Thanks!

Put the antiCheat() method in your gametype.gsc file and call self thread antiCheat(); on connect.

CaptainSlow
12th September 2015, 16:57
Put the antiCheat() method in your gametype.gsc file and call self thread antiCheat(); on connect.

Thanks for your reply. I'm really sorry but I do not have a file named gametype.gsc in my COD2 folder. Do I need to create it myself like in this picture?
http://killtube.org/showthread.php?1935-gametype-invalid&p=9897&viewfull=1#post9897

Many thanks!

serthy
12th September 2015, 17:09
Thanks for your reply. I'm really sorry but I do not have a file named gametype.gsc in my COD2 folder. Do I need to create it myself like in this picture?
http://killtube.org/showthread.php?1935-gametype-invalid&p=9897&viewfull=1#post9897

Many thanks!

There is no 'gametype.gsc', what he meant is '<name-of-the-gametype-here>.gsc'.
Gametypes are (theyre listed also in the serverbrowser)
tdm, dm, sd, ctf, hq and custom ones like zom, zombot, koth etc.

These files are in the iw_**.iwd containers (which are simple zip containers that you can open with winzip or 7zip).
Iirc in the iw_7.iwd there is the maps/mp/gametypes folder where all the gametypes are listed.
If you run a mod, then its likely that there is a zzz_svr_your-mod-name.iwd, (or the mod is not in an container), however the directorystructure is the same.
If you do not have a mod installed, tell us (so you have to create one on your own, which is simply some copy n paste of the iw_7.iwd and renaming it, as you should not modify the original game-files)

In the gametypes.gsc there is usually on the top some setup going on in the main() function.
This function calls Callback_StartGameType() and this may call an onPlayerConnect() etc. function, this is the place where you have to add the onCheat() function.

CaptainSlow
14th September 2015, 11:15
There is no 'gametype.gsc', what he meant is '<name-of-the-gametype-here>.gsc'.
Gametypes are (theyre listed also in the serverbrowser)
tdm, dm, sd, ctf, hq and custom ones like zom, zombot, koth etc.

These files are in the iw_**.iwd containers (which are simple zip containers that you can open with winzip or 7zip).
Iirc in the iw_7.iwd there is the maps/mp/gametypes folder where all the gametypes are listed.
If you run a mod, then its likely that there is a zzz_svr_your-mod-name.iwd, (or the mod is not in an container), however the directorystructure is the same.
If you do not have a mod installed, tell us (so you have to create one on your own, which is simply some copy n paste of the iw_7.iwd and renaming it, as you should not modify the original game-files)

In the gametypes.gsc there is usually on the top some setup going on in the main() function.
This function calls Callback_StartGameType() and this may call an onPlayerConnect() etc. function, this is the place where you have to add the onCheat() function.

Thank you very much for your detailed answer, I appreciate it!

I'm indeed not running any mods. So I copied the IW_7.iwd file, extracted it using 7zip, went to the maps/mp/gametypes folder and opened (for instance) tdm.gsc with Notepad++.
I can see the Main() function and the Callback_StartGameType() and onPlayerConnect() function, but now my question is: Where exactly do I paste the onCheat() code? In the main()?



main()
{
level.callbackStartGameType = ::Callback_StartGameType;
level.callbackPlayerConnect = ::Callback_PlayerConnect;
level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
level.callbackPlayerDamage = ::Callback_PlayerDamage;
level.callbackPlayerKilled = ::Callback_PlayerKilled;
maps\mp\gametypes\_callbacksetup::SetupCallbacks() ;

level.autoassign = ::menuAutoAssign;
level.allies = ::menuAllies;
level.axis = ::menuAxis;
level.spectator = ::menuSpectator;
level.weapon = ::menuWeapon;
level.endgameconfirmed = ::endMap;
}

Callback_StartGameType()
{
level.splitscreen = isSplitScreen();

// defaults if not defined in level script
if(!isDefined(game["allies"]))
game["allies"] = "american";
if(!isDefined(game["axis"]))
game["axis"] = "german";

// server cvar overrides
if(getCvar("scr_allies") != "")
game["allies"] = getCvar("scr_allies");
if(getCvar("scr_axis") != "")
game["axis"] = getCvar("scr_axis");

precacheStatusIcon("hud_status_dead");
precacheStatusIcon("hud_status_connecting");
precacheRumble("damage_heavy");
precacheString(&"PLATFORM_PRESS_TO_SPAWN");

thread maps\mp\gametypes\_menus::init();
thread maps\mp\gametypes\_serversettings::init();
thread maps\mp\gametypes\_clientids::init();
thread maps\mp\gametypes\_teams::init();
thread maps\mp\gametypes\_weapons::init();
thread maps\mp\gametypes\_scoreboard::init();
thread maps\mp\gametypes\_killcam::init();
thread maps\mp\gametypes\_shellshock::init();
thread maps\mp\gametypes\_hud_teamscore::init();
thread maps\mp\gametypes\_deathicons::init();
thread maps\mp\gametypes\_damagefeedback::init();
thread maps\mp\gametypes\_healthoverlay::init();
thread maps\mp\gametypes\_friendicons::init();
thread maps\mp\gametypes\_spectating::init();
thread maps\mp\gametypes\_grenadeindicators::init();

level.xenon = (getcvar("xenonGame") == "true");
if(level.xenon) // Xenon only
thread maps\mp\gametypes\_richpresence::init();
else // PC only
thread maps\mp\gametypes\_quickmessages::init();

setClientNameMode("auto_change");

spawnpointname = "mp_tdm_spawn";
spawnpoints = getentarray(spawnpointname, "classname");

if(!spawnpoints.size)
{
maps\mp\gametypes\_callbacksetup::AbortLevel();
return;
}

for(i = 0; i < spawnpoints.size; i++)
spawnpoints[i] placeSpawnpoint();

allowed[0] = "tdm";
maps\mp\gametypes\_gameobjects::main(allowed);

// Time limit per map
if(getCvar("scr_tdm_timelimit") == "")
setCvar("scr_tdm_timelimit", "30");
else if(getCvarFloat("scr_tdm_timelimit") > 1440)
setCvar("scr_tdm_timelimit", "1440");
level.timelimit = getCvarFloat("scr_tdm_timelimit");
setCvar("ui_tdm_timelimit", level.timelimit);
makeCvarServerInfo("ui_tdm_timelimit", "30");

// Score limit per map
if(getCvar("scr_tdm_scorelimit") == "")
setCvar("scr_tdm_scorelimit", "300");
level.scorelimit = getCvarInt("scr_tdm_scorelimit");
setCvar("ui_tdm_scorelimit", level.scorelimit);
makeCvarServerInfo("ui_tdm_scorelimit", "300");

// Force respawning
if(getCvar("scr_forcerespawn") == "")
setCvar("scr_forcerespawn", "0");

if(!isDefined(game["state"]))
game["state"] = "playing";

level.mapended = false;

level.team["allies"] = 0;
level.team["axis"] = 0;

thread startGame();
thread updateGametypeCvars();
//thread maps\mp\gametypes\_teams::addTestClients();
}

dummy()
{
waittillframeend;

if(isdefined(self))
level notify("connecting", self);
}

Callback_PlayerConnect()
{
thread dummy();

self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";

level notify("connected", self);

if(!level.splitscreen)
iprintln(&"MP_CONNECTED", self);

lpselfnum = self getEntityNumber();
lpGuid = self getGuid();
logPrint("J;" + lpGuid + ";" + lpselfnum + ";" + self.name + "\n");

if(game["state"] == "intermission")
{
spawnIntermission();
return;
}

level endon("intermission");

if(level.splitscreen)
scriptMainMenu = game["menu_ingame_spectator"];
else
scriptMainMenu = game["menu_ingame"];

if(isDefined(self.pers["team"]) && self.pers["team"] != "spectator")
{
self setClientCvar("ui_allow_weaponchange", "1");

if(self.pers["team"] == "allies")
self.sessionteam = "allies";
else
self.sessionteam = "axis";

if(isDefined(self.pers["weapon"]))
spawnPlayer();
else
{
spawnSpectator();

if(self.pers["team"] == "allies")
{
self openMenu(game["menu_weapon_allies"]);
scriptMainMenu = game["menu_weapon_allies"];
}
else
{
self openMenu(game["menu_weapon_axis"]);
scriptMainMenu = game["menu_weapon_axis"];
}
}
}
else
{
self setClientCvar("ui_allow_weaponchange", "0");

if(!isDefined(self.pers["skipserverinfo"]))
self openMenu(game["menu_team"]);

self.pers["team"] = "spectator";
self.sessionteam = "spectator";

spawnSpectator();
}

self setClientCvar("g_scriptMainMenu", scriptMainMenu);
}

Also, since I'm not running a modded server at the moment, I assume I need to run the server with mods now to have this function properly?

Many thanks!!

Tally
14th September 2015, 11:17
I'm indeed not running any mods.

Then you're clean out of luck, because the script you are trying to get to work on your server is a mod script. You would have to run your server from an fs_game directory, rather than fs_basepath, in order to get this to work at all.

CaptainSlow
14th September 2015, 16:48
Then you're clean out of luck, because the script you are trying to get to work on your server is a mod script. You would have to run your server from an fs_game directory, rather than fs_basepath, in order to get this to work at all.

Thanks for your reply.

I don't mind running a modded server, I'm just new to this so sorry if I say confusing things.

If I understand correctly from this thread: http://www.fpsadmin.com/forum/showthread.php?t=10141
I would just make a new folder in my main folder (e.g. anti-cheat), add the contents of the unzipped and modified iwd file into that folder and add ' +fs_game anti-cheat' to my startup parameter, correct?

Many thanks!

Ni3ls
14th September 2015, 18:46
Yes, you only need to add the modifies files. Make sure the folder tree is the same. If you only modify .gsc files, you can add them in the folder without making it an .iwd file. This way its hard to download your scripts

Tally
14th September 2015, 19:07
Thanks for your reply.


I don't mind running a modded server, I'm just new to this so sorry if I say confusing things.

If I understand correctly from this thread: http://www.fpsadmin.com/forum/showthread.php?t=10141
I would just make a new folder in my main folder (e.g. anti-cheat), add the contents of the unzipped and modified iwd file into that folder and add ' +fs_game anti-cheat' to my startup parameter, correct?

Many thanks!

You do not make a folder in the "main" folder - you make a folder NEXT TO it.

CaptainSlow
21st September 2015, 22:30
Anti-namechanging script works! Today it successfully autokicked a cheater on our server, many thanks!