Validating client binaries in client/server handsh

2019-07-21 01:23发布

I am building a client-side program that connects to a server. This client-side program needs to have the source code available to the users as part of the licencing (not an option). However, I need to ensure that when a user connects to the server with that client-side program, it's running with the original code and hasn't been altered and re-compiled.

Is there any way to check during connection to the server that they're using an unaltered version of the program?

3条回答
Luminary・发光体
2楼-- · 2019-07-21 01:54

What you have described is a issue that the video game industry has been fighting for the last decade and a half. In short, how to prevent the user from modifying the client (in their case, generally to prevent cheating, though also for copyright reasons). If that effort has taught us anything, it's that preventing modifications to the client is a constant arms race that you will never decisively win. In light of that, don't even try.

Follow the standard client-server assumption that the client is in the hands of the enemy and cannot be trusted. Build your server side defensively based on that assumption and you'll be alright.

查看更多
手持菜刀,她持情操
3楼-- · 2019-07-21 02:03

It's very very difficult and probably not worth it. But if you are interested in pursuing it you'd have to develop something that has been code signed and monitored by the Windows kernal.

A couple topics that will orient you to the scope of the problem:

Protected media path

Driver signing

Both media devices and device drivers are digitally signed by the manufacturer and continuously monitored by Windows. If anything goes out of whack, it gets shut down (that'ts the technical term). Seems very daunting. And I don't know if the technology is available for desktop software that isn't a device driver and isn't related to DRM.

Good luck!

查看更多
别忘想泡老子
4楼-- · 2019-07-21 02:10

No, there's really no way to do that.

You're basically encountering the "Trusted Client" problem. The client code runs on the user's PC, and the user has full control over that PC. He can change the bytes of the program on disk, or even in memory. If you were to try to perform a hash or checksum against the code, he could simply change the code that did that verification and make it return "unmodified".

You could try to make things a little harder on a malicious user but there's no practical way to achieve what you're hoping.

查看更多
登录 后发表回答