News for hackers. Stuff that matters.
Re:Never trust the client by xenadu02 on Wednesday April 27, 2016 @03:38PM (#11583820)
"Never trust the client" is good advice for every kind of application. Clients are filthy liars.

Clients have bugs. Old clients don't upgrade. Packets arrive out of order. ACKs never make it to clients, causing clients to repeat what the client believes to be a failed operation. All of this is before even considering an attacker actively trying to subvert you.

The server should always be the source of truth. It should always enforce all the consistency rules. Database schemas can be a critical tool here as well.

Don't blindly slap whatever the client sends into a no-SQL database, then vomit it back out for queries.

Re:Never trust the client by ageektrapped on Wednesday April 27, 2016 @04:09PM (#11584085)
> The server should always be the source of truth. It should always enforce all the consistency rules. Database schemas can be a critical tool here as well.

Amen. And I'm a client developer. Clients aren't for data validation, etc. That's the server's job because the server has to store it, use it, ship it off to other things.

Clients are for displaying all that data in a way a human can understand. It has people skills, damn it!

Re:Never trust the client by taneq on Thursday April 28, 2016 @01:54AM (#11586769)
The server is the model and the controller. The client is the view, and marshals input to the controller. Doing it any other way is bananas.
Re:Never trust the client by djsumdog on Wednesday April 27, 2016 @04:52PM (#11584448)
I saw a talk where a guy was showing how to cheat at some games. A lot of games will detect and crash you out if they detect a debugger attached to them.

Things like Punk Buster, et. al. are more like anti-virus software: they try to find the signatures of known chat clients.

So it's best to write you own...and rename your debugging process to "Google Chrome." He got pretty far with his auto-walker in some MMOs. He had limiters so his runs wouldn't be too fast and would go up/downhill correctly...or so he though. He forgot to multiple by -1 somewhere and the server banned him for attempting to fly of into space.

Re:Never trust the client by drdaeman on Wednesday April 27, 2016 @10:05PM (#11586142)
More modern anti-cheat software seem to have a trend to move to kernel space[1] and block user-mode access. So it's not just signature checking, but some generic attack prevention as well. (Cheats also move to kernel space, of course.)

Wonder how soon there will be a market of PCI-e cheat rigs for DMA attacks...

____

[1] Yep, gamers are literally accepting rootkits that allow arbitrary remote code execution on their machines.

Re:Never trust the client by smelendez on Thursday April 28, 2016 @12:12AM (#11586522)
> Yep, gamers are literally accepting rootkits that allow arbitrary remote code execution on their machines.

That's certainly risky and rather horrible, but what's the alternative? Multiplayer games are a huge business and a huge culture, and all that goes down the drain if people cheat.

Game companies have millions of people around the world competing for prestige and money. They're running game software on their own personal computers--machines that are also full of their financial records, naked pictures and personal correspondence. If your game is full of cheaters, you're done. If your game gets players hacked, you're really done.

I have no idea what the solution is, and I'm really glad it's not my job to figure it out.

Re:Never trust the client by ultramancool on Thursday April 28, 2016 @12:48AM (#11586610)
The solution is simple: do everything server side. Look at World of Tanks for a great example of this. They pretty much let people run free with mods in multiplayer and even the worst of those mods can barely provide an advantage in online play. They do this by managing absolutely everything server side. Ammo, direction of aim, position, enemy players appearing and disappearing etc. Basically your server should be built to send only what's absolutely necessary and your client should be built to use absolutely everything so cheats can't provide much advantage rather than vice versa.
Re:Never trust the client by swombat on Thursday April 28, 2016 @05:17AM (#11587422)
An even better solution: let the competitive advantages be given only by doing things the computer is bad at and human beings enjoy doing.

If you get a competitive advantage from doing something like grinding, which computers can do better and more tirelessly than humans, and humans tend to dislike, then inevitably you will have cheating. (e.g. WoW)

If on the other hand the competitive advantage is from working out a strategy of in what order to play your cards to maximise your chances of building up your strength while attacking the opponent and yet keeping something in store for surprises the opponent may spring on you - a really complex strategic task - then that's something people enjoy doing and the computer sucks at. (Hearthstone)

People may be addicted to the first kind of games, but is that something that should be protected? It's kind of similar to people addicted to slot machines... sad, a reality we have to accept, but not something we should expend vast amounts of intelligence trying to sustain.

Of course, there are people who will do it for the money, and don't stop them, but realise that they are basically just a few steps short of people refining formulae for meth to make it more addictive - the fact there's a business case that exploits a human weakness doesn't mean it's a productive use of intelligent people's time.

Re:Never trust the client by cataflam on Thursday April 28, 2016 @12:01PM (#11589832)
There are some things computers are really good at and that human beings also enjoy doing. Computers are insanely fast, yet plenty of reflex-based games exist. A lot of high-level competitive games have a dexterity dimension. FPS games for example are a mix of strategy and dexterity, with a big emphasis on dexterity. RTS games like Starcraft put a bigger emphasis on strategy but still require insane finger dexterity at the highest levels. The dexterity part of the game could be done far better by a simple AI. Aim bots in FPS or inhumanly micro-management in RTS have been demonstrated, yet those games are still played, and interesting.

One of the examples you gave, Hearthstone, actually had many bots running on the ladder for a time. Their goal was grinding, but even so, a number of them was better than a significant portion of the human playerbase. With the recent advances in artificial intelligence, computers are not that bad at this kind of task.

Overall, I don't disagree with your main point though. I have no qualms automating boring and repetitive tasks in non-competitive games. And if a competitive game has those parts, I'd probably avoid playing it. I'd rather spend my time coding than wasting it grinding because it's part of some game I otherwise enjoy. I feel it is indeed a more productive use of my time. I wouldn't go as far as judging other people who like the grind though.

Re:Never trust the client by exDM69 on Thursday April 28, 2016 @04:51AM (#11587345)
Doing everything server-side is not enough to prevent cheating. There are plenty of client-side tricks that can give the player an advantage, starting from simple visual cheats.

E.g. turn the opponent's textures bright purple so you can see them better. Make the walls transparent. Aimbots that spoof mouse input.

The server must be authoritative or all bets are off, but you still do need client side anti-cheat countermeasures (stuff like verifying screenshots).

This stuff can't be made 100% fool proof, so competitive games where big bucks are at stake must still take place with the organizers providing the hardware and the players located in the same room.

Re:Never trust the client by ultramancool on Thursday April 28, 2016 @07:36AM (#11587996)
You're right - you can never prevent that. Which means your client needs to offer it to keep it from becoming an advantage. If the players are already bright, recognizable colours you're basically already there. Transparent walls don't help when the server doesn't send you the enemies hiding behind them until the very instant they pop out. And if you're only spoofing mouse movement, well, that is getting pretty high risk, you may have a slight advantage, but human players will still be able to kill you without too much to effort. And I think that's the main thing anticheat should be preventing.
Re:Never trust the client by cataflam on Thursday April 28, 2016 @11:45AM (#11589705)
Even all that still doesn't stop a very old type of cheats: aim bots. Even if the server only sends you information about enemies the instant they pop out, a computer will be faster and more precise to aim and shoot at this enemy than any human player could be. Add in some randomization and delays so the server can't easily differentiate the movements from a human player, and you're a mechanically world-class player. Doing everything server-side is not enough to prevent cheating.
Re:Never trust the client by ultramancool on Thursday April 28, 2016 @02:21PM (#11590888)
Sure, but aimbots aren't as much of a problem if they have to aim like humans - which you can enforce. You can buy some advantage like this, yes, but not much if it's implemented correctly. Additionally if you can't detect a player behind you for example, you're still dead, doesn't matter if you aimbot or not. "World class player" perhaps, but only if your bot can really play as well as a human within the confines of the game - knowing which corners to check, knowing when to look behind you, where to be aimed at a given time, etc. Your bot needs to be a hell of a lot smarter than a bot that's just given all the data and has to do basic trigonometry to aim at their head - your bot has to think a lot more like a human and may even underperform many humans.

Ultimately no matter what you do, some small percentage of your players will cheat. Every major game on the market has paid cheats which fully bypass the protections available for it. It's better if those cheats can only buy them a little than buy them a lot. It's not worth investing a lot of effort in more than basic cheat protection, it is worth investing it in handling as much as you can server side and exposing as much as you can client side as that is something cheaters can't game.

Re:Never trust the client by cataflam on Thursday April 28, 2016 @05:50PM (#11592165)
An aim bot doesn't have to play all the game for you, it doesn't need to think. I don't know how it is currently as I haven't played FPS games in a while, but back in the day, there were aim bots that would just activate when a target is in sight and take over, aim and shoot.
Re:Never trust the client by ultramancool on Friday April 29, 2016 @12:05PM (#11596601)
Yeah, modern aimbots are a lot more advanced than that. Mostly in that they'll know when someone's anywhere visible to you and they'll aim straight at their head.

This sort of behavior becomes impossible. If they have to aim in a fairly human manner, they can still be killed by anyone walking up behind them for example. It may provide some bit of unfair advantage. But not nearly as much as is possible in many games today.

Re:Never trust the client by bcook on Thursday April 28, 2016 @01:41AM (#11586741)
World of Tanks is exponentially less reliant on latency than an FPS, right?

Honestly, I immediately smell naivete BS when someone says "the solution is simple"...

Re:Never trust the client by chris_wot on Thursday April 28, 2016 @02:09AM (#11586820)
It might be naive, but then again I don't think games development has ever been easy. I'm constantly amazed by the skills of games devs, they just seem to surpass anything done for business applications.

If a company wants to attract competitive gamers, then they have to develop games you can't cheat in during competitions. Right now, the most reliable way of doing so is server side, with all the challenges that entails. Otherwise, they have to install what essentially amounts to rootkits - which isn't exactly what most gamers want to encourage.

Re:Never trust the client by ultramancool on Thursday April 28, 2016 @12:44AM (#11586597)
Yeah and modern cheat software is doing the same. A friend of mine recently used a Battlefield 4 cheat which required a boot loader entry so it could bypass kernel patch protection and get hooks in which the anticheat couldn't detect.
Re:Never trust the client by eru on Wednesday April 27, 2016 @11:12PM (#11586347)
How does the server know you are running the anti-cheat software, and not your own fake?

(Alternatively, run game in VM? I guess performance would suffer too much with that approach?)

Re:Never trust the client by ultramancool on Thursday April 28, 2016 @12:50AM (#11586612)
Running the game in a vm is actually completely possible using Vt-d to forward the GPU these days.
Re:Never trust the client by Cyph0n on Wednesday April 27, 2016 @05:03PM (#11584538)
I'm really interested in game hacking. Do you have a link for the video/talk?
Re:Never trust the client by kaoD on Wednesday April 27, 2016 @05:59PM (#11584926)
I used to visit Game Deception, the best game hacking technical forum. Unfortunately it closed.

I lost interest in game RE a long time ago, but http://www.unknowncheats.me/ seems to be its successor, though from a cursory glance I see there are a lot more cheats and less technical information.

GD we miss you.

Re:Never trust the client by blahkins on Thursday April 28, 2016 @12:20AM (#11586539)
I used to frequent http://aimbots.net/ when I was younger. Its a forum dedicated to mostly open source cheats so there is a whole discussion thread with sources and RE strategies.
Re:Never trust the client by grimmfang on Wednesday April 27, 2016 @05:29PM (#11584714)
Don't forget the incident where Punk Buster banned anyone with a certain string in memory...
Re:Never trust the client by sdwisely on Thursday April 28, 2016 @03:00PM (#11591151)
I remember it unfortunately being timed around the same time an exploit string would cause one of the AV packages to drop connections.

Made gaming IRC channels utter chaos for weeks.

Re:Never trust the client by 746F7475 on Thursday April 28, 2016 @01:06AM (#11586654)
I would love to play around with "botting" in some games, but I just don't even know where to begin. I tried to create super naive autoplayer years ago in C# by trying to just send keyboard keys into games, but most games didn't even receive the inputs.
Re:Never trust the client by jmnicolas on Thursday April 28, 2016 @08:22AM (#11588236)
If you're ready to throw a bit of money at it (and you're playing on Windows) I'd recommend having a look at Innerspace from Lavishsoftware.

I used that to bot on WOW back in the day, this tool was fabulous and can be adapted to probably any game. Knowledge of C++ is required to create an extension, after that you can code your bot in C# or Lavishcript (their own script language, quite powerful).

Re:Never trust the client by 746F7475 on Thursday April 28, 2016 @11:49PM (#11593658)
Yeah, I'm not really willing to put up with monthly costs for this, but thanks for recommendation
Re:Never trust the client by kybernetikos on Thursday April 28, 2016 @04:10AM (#11587191)
> "Never trust the client" is good advice for every kind of application. Clients are filthy liars.

It's true that you can't trust clients not to lie. However, in some situations, it's the correct decision to accept a constrained number of lies if that brings you benefits.

Like so many other absolute statements in software, in reality it's a trade off, and you need to consider the business context to make the right decision.

Re:Never trust the client by golergka on Wednesday April 27, 2016 @06:50PM (#11585233)
Not every.

Right now I'm working on an app where we trust the client. We know that a hacker can compromise a client and send any kind of bogus data, we're just completely OK with it from business perspective.

Re:Never trust the client by andyburke on Wednesday April 27, 2016 @08:23PM (#11585747)
Can you give any more insight into this product? Curious what kind of product would have that be ok from a business perspective...
Re:Never trust the client by golergka on Thursday April 28, 2016 @03:37AM (#11587086)
Eye training app with server creating parameters of the next training session (based on the whole training history and some data analysis magic). If you want to get a training seasion that doesn't fir your real results — go ahead, we don't care.
Re:Never trust the client by bluejekyll on Wednesday April 27, 2016 @11:09PM (#11586337)
What I'm trying to figure out isn't the business option where it's ok, but the business where you actively are avoiding doing it.

I mean why not just do it the right way?

Re:Never trust the client by Ogre on Thursday April 28, 2016 @12:47AM (#11586607)
You can handle orders of magnitude more users with the same hardware if you don't have to run the game simulation on the server.
Re:Never trust the client by cmdrfred on Wednesday April 27, 2016 @09:12PM (#11585939)
Closed network with locked down terminals?
Re:Never trust the client by ksk on Wednesday April 27, 2016 @03:50PM (#11583915)
With caveats.

What you're also implying is that clients should do no processing - because clients can't be trusted to do anything. If you apply this logic to web-browsing, you're asking the server to send the client a bitmap image of what the rendered page should look like.

Re:Never trust the client by cortesoft on Wednesday April 27, 2016 @04:19PM (#11584169)
I think that is misinterpreting what the person you are replying to is saying.

They aren't saying "don't let the clients do anything", they are saying "don't trust the values the clients send back"

If the client messes up the rendering, the only person affected is the client. There is no 'trust' required, because you are not relying on anything the client has done.

The idea of trust only comes into play if there is a consequence to that trust being broken.

Re:Never trust the client by brightball on Wednesday April 27, 2016 @05:28PM (#11584710)
Exactly. The nuance of every discussion is critical.

When somebody says "Never trust the client" inevitably somebody will find a use case that sounds like trust even though it's not what they're saying here and use that as justification.

The lack of nuance is how things like "never use stored procedures" gain traction when they shouldn't.

Re:Never trust the client by wolfgke on Wednesday April 27, 2016 @08:53PM (#11585871)
> If the client messes up the rendering, the only person affected is the client.

No, just google "wallhack".

Re:Never trust the client by Zergy on Wednesday April 27, 2016 @10:44PM (#11586274)
Arguably the client was trusted with information that was not needed.
Re:Never trust the client by eru on Wednesday April 27, 2016 @11:13PM (#11586353)
Alas, performance trade-offs might make this mandatory.
Re:Never trust the client by ksk on Wednesday April 27, 2016 @04:45PM (#11584382)
Well, a bank website would want to use this to make sure nobody MITMs them, or that the client does not have malware, etc - which would affect the user.
Re:Never trust the client by Pitarou on Wednesday April 27, 2016 @05:40PM (#11584800)
MITM isn't really relevant for the purposes of this discussion. We're talking about a different application with different threat models.
Re:Never trust the client by stefs on Wednesday April 27, 2016 @07:38PM (#11585501)
nah, a better example involving a bank would be: you have two accounts. the client can do transactions.

the server sends to the client: account A has $100, account B has $200, make your transaction.

1. trusted client

    client says: i've done my transaction, now account A has $50 and account B has $250.

    the server updates the database accordingly.
2. never trust the client

    client says: i want to do a transaction from account A to account B with 50$.

    the server decreases account A by 50$ and increases account B by $50 and updates the database accordingly.
3. the difference is, with the trusted client model, the client could be hacked and respond with:

    client says: i've done my transaction, now account A has $52 and account B has $252.

    the server updates the database accordingly.

congratulations, you - as the bank operator - have now lost $4 to the hacker and this is practically what happens with in the division (except that the other players have to pay for it instead of the bank/ubi soft).

they try to do server checks to prevent this, but due to network timing problems they can't check the exact values, only calculate if this is maybe approximately right.

so a players maximum running speed is, say, 6m/s. they could do periodical checks (every second) if the player moved more than 6m since the last second. but what if the player falls down a building or is thrown by an explosion further than that? it'd register as cheating, even though it's completely legal to jump off a building. so they have to increase the checks for distance/s by 3 to allow those situation (i.e. 18m/s). a cheater with a modified client can now continually run three times as fast as any other player without getting flagged as a cheater.

why do they do this? because it's

a) easier to implement (the client has to do all the computations anyway - doing them a second time on the server and then sending back to the client isn't an easy problem - you have to interpolate) and

b) cheaper (less work = less man hours, less complicated work = cheaper programmers* and less server power needed)

* i'm completely sure the devs would have been 100% able to do it right, but it would have taken them longer, thus costing more.

so, how to fix it? there's only one way: rewrite the model. but this is expensive and the titles have already been sold, so why bother investing another couple hundred thousand bucks? even the disgruntled gamers will buy the next ubi soft title if it's shiny enough. i mean, few people will buy the game now that multiplayer is infected with cheaters but they already exploited enough of the market and long time players are probably less likely to buy the next title if they're still playing an old one. maybe.

Re:Never trust the client by JoshTriplett on Wednesday April 27, 2016 @04:13PM (#11584120)
Not at all. It's fine for the client to handle processing when the only thing they could hurt is the user of the client. If the client renders a web page incorrectly, only the user of the client gets hurt by that. But the server API must not allow a malicious client to do damage that affects other clients.
Re:Never trust the client by abraae on Wednesday April 27, 2016 @04:14PM (#11584124)
Your example is about the client misreporting server state to the end user.

The big deal is instead about a badly behaved client being able to make "illegal" changes to the server state.