anticheat

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

anticheat

by rnd » Mon Aug 29, 2016 07:51

A cheat detection mod that detects fly, noclip and too fast resource mining

Licenses :
LGPL (all files excluding anticheat_routines.bin)
WTFPL (anticheat_routines.bin)

Note: to discourage cheaters analyzing the code cheat checking routines are in binary. If you are trustworthy you can see them by request.

Depends : default

Download: https://github.com/ac-minetest/anticheat/archive/master.zip
----------------------------------------------------------------------------------------------------------

Who is this for:
Server admins who want to run serious survival servers, free of "ill fly around and noclip underground to get 999 mese/diamonds in 5 minutes while being undetected".

Does it work:
Yes, its being used in practice on @test@ Just Test II [SERVER] with 40-50 players.

Features:
+ Spoiler
Last edited by rnd on Mon Jan 16, 2017 08:58, edited 7 times in total.
 

User avatar
Naj
Member
 
Posts: 170
Joined: Sat Sep 19, 2015 21:14
GitHub: pyrollo
In-game: naj

Re: anticheat

by Naj » Mon Aug 29, 2016 08:43

Looks nice !

Seems that source of anticheat_routines.bin is missing in github
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: anticheat

by Calinou » Mon Aug 29, 2016 09:27

Naj wrote:Looks nice !

Seems that source of anticheat_routines.bin is missing in github


It looks like it's a proprietary mod: https://github.com/ac-minetest/antichea ... ua#L78-L79

I urge the mod author to actually release the source code of it, it's not a security threat at all. (We don't allow proprietary mods in Mod Releases, by the way.)
 

User avatar
Naj
Member
 
Posts: 170
Joined: Sat Sep 19, 2015 21:14
GitHub: pyrollo
In-game: naj

Re: anticheat

by Naj » Mon Aug 29, 2016 09:32

Ok, I was misleaded by the license text :p
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Mon Aug 29, 2016 09:42

Source is provided - just not for the sensitive part of checking. complete source - making it easy for cheaters to see what they should look for kinda defeats the purpose of it. So we have 2 possibilities:
1. weaken it by providing full source
2. play it smarter

What license do you suggest?
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: anticheat

by Calinou » Mon Aug 29, 2016 09:49

rnd wrote:Source is provided - just not for the sensitive part of checking. complete source - showing cheaters what they should look for kinda defeats the purpose of it. So we have 2 possibilities:
1. weaken it by providing full source
2. play it smarter

What license do you suggest?


The license used currently is fine (GPLv3+), but it's nothing if the full source code isn't available. Also, random server-side checks are not really weakened by providing source code…

But a binary-only mod only makes it harder to fix and improve.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: anticheat

by rubenwardy » Mon Aug 29, 2016 10:18

Correction: play it dumber, and have no one use your mod. I personally would not use a mod with hidden code.

Looks like it uses find_nodes_in_area and line_of_sight to detect fly and noclip, along with get_player_controls
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Mon Aug 29, 2016 10:22

i certainly agree to show full source to certain trusted people for review, just not to publish it openly.
 

User avatar
Naj
Member
 
Posts: 170
Joined: Sat Sep 19, 2015 21:14
GitHub: pyrollo
In-game: naj

Re: anticheat

by Naj » Mon Aug 29, 2016 10:26

In that case you have to choose another license. GPL implies that you give away the source.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: anticheat

by rubenwardy » Mon Aug 29, 2016 10:29

Yeah, under the GPL license anyone that downloads this mod can demand to see the source of the bin file, and you'd be legally obligated to comply
 

User avatar
Naj
Member
 
Posts: 170
Joined: Sat Sep 19, 2015 21:14
GitHub: pyrollo
In-game: naj

Re: anticheat

by Naj » Mon Aug 29, 2016 10:31

Sorry, I missed some messages. I don't know if it is possible, but I guess yes, to have open source system preventing from cheating. Your mod could certainly be a basis for such a system. But as said Calinou, improvement is made harder without sources.
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Mon Aug 29, 2016 12:22

For now ill just include source but encrypted with password. Anyone trustworthy can see it.

I still didn't find any good example of open source anti cheat system, either they are long time abandoned or empty.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: anticheat

by rubenwardy » Mon Aug 29, 2016 12:39

If you write the server/client in the correct way using client side prediction / server side reconciliation, there is no need to use anti cheat, as the algorithms include it - the server simulates movement on its end, as well as on the client, to make sure there's no problems. But Minetest doesn't do this, and it's a little late to do add this
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Mon Aug 29, 2016 12:49

Right, that seems to be nicely explained here:
http://gabrielgambetta.com/fpm2.html

Btw there is strange bug in minetest where:

minetest.get_node(player:getpos()).name

does not always return name of node at player feet position, for player positions where pos.y<0 it actually returns node 1 below player feet position. Another thing:

When player jumps and then lands on floor with sneaking sometimes player:getpos() will report player y-position not at integer.5 ( 4.5 for example), but something like integer.49888...288 ( strangely this number is always the same). This causes minetest.get_node(player:get_pos()).name to read position 1 block down again - making it unnecessarily difficult to read correct position without rounding it first.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: anticheat

by SaKeL » Fri Oct 21, 2016 22:35

Whats wrong ? I do have "anticheat_routines.bin" in the mod folder..

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-10-21 23:56:38: ERROR[Main]: ModError: Failed to load and run script from /home/juraj/.minetest/mods/anticheat/init.lua:
2016-10-21 23:56:38: ERROR[Main]: /home/juraj/.minetest/mods/anticheat/init.lua:94: attempt to call local 'anticheat_routines' (a nil value)
2016-10-21 23:56:38: ERROR[Main]: stack traceback:
2016-10-21 23:56:38: ERROR[Main]:    /home/juraj/.minetest/mods/anticheat/init.lua:94: in main chunk


line in init file:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local anticheat_routines=loadfile(minetest.get_modpath("anticheat").."/anticheat_routines.bin")
check_noclip, check_fly, check_player = anticheat_routines(minetest,cheat,CHECK_AGAIN,punish_cheat);
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Sat Oct 22, 2016 09:14

only reason i can think of:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
string.dump(function)
Returns a binary representation of the given function, so that a later loadstring on that string returns a copy of the function. Function must be a Lua function without upvalues.


-> maybe binary made on windows can't be loaded on linux. In this case someone needs to do it on linux.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: anticheat

by SaKeL » Sat Oct 22, 2016 09:22

i have linux, i could try it out if you give me some indication on what needs to be done.

EDIT: found some examples on how to do it, will try to do it on example lua files but eventually i will need the source.
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Sat Oct 22, 2016 11:14

i was curious so i installed minetest 0.4.14 under linux ubuntu from and gave it a try. Did:
0. installed minetest using Synaptic Package manager under Lubuntu
Image
1. extracted https://github.com/ac-minetest/antichea ... master.zip into home/$name/.minetest/mods, renamed folder names: anticheat-master to anticheat
Image
2. run minetest game in singleplayer with "anticheat" mod checked
3. it runs ok, with anticheat mod working:
Image
Attachments
Ubuntu-2016-10-22-13-29-12.jpg
Ubuntu-2016-10-22-13-29-12.jpg (66.51 KiB) Viewed 10089 times
Ubuntu-2016-10-22-13-17-44.jpg
Ubuntu-2016-10-22-13-17-44.jpg (89.9 KiB) Viewed 10089 times
linux_lubuntu.jpg
linux_lubuntu.jpg (76.7 KiB) Viewed 10089 times
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: anticheat

by SaKeL » Sat Oct 22, 2016 15:45

Weird..i try to remove my anticheat folder from my mods folder and clone it again..i dont see any other solution at this point...hope that will work

FYI: im using daily builds, not sure what is in the synaptic repositories atm
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: anticheat

by SaKeL » Sat Oct 22, 2016 16:35

nope...

- removed the mod
- clone it again
- not working

- removed the mod
- downloaded the .zip file
- not working

- each time i have created new map with only default mods and anticheat mod enabled

Seems like there is something else on my machine what is causing this not to work since it works on rnd's machine.
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: anticheat

by ExeterDad » Sat Oct 22, 2016 16:48

I'm assuming the bin file is compiled lua. Does compiled lua need to be run with identical lua versions? This is just a guess btw. I know to decompile lua, version IS important in many cases.

Edit: Just found this.
Lua programs that have been precompiled for one version will not load in a different version.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: anticheat

by SaKeL » Sat Oct 22, 2016 16:59

Found the problem, just adjust the minetest.conf file with:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#    Prevent mods from doing insecure things like running shell commands.
secure.enable_security = false


This will open vulnerability for any mod to run shell commands on your server or pc. Maybe it would be better to use "request_insecure_environment()" function in your mod so people can include it in the "secure" list instead of disabling the security for all mods ;)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#    Comma-separated list of trusted mods that are allowed to access insecure
#    functions even when mod security is on (via request_insecure_environment()).
#secure.trusted_mods =
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: anticheat

by rnd » Sat Oct 22, 2016 17:58

indeed, in [0.4.12-dev] Mod security it says
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
But the following things shouldn't work:
    Using some insecure functions like require(), os.execute(), or debug.getlocal().
    Running compiled Lua bytecode.
 

User avatar
bigfoot547
Member
 
Posts: 172
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
In-game: bigfoot547

Re: anticheat

by bigfoot547 » Sun Oct 30, 2016 21:59

Can I please see the code?

+1 for open source!
God's not dead, He's surely alive!
My Stuff | My User Page | Check out my website!
<bigfoot547> I major in existing. | <RedPanda246> Not every day is good, but there is good in every day.
I, bigfoot, have this special ability to destroy cameras and recording devices within a 5 mile radius of myself. Mystery solved.
 

red-001
Member
 
Posts: 126
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: anticheat

by red-001 » Tue Nov 01, 2016 22:35

It's trivial to decompile lua bytecode. If someone is going to take the time to try and find a weakness in an anticheat system, compiling lua to bytecode isn't going to do much to stop them.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: anticheat

by rubenwardy » Tue Nov 01, 2016 23:05

I spent an hour or so trying to decompile it using unluac, hex editors, and other tools. I don't understand the obscurity side of lua though
 

red-001
Member
 
Posts: 126
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: anticheat

by red-001 » Tue Nov 01, 2016 23:15

AFAIK Lua JIT uses a different format for bytecode so you need a decompiler that written for Lua JIT.
 

User avatar
bigfoot547
Member
 
Posts: 172
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
In-game: bigfoot547

Re: anticheat

by bigfoot547 » Tue Nov 01, 2016 23:59

I think that you should make the mod open-source because:
  1. Your license assumes that your code is open-source (GPL v3.0)
  2. This defeats the whole purpose of the linux operating system
  3. With your license you would have to give the code when someone asks (see #1)
  4. This is not allowed in mod releases
And for what?
If you don't want cheaters to analyze the code to cheat undetectably, the cheater would go to the next server. I mean, the server list shows the mod list! If I were a cheater and I saw an anticheat mod, I would not go on that server.

That is all.
Cheers, bigfoot547.
God's not dead, He's surely alive!
My Stuff | My User Page | Check out my website!
<bigfoot547> I major in existing. | <RedPanda246> Not every day is good, but there is good in every day.
I, bigfoot, have this special ability to destroy cameras and recording devices within a 5 mile radius of myself. Mystery solved.
 

User avatar
maikerumine
Member
 
Posts: 946
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: anticheat

by maikerumine » Wed Nov 02, 2016 00:41

bigfoot547 wrote:I think that you should make the mod open-source because:
  1. Your license assumes that your code is open-source (GPL v3.0)
  2. This defeats the whole purpose of the linux operating system
  3. With your license you would have to give the code when someone asks (see #1)
  4. This is not allowed in mod releases
And for what?
If you don't want cheaters to analyze the code to cheat undetectably, the cheater would go to the next server. I mean, the server list shows the mod list! If I were a cheater and I saw an anticheat mod, I would not go on that server.

That is all.
Cheers, bigfoot547.

For what it's worth,

The code is pretty solid and has done a great job deterring cheaters on the Just Test 2 server. :)
 

User avatar
xeranas
Member
 
Posts: 99
Joined: Fri Feb 05, 2016 11:06
GitHub: xeranas

Re: anticheat

by xeranas » Fri Nov 04, 2016 08:58

Either way your mod is not GPL: (misleading license)
Linking a GPL covered work statically or dynamically with other modules is making a combined work based on the GPL covered work. Thus, the terms and conditions of the GNU General Public License cover the whole combination.


Or you violating GPL (by hidding source code):
if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program's users, under the GPL.


Even by asking source code is provided only for "trustworthy" so definitely not for everyone.

I understand mod author intentions. However what stops me from creating "anticheat over 9000" mod include crappy binary which do some harm to user?. If there no source code its not open source as simple as that. Obfuscated source form is not valid source code.
The source code for a work means the preferred form of the work for making modifications to it.
 

Next

Return to WIP Mods

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron