How to secure client-side anti-cheat [closed]

筅森魡賤 提交于 2019-12-03 05:45:16

If you want your customer to respect you and the game, you should be respectful of your customer and realize what you see as a game client machine may be used to store valuable information.

allowing the client-side to scan any part of memory given at random by the server

the client itself may be self changing and allow for it to add/remove features as needed at random

Just be careful you're not opening an attack vector into the clients machine. Reading "any part of memory given at random" sounds scary. You could make it less so by hashing a (not small) block of memory and checking for a known value.

Letting the server send "random" code is probably going to make your software look like a virus/botnet to anti-virus/security tools. It also leaves the client wide open to potential exploit.

Update:

1) Open all other processes, and hook their WriteProcessMemory functions

If you do this, and you have a bug in the injected code, you could destabilize your customer's entire machine. This seems aggressive. And what version of Windows are you running on? With what permissions? I'm pretty sure a cracker could arrange to run his exploit from a process you don't have permission to hook (like an admin process where you're running in a normal user process). Also you'll need to hook GetProcAddress for obvious reasons.

4) Hook into the LoadLibrary functions and monitor any DLLs that are being loaded dynamically, to prevent DLL injection.

This one's not as bad as it sounds because you only need to do this in the local process.

6) Use some anti-debugging techniques to prevent debuggers from attaching to your processes.

Certainly worth doing (if you have the time), but it's just a speed bump for an experienced cracker. Remember he can always trace your code from startup and observe or bypass your anti-debugging. (It takes time but some crackers enjoy this.)

7) Use a custom proprietary PE packer to prevent useful disassembly of your game.

This is another one that's going to get you noticed by Anti-Virus software.

I personally don't think that it make sense to observe the memory and so on. I could imagine that you need to handle it also when somebody implements the protocoll and makes some crap wich may also let your server crash.

But you are right that it is possible to check the memory for bad software which is typically used by cheaters e.g. like wallhacks in egoshooters.

IMHO you need to check if the data from the client looks valid and react than on cheating.

About your update:
Please don't hook all other progamms this is a little crazy and also it may let your programm to be detected as a root kit or something like that.

I completely agree with what the other folks here say -- some of these (opening all other processes and hooking WriteProcessMemory, mouse/keyboard emulation functions) are crazy and ludicrous -- especially since the user can bypass this by dropping privileges to your process. Doing this will most certainly inspire ire from some users.

But if you really want to go all out and do crazy stuff like malware, why not write a kernel driver which patches the Protected flag (for Windows Vista and later) or patch OpenProcess? The latter is a more common approach (seen in AV software and malware); the prior is less common, but still doable -- if you can load a KMD, you can patch the flags and bypass the Microsoft signature requirement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!