start	end	text
0	260	All right.
260	1380	Thank you all for coming.
1740	5460	This is what game hacking teaches us about offensive security and red teaming.
6100	8900	We'll be talking about game hacking.
8900	11300	This is for the game hacking village for DEF CON 33.
12160	15320	So first of all, a disclaimer.
15640	19560	I don't condone cheating in games, especially not online or competitive games.
19560	21280	I think cheating is really unfair.
21280	25260	But I think what game hacking teaches you is really interesting.
25260	29020	It's really technically deep and it has a lot of parallels, especially with malware.
29700	33000	And that's a little bit about what we will be talking about today.
34280	35560	And, yeah, cheaters.
37060	39060	Cheaters are usually bad at the game.
39060	40320	It's a skill issue.
40320	41100	Get good.
43600	45220	So a little bit about myself.
45260	47500	My day job, I'm a security researcher.
47540	51620	I primarily look at mobile applications and do application security in that way.
51900	55480	I've done a variety of different security things as well.
55480	63300	So not just mobile applications, but growing up, did a lot of CTFs and things and do API security and back end security and many different things.
64480	66380	In college, I worked in a malware lab.
66380	68420	So I have a little bit of experience in malware.
68880	73460	And that's kind of where the intersection of this comes in on this talk.
74300	77300	And then, yeah, I really enjoyed playing competitive games.
77900	87380	Growing up, legitimately, I think you learn a lot from learning how to get good at a game.
87560	91720	And cheating is just ‑‑ it ruins the fun of it, I think.
91720	93540	And it's really frustrating to play against.
94220	99920	So this talk, we're going to be talking about what game hacking is and then we're going to talk about different types of cheats.
104660	106640	We'll talk about ways in which they can be detected.
106780	108600	Sorry, I don't have my notes in front of me.
108600	110560	So I have to keep looking at my phone here.
111740	113300	So what is game hacking?
113340	114960	Game hacking is not just game cheating.
114960	117260	There's a variety of things that game hacking includes.
117640	118780	And that could be modding.
118800	120860	It could be speed running.
120860	123060	They often abuse the way that the game is in there.
123060	126380	So it's a broad definition of what we're including in game hacking here.
127680	129260	Reverse engineering is a part of it.
129260	135360	And that's part of, like, what may be done for, like, game preservation, modding and things like that.
135360	136640	And, yes, finally, cheating.
136960	141500	That's part of what we talk about with game hacking and also what we're going to be talking about primarily in this talk.
141640	142960	So game cheating.
144160	147140	If you've seen cheats before, they kind of look like this.
147140	148620	You have three different games here.
149500	151000	Counterstrike is at the top right.
151000	152520	At the bottom right, we have Fortnite.
152520	155440	And at the bottom left, we have Escape from Tarkov.
155780	157100	These are all FPS games.
157100	164340	In FPS games, I feel like cheating is one of the biggest problems because it has a much higher skill ceiling to it.
164340	171040	So a little bit of information goes a really long way in these sorts of games, especially Escape from Tarkov, where it's a really hardcore game.
171780	177300	And cheats can include things like aim hacks and wall hacks and radar hacks that tell you where players are.
177800	186080	Those are kind of like the read-only type ones versus ones that write, which is like aim hacks, where it can, like, modify where your crosshair is and shoot the person for you.
187140	192660	And then just zooming in on one of them, the actual game doesn't have any borders around these players.
192720	196500	The cheat is adding the borders around the players so that you know where they are through the wall.
196500	199260	And that's a classic wall hack or also known as ESP.
201920	205240	So game hacking is kind of in two pieces.
205240	208440	One of them is the software and one of them is how you actually run the cheats.
209040	214320	And this screen shot here is a really thorough game hack.
214680	216080	It's about 30,000 lines of code.
216080	217240	It's for Counterstrike.
217320	225440	And it includes all the hacks that we talked about, customizations, configurations, you can change the color, you can modify your in-game skins and aesthetics and things like that.
227120	229660	And it's just a normal piece of software.
229660	231300	It's basically a mod for the game.
232020	234640	So there's, as I was saying, there's two parts for the cheat.
234640	238500	There's the actual cheat itself, the software, but then there's how you run the cheat and install it.
238500	240560	And that's what I find most interesting.
240560	242880	It's not just how you do the spin bots and things like that.
242880	245140	It's more or less the same for each game.
245160	250860	The real difficult part is how you create a cheat that's hard to be detected and hard to be evaded.
250860	252860	And that's the part that's constantly changing.
253640	257020	The part that's not constantly changing is the spin bots and hacks.
257020	258560	Those have been around a long time.
258560	260700	It's how you install those and run those.
260860	262480	So there's two types of cheats.
262480	264280	There's internal and external cheats.
264900	268300	An internal cheat is one that's basically like a mod for the game.
268360	277180	You load your code into the game and it becomes kind of part of the game as long as the game is running and your cheat goes away and it just is part of it.
277180	279860	You're installing it basically in active memory.
280060	283720	Versus an external cheat is one that's interacted with indirectly.
283960	288260	Now that could be from a hardware device, which is the most common external cheat nowadays.
288340	298500	Or if you've used something like cheat engine before, cheat engine is an external cheat that is a separate process that interacts with the game to make changes to it and read and write memory.
301500	306500	Yeah, so getting into the details of it, an internal cheat shown here, we have a cheat loader.
306500	313060	So two components, a cheat, the code that we looked at earlier in that screen shot, we'll reference back a couple times to or I'll reference to it.
313420	315460	And then your software, that's the cheat loader.
315460	318020	So the cheat loader is responsible for putting your cheat into the game.
318020	320560	So you want your cheats in the game, you need to load them.
320740	322240	And that's with an internal cheat.
322500	336600	So a little bit more of a technical diagram, you have your cheats in your process and you're trying to load it into the game process and then after that your cheat process goes away and your game is now pretty much modded with that.
340620	342520	And then next we have ‑‑ oh, yes.
343160	349020	So if you're familiar with malware, you might look at this and be like this is kind of like process migration.
349500	352080	So this is the first comparison we're drawing to some malware.
352240	355560	Process migration is a way in which malware moves from one process to another.
355560	373780	So if you are running maybe an exploit on like a vulnerable Microsoft SharePoint server, that was in recent news, and you start exiting your malicious code, you want to probably hide on a more stable process, one that's not going to be updated soon and one that's maybe a little bit longer running.
374000	381100	So you attach to some of the process on the system and move your code under there so that you don't have to run your own process.
381100	383720	Instead you hide under the guise of another process.
383880	385960	And that's pretty much the same thing cheats are doing.
385960	388380	We're hiding under another process.
391100	395620	Yeah, so now bring that to malware still.
396000	401040	Here we have Clippy being infected with some malware and evil Clippy.
402900	405340	I mean, he could be a little bit stoned, too.
407460	412120	So the point is cheats use the same techniques as malware and they have many of the same characteristics.
412700	413800	Stealth is a goal.
413800	417940	Malware is trying to hide from anti-malware or like enterprise EDRs.
419080	421160	They're technically sophisticated.
421160	429680	So the ‑‑ because it's a cat and mouse game, the techniques you have to evolve have gotten more and more advanced and they build on top of each other.
429680	442960	So you're adding levels of obfuscation on top of different techniques that you're combining in various ways and you're using undocumented APIs and just doing things that are just barely possible to try and avoid detection and do something unique.
443460	456340	You're avoiding ‑‑ yeah, you're obfuscating it, as I said, and you're also employing oftentimes anti‑debugging and anti‑analysis and anti‑debugging.
456340	460180	So cheat developers, they're selling a product.
460180	464980	They don't want other cheat ‑‑ they don't want people using their product for free.
464980	467800	They don't want the game developer figuring out how their product works.
468020	469320	Malware doesn't want to be detected.
469320	476660	They don't want malware analysts spending their time looking at it and they're going to waste a lot of their time by adding these mechanisms in there.
478400	480200	So we're going to go to external cheats now.
480200	482300	We were talking about internal cheats before.
482740	488120	An external cheat is one that's in a separate process or in a separate area outside of the game itself.
488120	490360	We'll talk about how it's not always a process.
492460	502980	And in this case, we have ‑‑ this is most similar to cheat engine if you've used that where you have another process that's directly interacting with your game and making changes to the memory, reading and writing to it.
503620	505920	Notably, they both exist at the same time.
506140	511660	So when your cheat disappears, all the code for it disappears and the game remains strictly intact.
512560	517440	Where this is most useful ‑‑ okay, sorry, we're drawing another comparison to some malware.
517480	521140	So if you have done red teaming before, you've probably heard of Mimikatz.
521280	529560	Mimikatz is a program that employs pretty much this external cheat kind of concept to Windows.
529560	546920	So Mimikatz is a tool that pulls passwords from the LSS process on Windows which is responsible for logins and it does so by pretty much externally asking Windows to access the memory of that process and read out values in it.
547420	548960	Nowadays this is prevented.
549280	555040	Microsoft has smartened up to this technique to improve their operating system security by making it so that you can't just do this.
555220	558500	But it's only protecting, like, system processes and such.
558500	569300	And there are ways in which you can run your game in a similar manner where it's a lot harder to just directly read values from it and then there are more ways to go and bypass it as we'll find out.
569960	573220	So they're not so different after all.
573640	581200	They use the same Windows APIs that malicious applications use, cheats and malware.
581820	583660	And these are all APIs provided by Windows.
583660	587940	So it's not weird to be able to open another process and read and write memory.
587940	591120	Those are provided functions of the operating system.
591540	597260	There are sometimes legitimate uses for it, although these are most often abused by processes.
597380	602480	So just malware and cheats abuse the same kind of legitimate, otherwise legitimate functions.
603580	604820	As that says, yeah.
604820	613220	And then, yeah, there are products that are created such as EDRs and anti-malware to make it more difficult to abuse the API.
613220	620560	So they'll monitor these uses of the API and try and find malware using it.
621740	628800	So another part of external hacking that we talked about is direct memory access.
628800	643160	So one of the reasons it's really hard to detect cheaters in games is because you can spend a lot of money and have an external hardware device that will allow you to read the game memory and do so in a mostly undetected manner.
644040	647500	Right here we have, this is called a screaming squirrel.
647740	653240	So it's a PCI device that plugs into your computer next to your graphics card or below it on the same line.
653240	657280	So if you built your own computer before, you've probably seen that.
657500	658820	And you can plug in here.
658820	660960	And then on here you have USBCs.
660960	662780	So you will plug this into your computer.
664280	666700	And then you will plug another computer into this card.
667060	672040	And now this computer can go into this card and then access the memory of your main computer.
675420	678600	So you will then implement your hacks on the external computer.
678600	681460	And the only thing this computer can see is whether or not you plug this card in.
681500	687500	And this card is going to pretend that it's a Wi‑Fi card or Bluetooth card or whatever else or just like a USBC thing.
687500	689980	It's not going to say, hey, I'm an external cheat thing.
691460	693160	So now how do you implement the hacks?
693160	694460	Because now you're on a different computer.
695160	698080	So you'll have your computer plugged in normally like this.
699300	706440	But when you want to have a way to display like where enemies are, you're going to use what's called a fuser.
706440	713200	So now that you're able to read all the memory from the computer, you'll set up your cheat in a way where you can figure out where the players are on the map.
713240	731860	And there's an API that's provided for the screen and scroll that will allow you to read the process memory of a game and then you implement your cheats to tell it where to find the player locations and such and then you go and write more code to render that out onto a screen.
731900	737920	So it will be like the outlines of the characters and then put that over a black screen.
738160	746480	You then instead of having your computer plugged in directly, you're now plugged into this fuser and it will combine those two inputs and then output to your screen.
746480	757440	So if you're a streamer, if you were to be recording your game play, it would be recording the output of your graphics card, which is completely legitimate and will not be seen at all.
758000	760700	And once it goes through the fuser, that's all outside the computer.
760700	761800	That can't be seen by the computer.
761800	762740	It can't be detected.
762880	765320	And again, if you're a streamer, that's not shown at all.
766740	768680	Then we need a way to do inputs as well.
768680	773700	So the way we do inputs is you could directly write to the memory.
773700	777340	So you could just have the game change the location of where your crosshair is pointing and such.
777340	780960	But it's a little bit more stealthy to do so another way.
781160	785380	You take your mouse and you plug it into a ‑‑ this is, I think, an actual product.
785560	793820	But you take your mouse and you plug it into a box and then the box can make corrections at the last minute to change your mouse input just enough.
794180	797120	And then, again, all the computer sees is that you're just using a mouse .
797120	803700	So the computer sees that you're using some Bluetooth device, in quotes, and just a regular mouse.
803700	806520	And how are you going to detect that, really?
806920	809700	That's one part that's a little bit different.
811160	814820	That's one part ‑‑ okay.
822090	823650	Would this work better?
823730	824370	Okay.
825370	827950	Yeah, that's one part that's a little bit different than malware.
828350	834370	Malware, you're usually accessing a remote computer rather than a computer that's like you have physical access to.
834370	842750	So that's why cheating is a lot harder of a problem to solve because you have physical access to the computer and with that, there's a lot more that you can do.
845410	853370	So we've talked about different types of cheats and how malware relates to them and also how it's really hard to detect cheating.
1036180	1041640	This injection technique and then we also talked about the hardware device and how it's really hard to detect cheats.
1042640	1047780	We talked about anti‑cheats and EDRs and kind of how they relate to each other and have a similar mission.
1048640	1051260	And then the last part is some red teamer takeaways.
1051360	1065900	So because game hacking is so similar, I've talked to a lot of people in offense security and some red teamers as well that are doing more technical things that have used anti‑cheat forms to learn a lot about the game ‑‑ sorry, to learn a lot about the Windows API.
1067640	1079860	And because it's ‑‑ even though they're like cheater forms and hacker forms, they have very well‑written, well‑structured examples, comments and threads of people asking for more information and such.
1080020	1081940	So it's actually really well‑documented code.
1082540	1086720	They are employing the same kinds of things that malware is.
1086720	1088880	So different tooling exists.
1089320	1091840	Not all of that might be used by malware at the moment.
1091840	1093920	So there might be new techniques that game cheaters create.
1093920	1095680	I think it kind of goes both ways.
1095740	1102720	Malware developers will create new techniques and cheaters will use it and cheaters I think sometimes create new techniques as well that malware is later used.
1102720	1104520	I think there are examples of that.
1105540	1111920	So to answer the question of my talk is what can game hacking teach us about offensive security and red teaming?
1112000	1117200	I think they are just two different sides of the same coin and they can teach you pretty much the same.
1117200	1118460	So thank you.
1130430	1132570	So we've got some time for questions.
1139240	1140160	Yes?
1151010	1157530	So, yeah, the question was talk about kernel anti‑cheats a little bit and is it actually necessary?
1157890	1161530	As my ‑‑ like as a gamer kind of I would say yes.
1161870	1167890	There is kind of a dispute of is ‑‑ so this is like a controversial topic both for EDRs as well.
1167930	1176950	But, yeah, there is a ‑‑ some controversy over whether or not it's fair to have kernel level anti‑cheats because it's basically full access to your system.
1177250	1186430	I'd say that even like admin level access anti‑cheats have a similar level of access to all the files and privacy things that you would be concerned about.
1186790	1196230	For games specifically the only way I think there is even a chance to detect cheaters besides like AI and some things like that is to have a kernel anti‑cheat.
1196530	1199070	Now, whether or not you trust it, it's up to you.
1199070	1210890	Me personally I have a personal on that computer and I use it just for gaming just because you're running software from different game developers, different countries and such.
1211210	1212650	Does that kind of answer your question?
1214210	1215110	Green shirt?
1223680	1226900	So was the question do you think cheaters move faster?
1230400	1233460	Oh, like who is ahead in terms of offense or defense?
1233580	1239100	I think offense kind of leads the way because defense is always reacting to the latest offense.
1244100	1245180	That's a hard question.
1245180	1249740	That's one I wanted to research more is to understand who is borrowing more techniques from the other.
1250420	1256540	I think there's similar incentives on both sides for cheating and malware that are profit driven to come up with new techniques.
1256960	1261280	I don't have a good answer for who is better there.
1262120	1263340	But I like the question.
1269130	1269930	Yeah.
1271930	1278510	So is there an anti‑cheat for the way that you can kind of combine the displays and show it on the monitor?
1278790	1288690	No, because the only way is to detect it or to detect the actual plugs into the computer because there's nothing really happening on the computer itself besides the hardware devices plugged into it.
1288690	1298650	So the only way like in that manner to detect it is to detect like anomalous mouse movements maybe with AI and there are some projects with that or to detect the card.
1304340	1305420	For the cards?
1318580	1322810	Or at least report it back.
1322810	1323750	Yeah, that's a good point.
1323810	1329890	There would be, I guess, a little bit of information sent over HDMI about what you're connecting to.
1329890	1330790	Yeah.
1332050	1333590	I didn't think about that.
1360790	1363050	Is that like an anti‑cheat?
1368410	1369990	Oh, yeah.
1369990	1389090	So yeah, I think with remote, that would be one of the ways I think I could see you making it a little bit more secure of a competitive environment by using things like Stadia or where you have to kind of connect it into an external computer that you no longer have physical access and is a little bit more federated.
1389810	1393270	And you will be playing with latency but I think you can play in a more secure environment.
1393270	1394370	Is that sort of what you're asking?
1394610	1397990	Yeah, I'd like to see that for more competitive games.
1397990	1401430	It's just kind of a matter of is the networking going to be responsive enough?
1402530	1402890	Yeah.
1403970	1404770	Black shirt?
1411650	1425230	Yeah, well, so cheats are very profit motivated and game developers have much less resources and time I think compared to the cheaters and the cheaters have much more incentive to have a working product and subscription.
1426770	1428810	Cheating is a multi‑billion dollar industry.
1428810	1437310	There's been examples of cheating rings that have been shut down in like China that have had hundreds of millions of dollars that they've made from cheating.
1437810	1444730	And it's a way for anyone in the world to make money by selling basically technical capabilities to people that are willing to pay.
1444830	1454870	So I think just because there's so much profit and incentive to it, it makes it very hard for the game developer to go against basically the world as a small, sometimes a small company.
1455570	1464130	And then the off the shelf anti‑cheat solutions are common enough that you build one bypass for it on some other game and you apply that to the new game that just comes out.
1479150	1482750	I mean, so if it's a mod , it might be more friendly with the developers.
1482750	1490110	They might advertise in some way to the developer or the server that a mod is there or disable it because they want to be in good will with the developer to have their mod.
1490850	1495630	If you're not trying to be stealthy, then like it's much easier to detect it.
1499080	1499920	Yeah.
1509060	1512280	So the
1518440	1527140	question is what does secure boot do to prevent cheating on ‑‑ what does an anti‑cheat requiring secure boot do?
1527360	1537480	Because anti‑cheats are loaded nowadays at the kernel, the way to defeat that besides the hardware hacking and stuff is to kind of load before the anti‑cheat in the kernel itself.
1537900	1549860	And the way secure boot ‑‑ running secure boot would allow you to have a full chain of trust from basically your BIOS to the operating system to the anti‑cheat to make sure that nothing was loaded in between that.
1572620	1577220	I mean, there are a lot of similarities and there's a lot of actions malware takes.
1577680	1582600	I kind of keyed in on the process injection pieces of it because that's a common way for malware to use it.
1583880	1589280	And the similarities of trying to avoid detection and obfuscate your code and stuff like that.
1590840	1612260	I think also the outline of how you have ‑‑ like malware is also going to be kind of two pieces much like the cheats are where it's like your information stealer or in contrast to the game cheats, you have the actual development of that and then you have like your stealthy mechanisms and how you're running on the system and how you're doing things in a weird way to not get detected.
1612320	1615340	That's the similarities that I'm keying in on there.
1630880	1637540	The main one I keyed in on was the hardware, like basically the ‑‑ yeah, hardware being different for cheats.
1637540	1644720	I actually don't have as much to say about the differences between them.
1645480	1646160	Yeah.
1646160	1647480	That was a good question.
1649220	1650260	Yes?
1650260	1650820	Are we out of time?
1650820	1651620	Five minutes?
1651620	1652060	Okay.
1652060	1653300	Any other questions?
1654480	1655340	Yes?
1670240	1673640	That would be kind of like closer to game exploitation in a way.
1674320	1678180	So like if it's on a multiplayer game and you're connected from two different locations.
1679060	1680000	Is that what you're saying ?
1682120	1682920	Yeah.
1687560	1696880	I mean, if you're talking about like kind of the Xbox live, like DDOS and someone else's network and take them down, I mean, that's not really game hacking, I guess.
1696880	1704160	But if it is like an exploit that's through the game server, like you can find a way to send a bunch of data to the game server that sends it to the client and crashes them out.
1704160	1705660	That would be more like a game exploit.
1705660	1708620	It would be a way to like denial of service another player on it.
1712150	1715450	Yeah, if you're just DDOSing someone, usually it's not within a game.
1715450	1721610	Although you might ‑‑ the vulnerability itself might be is the game server leaking the IP address of the users that you're playing with.
1721830	1724190	And that's very common in peer‑to‑peer.
1724190	1727830	It's kind of required for peer‑to‑peer type games.
1728370	1728950	Yeah.
1752630	1765090	I mean, the fact that anywhere in the world you can be creating cheats and the jurisdictions are very ‑‑ like legally it's very hard to prevent that.
1765090	1765990	If you're in the U.S.
1765990	1770950	and a lot of the game companies are in the U.S., then you can sue them and shut them down and use the legal system.
1770950	1772830	But there's no world legal system.
1772830	1775970	You have many ‑‑ you might not even know where the developers are out of.
1775970	1778170	The website can be kind of hosted anonymously.
1778590	1780510	So they could be anywhere.
1780510	1782450	It could be teams of cheaters from different countries.
1783590	1787690	I mean, if you look at malware, those operations are often hard to shut down and discover.
1788270	1793010	And that has the backing of multiple governments and law enforcement agencies in those governments.
1793390	1795850	It's not really a concern to shut down cheaters for the most part.
1802180	1802740	All right.
1802740	1803520	Thank you, guys.
