SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 23/04/2019, 12:54 AM   #1081
4D1L
Big Clucker
 
Join Date: Mar 2016
Location: United Kingdom
Posts: 74
Reputation: 22
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by MP2 View Post
Does anyone else have issues with this having false detections (Airbreak on-foot) when players climb/mantle onto/over objects? Every time I jump over a damn fence it accuses me of cheating. Has this even been tested?

Also warping a player to the ground with SetPlayerPosFindZ still accuses me of a teleport hack even though SetPlayerPosFindZ is presumably hooked and checked for this?

I also get 'anti-flood' for OnPlayerRequestSpawn being spammed. If the script denies spawn with return 0 the script will spam OnPlayerRequestSpawn by SA-MP design to check if the condition has changed. It should not be blocked by an anticheat.. And then when you do spawn it accuses you of 'fake spawn' - what?

Ran it for 5 minutes and already found 4 issues. Looks good on paper but functionally not perfect.

By default this takes control over what happens to cheaters by automatically kicking them. The action to take on cheaters should not require altering this library. I want to handle cheat detection my own way but there is no option for that without changing the include.
I used the include for a while before I decided to incorporate Weapon-Config. My gamemode is based upon the concept of endless police pursuits which often lead to foot chases which sometimes includes vaulting over short walls.

I have not had many issues with this anti-cheat apart from multiple counts of false Rapid Fire cheats detection. If I really wanted to, I could have disabled the checks for Rapid Fire in the configuration file because of the flexibility of this include.

In regards to what happens after detecting cheats, you can use OnCheatDetected() which would prevent the automatic kicks. There is some documentation for this here. When I used this include, I had OnCheatDetected send the type of cheat detected to my admins.
4D1L is offline   Reply With Quote
Old 23/04/2019, 04:43 AM   #1082
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 952
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by MP2 View Post
By default this takes control over what happens to cheaters by automatically kicking them. The action to take on cheaters should not require altering this library. I want to handle cheat detection my own way but there is no option for that without changing the include.
It seems that you have not really considered the functionality and means of configuring the script. As 4D1L said, public OnCheatDetected is used to control punishments when any anticheat is triggered (actually there are also OnCheatWarning, OnFloodWarning and OnNOPWarning, but their use is rarely needed).

Moreover it's strange to see questions like whether it has been tested. This anticheat is now used on at least two largest samp servers. So yes, it was tested. Every line. Everything.

Quote:
Originally Posted by MP2 View Post
Does anyone else have issues with this having false detections (Airbreak on-foot) when players climb/mantle onto/over objects? Every time I jump over a damn fence it accuses me of cheating.
I need anticheat logs with all debug information (you can find it in main server_log when player is being kicked), and also (if possible) a way, where and how this can be reproduced by myself.

Quote:
Originally Posted by MP2 View Post
Also warping a player to the ground with SetPlayerPosFindZ still accuses me of a teleport hack even though SetPlayerPosFindZ is presumably hooked and checked for this?
Of course. Make sure you are using the latest version and also provide logs of the kick for this case.

Quote:
Originally Posted by MP2 View Post
I also get 'anti-flood' for OnPlayerRequestSpawn being spammed. If the script denies spawn with return 0 the script will spam OnPlayerRequestSpawn by SA-MP design to check if the condition has changed. It should not be blocked by an anticheat.. And then when you do spawn it accuses you of 'fake spawn' - what?
It is blocked by anticheat only when flood attempts are suspected. Based on the default settings, you had to click on it about 7 times per second with a call interval of 150 ms between each call to trigger anfi-flood. I can increase the number of attempts to detect, but this doesn't negate the fact that in order to achieve a detection it's necessary to try hard by pressing it so quickly. As for 'fake-spawn', I also need more specific and detailed information to make possible suggest or do something.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 23/04/2019, 09:09 AM   #1083
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: Nex-AC - Anticheat system

Hey thanks for your reply, it's nice to see how confident you are in this library. Perhaps I jumped to conclusions before actually looking into things so I apologise about that. If I can get this working properly for me it will be great.

1. OnCheatDetected and OnCheatWarning are not forwarded by nex-ac library. Why are we required to forward them ourselves? Not really an issue just wondering.

2. When using SetPlayerPosFindZ to warp the player from the air down to the ground:
[09:50:52] [Nex-AC debug] Dist: 75.143875, dist set: 25000.000000, speed: 1, old pos x, y, z: 2697.343750, 79.341690, 110.264663
[09:50:52] [Nex-AC] Suspicious player, ID 0. Reason code: 002 (2)
[09:50:52] [part] Mike has left the server (0:2)

3. When I climb/jump/vault/mantle over a wall/fence, it detects Airbreak (onfoot) as seen in this video:
http://mikescnr.com/stuff/Mike/nexac/nex-ac-jump.mp4

I have had to use animation detection to prevent this from wrongfully banning people. Has nobody using this plugin ever jumped over a fence or something?

pawn Code:
if(code == 0)
    {
        new animName[16], animLib[16];
        GetAnimationName(GetPlayerAnimationIndex(playerid), animLib, 16, animName, 16);
        if(!strcmp(animName, "CLIMB_JUMP2FALL", true) || !strcmp(animName, "FALL_GLIDE", true)) return SendClientMessage(playerid, -1, "AC_IGNORE_CLIMB_ANIM");
    }

4. In regards to nex-ac automatically kicking players, it seems this only occurs if the OnCheatWarning/Detected callbacks aren't in use, which I didn't realise.

5. For anti-flood and OnPlayerRequestSpawn:
[10:01:36] OnCheatDetected called
[10:01:36] [ADMIN LOG] Anticheat: {FFFFFF}Mike (26){FF0000} detected '{FFFFFF}Anti-flood{FF0000}'. Flags: {FFFFFF}0
[10:01:36] [Nex-AC debug] ID 26 exceeded 5 flood attempts. Public ID: 19
[10:01:36] [Nex-AC] Suspicious player, ID 26. Reason code: 049 (19)
[10:01:36] OnCheatDetected called
[10:01:36] [ADMIN LOG] Anticheat: {FFFFFF}Mike (26){FF0000} detected '{FFFFFF}Anti-flood{FF0000}'. Flags: {FFFFFF}0
[10:01:36] [Nex-AC debug] ID 26 exceeded 5 flood attempts. Public ID: 19
[10:01:36] [Nex-AC] Suspicious player, ID 26. Reason code: 049 (19)
[10:01:36] OnCheatDetected called
[10:01:36] [ADMIN LOG] Anticheat: {FFFFFF}Mike (26){FF0000} detected '{FFFFFF}Anti-flood{FF0000}'. Flags: {FFFFFF}0
[10:01:36] [Nex-AC debug] ID 26 exceeded 5 flood attempts. Public ID: 19
[10:01:36] [Nex-AC] Suspicious player, ID 26. Reason code: 049 (19)
[10:01:36] OnCheatDetected called
[10:01:36] [ADMIN LOG] Anticheat: {FFFFFF}Mike (26){FF0000} detected '{FFFFFF}Anti-flood{FF0000}'. Flags: {FFFFFF}0
[10:01:38] [Nex-AC debug] Spawn res: 0, Respawn time: 1905362
[10:01:38] [Nex-AC] Suspicious player, ID 26. Reason code: 027
[10:01:38] OnCheatDetected called
[10:01:38] [ADMIN LOG] Anticheat: {FFFFFF}Mike (26){FF0000} detected '{FFFFFF}Fake Spawn{FF0000}'. Flags: {FFFFFF}0

http://mikescnr.com/stuff/Mike/nexac/nex-ac-spawn.mp4

As I previously said, by SA-MP design a player holding down the shift key on class selection will spam OnPlayerRequestSpawn.
This is so that if the condition that is stopping them from spawning (e.g. there may be a wait period before respawning Battlefield-style) changes, they can then spawn.
Default behaviour of SA-MP should not flag up as cheats.

6. Also what should I do about filterscripts using SetPlayerPos being detected? Is it as simple as just including nex-ac in the filterscript or will they interfere with each other?

7. Bunnyhopping on a bike/BMX is being detected as a cheat.
http://mikescnr.com/stuff/Mike/nexac...c-bunnyhop.mp4
There are no logs at all in server_log.txt. It just calls OnCheatDetected.

Hope we can resolve these issues.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 23/04/2019, 01:44 PM   #1084
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 952
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by MP2 View Post
OnCheatDetected and OnCheatWarning are not forwarded by nex-ac library. Why are we required to forward them ourselves? Not really an issue just wondering.
As far as I remember, at the time of implementation I couldn't declare this public in include because when declaring it through forward, the following check:
PHP Code:
#if defined OnCheatDetected 
will be considered successful, but Im using such checks across the entire script to understand whether OnCheatDetected is used in gamemode or not. Thus, as soon as we declare a forward in our script, the anticheat begins to "see" it. And if it will be declared in include, ac would see it always, regardless of the actual use in mode.

Quote:
Originally Posted by MP2 View Post
When I climb/jump/vault/mantle over a wall/fence, it detects Airbreak (onfoot) as seen in this video:
http://mikescnr.com/stuff/Mike/nexac/nex-ac-jump.mp4
Ahh, you talked about triggering OnCheatWarning. Well, then it's a completely different matter. Actually the original purpose of introducing OnCheatWarning is purely debugging reasons (although it also became useful for some anticheat codes to notify the admins through this callback before the anticheat has fully detected the cheater). In this case I can only advise you not to rely on this public and not to use it for admin notifications for anticheats such as: anti-airbreak, anti-flyhack in car, anti-rapid fire, anti-cj running and other similar. Warnings in these anticheats are made precisely because on the first "attempt(s)" anticheat sometimes detect the use of cheats where they were not, and that is why it was necessary to have a player's behavior suitable for anticheat checks and staying the same for several packets (updates) in a row.

Quote:
Originally Posted by MP2 View Post
Bunnyhopping on a bike/BMX is being detected as a cheat.
http://mikescnr.com/stuff/Mike/nexac...c-bunnyhop.mp4
There are no logs at all in server_log.txt. It just calls OnCheatDetected.
The same, you talking about OnCheatWarning, not OnCheatDetected. Warnings on anti-flyhack in car should also be ignored if you use this public.

Quote:
Originally Posted by MP2 View Post
In regards to nex-ac automatically kicking players, it seems this only occurs if the OnCheatWarning/Detected callbacks aren't in use, which I didn't realise.
So, the logic of all this is quite simple: when you don't use OnCheatDetected in your gm, the anticheat applies the default punishments for each type of cheat. For some it may be kick, for others just desync or returning old data back. However, as soon as you declare OnCheatDetected, the default punishments for all cheats will be completely disabled and with every detection only that will be called is your declared public, so you should set punishments in it (or notifications, everything that you consider necessary), otherwise nothing will be done if cheater would call a blank OnCheatDetected.

Quote:
Originally Posted by MP2 View Post
Also what should I do about filterscripts using SetPlayerPos being detected? Is it as simple as just including nex-ac in the filterscript or will they interfere with each other?
There are no problems with this. You should just include the anticheat in a filterscript, and it'll hook all the nessesary functions and send them to the gamemode. The only important "but" - you must have in your filterscript the following define before including the anticheat:
PHP Code:
#define FILTERSCRIPT 

And as for false detection with SetPlayerPosFindZ. Currently I have no idea why it could detect any player if he was teleported by the server. Perhaps you are just using this code in a filterscript and the ac didn't see its use? Make sure all your code with functions is under anticheat hooking.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker

Last edited by OstGot; 23/04/2019 at 03:30 PM.
OstGot is offline   Reply With Quote
Old 23/04/2019, 02:24 PM   #1085
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by OstGot View Post
As far as I remember, at the time of implementation I couldn't declare this public in include because when declaring it through forward, the following check:
PHP Code:
#if defined OnCheatDetected 
will be considered successful, but Im using such checks across the entire script to understand whether OnCheatDetected is used in gamemode or not. Thus, as soon as we declare a forward in our script, the anticheat begins to "see" it. And if it will be declared in include, ac would see it always, regardless of the actual use in mode.
I believe you could use funcidx() to check if the callback is in use.

Quote:
Originally Posted by OstGot View Post
Ahh, you talked about triggering OnCheatWarning. Well, then it's a completely different matter. Actually the original purpose of introducing OnCheatWarning is purely debugging reasons (although it also became useful for some anticheat codes to notify the admins through this callback before the anticheat has fully detected the cheater). In this case I can only advise you not to rely on this public and not to use it for admin notifications for anticheats such as: anti-airbreak, anti-flyhack in car, anti-rapid fire, anti-cj running and other similar. Warnings in these anticheats are made precisely because on the first "attempt(s)" anticheat sometimes detect the use of cheats where they were not, and that is why it was necessary to have a player's behavior suitable for anticheat checks and staying the same for several packets (updates) in a row
Right, just using OnCheatDetected instead of Warning seems to be helping eliminate this false-positive issue. Thanks.

Quote:
Originally Posted by OstGot View Post
There are no problems with this. You should just include the anticheat in a filterscript, and it'll hook all the nessesary functions and send them to the gamemode. The only important "but" - you must have in your filterscript the following define before including the anticheat:
PHP Code:
#define FILTERSCRIPT 
That's working fine now thanks.

Quote:
Originally Posted by OstGot View Post
And as for false detection with SetPlayerPosFindZ. Currently I have no idea why it could detect any player if he was teleported by the server. Perhaps you are just using this code in a filterscript and the ac didn't see its use? Make sure all your code with functions is under anticheat hooking.
The code is in the gamemode. Using SetPlayerPos over a long distance works fine, but SetPlayerPosFindZ from high in the sky to the ground is calling OnCheatDetected every time. I have removed SetPlayerPosFindZ and instead am using MapAndreas to find the Z height and just calling SetPlayerPos and it works fine. It's only the FindZ function that is detecting cheats.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 23/04/2019, 03:44 PM   #1086
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 952
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by MP2 View Post
http://mikescnr.com/stuff/Mike/nexac/nex-ac-spawn.mp4

As I previously said, by SA-MP design a player holding down the shift key on class selection will spam OnPlayerRequestSpawn.
This is so that if the condition that is stopping them from spawning (e.g. there may be a wait period before respawning Battlefield-style) changes, they can then spawn.
Default behaviour of SA-MP should not flag up as cheats.
Yeah, it seems I managed to reproduce it. So in the next version anti-flood for OnPlayerRequestSpawn will only trigger if the previous call to this public returned 1. The problem with fake spawn was also a consequence of this problem and will be fixed. Thanks!

Quote:
Originally Posted by MP2 View Post
I believe you could use funcidx() to check if the callback is in use.
Unfortunately, this will be completely unjustified, since this function is performed while the server is running and not when compiling the script. Thus, an already compiled script will have a bunch of checks in the most frequently invoked places (and there are really a lot of them) in addition to the extra code that won't be ommited like it does with define-checks.

Quote:
Originally Posted by MP2 View Post
The code is in the gamemode. Using SetPlayerPos over a long distance works fine, but SetPlayerPosFindZ from high in the sky to the ground is calling OnCheatDetected every time. I have removed SetPlayerPosFindZ and instead am using MapAndreas to find the Z height and just calling SetPlayerPos and it works fine. It's only the FindZ function that is detecting cheats.
At the moment I can't reproduce anything like this on a test server or anywhere else. But if any additional information appears (including yours), I will try to solve it somehow.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 24/04/2019, 05:44 PM   #1087
Leaky
Big Clucker
 
Join Date: Jul 2018
Posts: 76
Reputation: 12
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Leaky View Post
How can I know which code represents which hack? in other words, is there a list of all the codes and which hack it stands for?

P.S: I've checked the include and I saw a code long list of hacks is that the code beside it?
Bump
__________________
Leaky is offline   Reply With Quote
Old 24/04/2019, 07:27 PM   #1088
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 952
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Leaky View Post
Bump
You can find it here.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 27/04/2019, 09:08 PM   #1089
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: Nex-AC - Anticheat system

Found a problem: When players enter a Caddy the game gives them a golf club which is then detected by the weapon anticheat.

I believe this used to also be an issue for other vehicles (shotgun from cop cars, health from ambulance, armor from enforcer etc.) but I think they've all been patched except this one.

You already seem to have added checks for parachutes being acquired from planes/helis so should be straightforward to modify that to include this.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 28/04/2019, 01:07 PM   #1090
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 952
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by MP2 View Post
Found a problem: When players enter a Caddy the game gives them a golf club which is then detected by the weapon anticheat.

I believe this used to also be an issue for other vehicles (shotgun from cop cars, health from ambulance, armor from enforcer etc.) but I think they've all been patched except this one.

You already seem to have added checks for parachutes being acquired from planes/helis so should be straightforward to modify that to include this.
Such a check was in the first versions of script (specifically for a golf club, because everything else except parachutes was disabled in SA-MP), but as it turned out, the golf club also doesn't work when the client without any third-party software. This is a feature of the old outdated s0bs, which are apparently available in the gta sa folder for players who complain about this problem. Ask them to delete/move out d3d9.dll from their game folder and they will see the problem disappear immediately.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working AntiCheat system mrxqware Scripting Help 4 02/05/2014 11:04 AM
[Include] System AntiCheat V1.1 Glad2BeHere Includes 13 04/03/2013 07:33 PM
-AntiCheat System geohareas Scripting Help 5 08/01/2013 06:38 PM
[FilterScript] [FS] ZAdmin v1.0 | ADMIN SYSTEM + REGISTER + ANTICHEAT + ANTIFLOOD + ANTISWEAR. [ZFM]Zuc Filterscripts 24 25/05/2011 09:19 AM


All times are GMT. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.