00:00:00.033,00:00:06.006 >>My name is Brad Dixon and I’m with Carve Systems and we’re talking today about uh cheating 00:00:06.006,00:00:11.011 in eSports. How to cheat at virtual cycling using USB hacks. So ya ah, I’m really talking 00:00:13.881,00:00:18.819 about bicycling and you might not think about bicycles as having a lot of technology in 00:00:18.819,00:00:22.556 them or maybe all the technologies in the manufacturing and materials. But 00:00:22.556,00:00:26.960 over the past few years um electronics and software have been creeping into the 00:00:26.960,00:00:31.865 components that that high end professional cyclists and and the really competitive amateurs 00:00:31.865,00:00:36.870 use. And wherever there’s software uh we know that there can be hacks. And and that 00:00:39.172,00:00:45.112 that’s cool, but I was kind of interested and and my and Mike Zussman, uh, is em ah my boss 00:00:45.112,00:00:50.350 over there is also interested in saying what can we do like more to cheat. Cause the cheating is 00:00:50.350,00:00:55.355 really kind of I’ll talk about it it’s like the most fun part of competitive cycling I think. 00:00:55.355,00:01:00.294 Um, and and just just so I don’t disappoint anybody, we we’re not talking about like these eSports 00:01:04.831,00:01:10.337 uh, so you know there’s there’s no great FortNight hints, no League of Legend hints uh and 00:01:10.337,00:01:14.007 and those are cool, what we’re talking about is something a little bit different. We’re 00:01:14.007,00:01:20.948 talking about the sweaty eSports. And so these are people who compete in eSports where the 00:01:20.948,00:01:26.219 performance of their avatar is driven by their physical performance in the real world. 00:01:26.219,00:01:31.224 They’re actually dropping sweat and doing work uh to win in these competitions or just for 00:01:35.062,00:01:41.702 exercise. But there is something cool about this. Unlike other eSports, virtual cycling is part 00:01:41.702,00:01:46.807 of the greater of cycling. Uh so just a little back story for you, there’s a group called the 00:01:46.807,00:01:51.812 Union Cyclists International. And you- the UCI is the federation that governs all 00:01:54.147,00:02:00.354 cycling competitions. Whether it’s road biking or mountain biking or BMX or s- there’s some 00:02:00.354,00:02:07.227 very odd aruh- artistic bicycle competitions that I never knew about that people do. The UCI 00:02:07.227,00:02:13.200 sets all the rules for this. Um, and so they work with the international Olympic committee. 00:02:13.200,00:02:17.237 The International Olympic committee last year had a meeting which said we want to 00:02:17.237,00:02:23.644 start including eSports in the Olympic program somehow. So everybody came to this this 00:02:23.644,00:02:28.448 forum. Uh including all of the you know, all com- like the video game people. Like 00:02:28.448,00:02:32.652 FortNight, Legal Legends all that stuff and these weird little cycling people on the 00:02:32.652,00:02:37.324 side. So the internationalOlympic committee had one of these big meetings 00:02:37.324,00:02:42.129 you know and lots of food and wine and drinks for a week or something. Um, but out of this 00:02:42.129,00:02:46.800 they came out saying, yes, we really do want to include eSports in future Olympic 00:02:46.800,00:02:51.805 programs, but there’s a catch. And their catch was that they thought that that eSports then 00:02:53.874,00:03:00.547 involve you know killing, didn’t really sit with vibe of the Olympic movement. They’re not so 00:03:00.547,00:03:05.152 much into that. And so the virtual cycling people are really excited about this, 00:03:05.152,00:03:09.890 because they’re looking at it going, I don’t there’s like Wii bowling and then there’s us and 00:03:09.890,00:03:14.895 so virtual cycling is gonna you know maybe rank on up there. And I’m excited about this because 00:03:18.098,00:03:23.103 um, cyclists have the best cheaters. I mean they’re like seriously the best. They’re 00:03:25.705,00:03:30.710 absolutely the best. [applause] I I mean, Tom Brady should learn from these people. [laughter] I 00:03:34.247,00:03:39.953 had to get that in there. Sorry Tom. So so just a little history on here. So the Tour de France 00:03:39.953,00:03:45.459 got started in 1903 uh organized cycling in a co- as a competitive sport had only been 00:03:45.459,00:03:51.698 going on sin- like since like the mid 1890s. And this guy here not actually a mime, um, my 00:03:51.698,00:03:58.105 buddy Hippolyte here, uh he was racing in the first Tour de France really competitive and he 00:03:58.105,00:04:03.043 actually he had to drop out um, because because he had intestinal diress. But lately 00:04:05.045,00:04:12.052 investigations um, theorized that this was actually him, uh, he he received a a spiked bottle 00:04:12.052,00:04:18.391 of water from the other competitors. Uh and this kind of stuff went on. Um, the the guy 00:04:18.391,00:04:22.529 who made the Tour de France, little bit of a sadist. In his view, like the perfect Tour de 00:04:22.529,00:04:27.534 France uh which is a 21 day race, 2200 miles. The perfect Tour de France would have only 00:04:30.670,00:04:37.244 one finisher. Everybody else would drop out, die or quit. Um and and you know he never really 00:04:37.244,00:04:41.882 reached that goal thankfully, but the competitors even in the early days, they would inject 00:04:41.882,00:04:46.553 their muscles with strychnine just to deaden them. So they could take more pain, more 00:04:46.553,00:04:52.259 suffering and make it up that hill. Um, but don’t worry about Hippolyte. Hippolyte learns 00:04:52.259,00:04:57.931 really fast, he comes back the next year and he put together this this scheme where uh, put a 00:04:57.931,00:05:03.670 cork in his mouth, had a rope and the rope was connected to a car and that car would tow him 00:05:03.670,00:05:08.875 up the hills and it would have worked, but Hippolyte finished just after the race officials 00:05:08.875,00:05:15.048 got to the end of the course, uh to setup for the finish and Hippolyte comes flying in and 00:05:15.048,00:05:20.854 they disagreed with that. Um, this guy Maurice Garin, he he kind of like upped the Keystone 00:05:20.854,00:05:25.859 cops level here. He uh, he had itching powders stuck in his rivals shorts uh he sabotaged 00:05:28.261,00:05:33.266 bikes of his rivals. Um, he he actually had a part of the course where he took a train to 00:05:36.403,00:05:41.107 just just skip past all these other riders. Uh and picked up from there, then had all of his 00:05:41.107,00:05:47.447 supporters spread broken glass uh in front in front of them. Uh very creative. And and then, you 00:05:47.447,00:05:52.919 know in the more modern era, this guy Jean Robic, uh he would have this scheme where he’d ride 00:05:52.919,00:05:55.622 to the top of the hills and just before the dissent, uh his his um, support crew would hand him 00:05:55.622,00:05:57.624 new water bottles and he’d stuff them in his bike and these water bottles were filled with lead 00:05:57.624,00:05:59.626 just to make it go faster down the hill. But the funny thing about this is that at the time, 00:05:59.626,00:06:01.561 this actually wasn’t illegal, you you could do this. He was fine. But in the modern era, 00:06:01.561,00:06:04.264 cheating has has continued uh and has this 100 year history, it’s gotten more technical. Um, 00:06:04.264,00:06:06.266 in in uh 2016, we had a rider that was uh uh and not a competitor rider, just just a 00:06:06.266,00:06:11.271 rider, uh ejected from a race for actually have a motor in the seat post of the bike. Uh and uh 00:06:37.230,00:06:41.334 in 60 minutes did a program all about this it it’s actually quite fascinating if you want to 00:06:41.334,00:06:46.773 go find that. And then there’s this guy, if you know one cyclist, you probably know this 00:06:46.773,00:06:51.778 guy. Lance Armstrong. Famous slash infamous for being a 7 time winner and cheater of the 00:06:54.714,00:07:00.453 Tour de France. Um and and he put together not just like he didn’t just dope himself. He had 00:07:00.453,00:07:06.293 like an entire mob that was responsible for getting him the material. Doping the teams, I 00:07:06.293,00:07:12.232 mean it was quite a it was quite a production. But it wasn’t just him, um, he won 7 years, there 00:07:12.232,00:07:17.237 were 21 podium finishers of the Tour de France in those 7 years. And of those 21, 20 uh were 00:07:20.006,00:07:25.211 later uh discovered to have been doping through either their own ommissions, sanctions from 00:07:25.211,00:07:30.216 investigations or um, or other erroneous or suspect test results. So 20 out of the 21. Uh 00:07:34.287,00:07:38.892 they actually didn’t award those uh those years to anybody. Just like nobody won those years. 00:07:38.892,00:07:45.665 They were all, all doping. So we started looking at virtually cycling and we were like 00:07:45.665,00:07:51.137 nobody’s going to cheat on this ‘cause like it’s a video game, right? Um, but you know as 00:07:51.137,00:07:57.310 people have started to have for money competitions uh in virtual cycling. I I found this noted 00:07:57.310,00:08:02.849 internet expert who said things that that this is such a big sport, you know, lots of money 00:08:02.849,00:08:07.854 on the line, it’ll sure to happen. Um. So how does virtual cycling work? So it’s a game put 00:08:13.460,00:08:18.832 together with um, a couple of sensors. It’s just like any other like large multi-player 00:08:18.832,00:08:23.636 online game. But these sensors measure the athlete’s real performance. There’s another 00:08:23.636,00:08:28.742 aspect to it that um, the rider sits on what’s called a trainer. And let me see if I can get my 00:08:28.742,00:08:33.747 video going here. So the rider sits on a trainer and they take the wheel of their bike off, 00:08:37.650,00:08:42.422 mount it on the trainer. The trainer does two things, it measures their power and then it 00:08:42.422,00:08:48.294 also offers resistance. And the resistance is what you know, makes the work happen, right? 00:08:48.294,00:08:53.767 Uh, typically the trainer also measures cadence. How quickly the pedals are turning over. And 00:08:53.767,00:08:57.971 it, then they’ll wear a heart rate monitor to measure that aspect of their performance. All 00:08:57.971,00:09:04.210 of this feeds into the game. And from that the games have a speed estimation model. It’s based on 00:09:04.210,00:09:09.482 a few things. It’s really pretty simple. There’s a terrain model for the course. Right. When the 00:09:09.482,00:09:14.120 course goes up hill, the game increases the resistance of the trainer so you have to work 00:09:14.120,00:09:19.059 harder and and of course that elevation change, the slope of that feeds into the speed 00:09:19.059,00:09:25.098 estimation. Uh your power is an input to it. Two other things are controlled by the, by the 00:09:25.098,00:09:30.737 game player. There’s the rider mass, you just type that in and your height. Now mass is pretty 00:09:30.737,00:09:35.308 obvious, the lighter you are, give the same power, the faster you go and the faster you’ll go 00:09:35.308,00:09:40.313 up hills especially. Um, drafting though is what the uh, the height plays into. Drafting 00:09:42.549,00:09:47.720 is not just like a little thing in cycling. It’s like, the thing. Um, that, it’s a big part 00:09:47.720,00:09:53.359 of strategy and how riders and teams ride in competitions. And so they’ve emulated this in in 00:09:53.359,00:09:59.499 the game as well. And your height goes into that. And um, the the games aren’t really 00:09:59.499,00:10:05.205 clear about how it works, but there’s good evidence to show um that that if you’re a shorter 00:10:05.205,00:10:10.210 rider, drafting behind a taller rider. Then you’re going to get a drafting boost from that. So 00:10:14.080,00:10:20.153 the easy ways to cheat, um, are just to make yourself lighter and shorter in the game. Just 00:10:20.153,00:10:25.358 change that. A- and in fact there is a Reddit that pulled together a bunch of data how 00:10:25.358,00:10:30.363 often people change their or w- weight right before an online virtual cycling competition. And 00:10:32.832,00:10:38.505 there’s links to that uh on the website that you can go take a look at. Um, so there’s evidence 00:10:38.505,00:10:44.210 that people are doing that as well. But you can’t just use those to get maximum super 00:10:44.210,00:10:50.450 power. Um, there there are the bicycle police out there in the world of online cycling. Um, the 00:10:50.450,00:10:55.255 game that I used for this was something called ZWIFT. There’s others out there uh but ZWIFT is 00:10:55.255,00:11:01.861 definitely the most popular. And ZWIFT published some e-Racing guidelines. Um and written by 00:11:01.861,00:11:07.867 lawyers, um, really kind of interesting though, talking about um, performance limits. So 00:11:07.867,00:11:13.139 in ZWIFT performance is measured in watts per kilogram. The idea being you know if you’re taller, 00:11:13.139,00:11:18.144 bigger, stronger person, then you have more muscle. Uh and so your wattage output can increase 00:11:20.213,00:11:26.519 and it’s a watts per kilogram over a duration of time um, for example, if you exceed 5 watts 00:11:26.519,00:11:32.792 per kilogram over a 20 minute period. You’re gonna get flagged for uh potentially a follow up 00:11:32.792,00:11:38.531 investigation. If you exceed 20 watts per kilogram for a 5 second period like a sprinter 00:11:38.531,00:11:43.036 might do at the finish of a race, first of all you’re like super human, that’s like amazing 00:11:43.036,00:11:47.674 performance, but second of all the ZWIFT bicycle police are gonna come looking at you. 00:11:47.674,00:11:52.879 Potentially. And we’ll talk about potential ways you can cheat, given this performance 00:11:52.879,00:11:57.884 review board. So i chose to put together a hack so we could cheat at this game using the 00:12:01.588,00:12:06.593 sensor network. And the sensors are a 802 dot 15 dot 4 ish protocol um, called ANT plus. 00:12:10.029,00:12:16.436 That’s the RF link between the sensors and the USB dongle. Um, there’s optional encryption that 00:12:16.436,00:12:21.441 can be turned on in the ANT devices. Nobody turns that on so that wasn’t a problem. Um, but 00:12:24.010,00:12:28.281 we wanted to have a way to be able to influence these sensor readings directly. If I can 00:12:28.281,00:12:33.286 control the sensors, then I can control the game. And so the easiest is to to do this was the 00:12:36.823,00:12:43.630 USB interface between the the USB AND dongle and the PC running the game. And so I built 00:12:43.630,00:12:49.502 a tool uh for some commercial that we were doing uh and I wanted to re-task this to to 00:12:49.502,00:12:54.841 something fun. And so we picked ZWIFT on this. And so this tool is called USBQ and it’s, it’s 00:12:54.841,00:13:00.880 put together so you can explore and hack application level protocols that are flowing 00:13:00.880,00:13:05.885 across USB buses. Now there’s a lot of prior work in USB hacking. Uh, there’s tons of 00:13:10.657,00:13:16.963 stuff you can go read about. Uh it just google Facedancer and you can find uh c- a couple of 00:13:16.963,00:13:21.734 repositories and there’s a bunch of people who have contributed great tools for doing the kinds 00:13:21.734,00:13:28.107 of USB explorations that you might want to do if your objective is to target the uh 00:13:28.107,00:13:33.112 USB drivers or operating system interfaces of USB host or peripheral. So they can do all 00:13:35.315,00:13:39.385 sorts of interesting tricks with Facedancer. You should definitely take a look at it if 00:13:39.385,00:13:44.957 that’s your objective. Um, there’s also uh tons of great links under this um Hardware 00:13:44.957,00:13:49.962 Village USB links uh uh page put together by Andrey Konovalov. Go take a look and find that. But 00:13:54.400,00:13:59.439 the first thing I’d recommend if you want to start hacking on USB is just use tcpdump and 00:13:59.439,00:14:04.377 wireshark. Really simple. Always works. Um, and on a linux host you can plug in a USB device, 00:14:06.412,00:14:11.417 use tcpdump against a usbmon interface and get captures of USB packets. Um, USB is a 00:14:14.187,00:14:19.092 networking protocol, which is kind of counter intuitive cause you see serial in there. Um, but 00:14:19.092,00:14:24.097 wireshark is great at looking at this. So when I was working on this commercial project doing 00:14:26.999,00:14:32.205 this USB hacking, I I knew about the facedander code and that was what I thought I was going to 00:14:32.205,00:14:38.144 end up using. But I had one challenge in this project I was working on. It was a USB, uh, 00:14:38.144,00:14:43.683 high speed interface. So I couldn’t use the facedander board, which uh, which only 00:14:43.683,00:14:48.855 supports USB low speed. Um, there is there was some hardware out there and I’ll talk about 00:14:48.855,00:14:53.092 that in a moment, but it was a it was at the moment you couldn’t just buy it, you had to 00:14:53.092,00:14:58.698 solder it together honestly, my soldering skills and pcb assembly skills are pretty 00:14:58.698,00:15:03.636 pretty bad. Uh, so I knew that’d be a big waste of time. Um, but I did find a toolkit put 00:15:05.805,00:15:10.810 together by name Be- Benoit Camredon of US of Airbus Sec Labs. Um, Benoit built a a 00:15:13.112,00:15:17.049 pretty cool tools and he published a paper about it that’s linked too on this site 00:15:17.049,00:15:23.122 as well. And so it was a Python 2 userspace and the loadable kernel module that could be 00:15:23.122,00:15:29.595 installed on a Linux kernel running on any board. Now the board has to have two things. It 00:15:29.595,00:15:34.600 has to have a USB host interface and a USB device interface, the device interface is um, i- is 00:15:36.803,00:15:41.808 what re-exports that to the host. And so some boards have that, some don’t, but the 00:15:41.808,00:15:46.813 Beaglebone Black is a good easy to find choice that does. But I had this idea because there’s a 00:15:48.981,00:15:54.253 few things I I wanted the tool to do that it didn’t, so I just decided, like let’s just do a 00:15:54.253,00:15:59.425 little short project to re-write the whole userspace side of this. And ha. And that’s what 00:15:59.425,00:16:04.363 ended up being USBQ. So USBQ like I said, the thing it’s good at is, for when you when you’re 00:16:07.600,00:16:11.304 not trying to attack the operating system or the drivers, but you want to be able to 00:16:11.304,00:16:17.710 inspect and modify the applications communications that go back and forth. Um, and and 00:16:17.710,00:16:23.249 in fact you know I didn’t want to break the drivers, right. I need those to work. And so with 00:16:23.249,00:16:28.521 a board like the Beaglebone Black, you can set it up, plug your USB device into one end of 00:16:28.521,00:16:33.793 the board, plug the other USB interface into your host computer and then install the 00:16:33.793,00:16:40.633 loadable kernel module. You can start up the USBQ userspace application and then it’ll 00:16:40.633,00:16:45.671 receive packets over UDP, um, when they come in from the device, process them however you 00:16:45.671,00:16:50.676 wish, send them on to the host and the reverse. So now there’s just another tool in the in the 00:16:53.679,00:16:58.050 toolkit out there for you to work with. Um but somet things have have changed on the 00:16:58.050,00:17:03.489 Facedancer side that are worth mentioning. Uh for one there’s a new board out by Michael Ossmann 00:17:03.489,00:17:10.229 called the GreatFET One that is has higher speed USB interfaces on it, so uh, that’s a good 00:17:10.229,00:17:14.467 board. You can pick them up now and just buy them. They’re like 100 bucks. Uh I’ve got one and 00:17:14.467,00:17:21.340 I’ve just started fiddling with it. You can also use USBQ with a with a off the shelf piece of 00:17:21.340,00:17:26.212 hardware like a Beaglebone Black that you might have. I and I’ll talk about how I used it in the 00:17:26.212,00:17:31.217 application hacking. So this is USBQ. It’s a command line application. It implements by 00:17:33.419,00:17:38.991 itself just one command MITM - man in the middle - and has the same set of plugins that go with 00:17:38.991,00:17:45.464 it. The plugins do various stages of uh packet manipulation and stuff flows back and forth. 00:17:45.464,00:17:50.469 Let me walk you through that. USBQ is super simple. It’s just got a main loop that goes on uh, 00:17:53.873,00:17:59.612 continuously and in that loop it grabs packets from the device, sends them through through the 00:17:59.612,00:18:04.383 tool and on to the host. Grabs packets from the host, sends them to the device, then has a 00:18:04.383,00:18:09.388 tick to let uh, plugins do work. For each um, packet processing stage, the orange boxes, it’s a 00:18:12.725,00:18:17.730 really set of hooks that are called. Uh I’m using uh a plugin framework I’ll talk about next, 00:18:20.066,00:18:25.571 but you can provide your own hook implementations. So there’s hooks for waiting for a packet, 00:18:25.571,00:18:31.510 getting the packet, decoding into a a format that you want to work with. Um, logging it, 00:18:31.510,00:18:37.116 modifying the packet, you know so you can do whatever hack you want to do. Um, encoding it for 00:18:37.116,00:18:42.555 transmission and then sending out the door to to the host of the device as is appropriate. 00:18:42.555,00:18:47.593 And these again are all hooks. So you can use the existing behavior that USBQ hs or add 00:18:47.593,00:18:52.598 your own capabilities. The plugin framework is built using a great toolking in the Python 00:18:56.535,00:19:01.540 world called plugging. Plugging is super awesome if you’ve worked with Pytus before, you’ve 00:19:01.540,00:19:07.113 used tons of plugging uh implemented hooks in there. But it gives a bunch of defined 00:19:07.113,00:19:12.118 extension points.Um, that you can override or or modify however you need. So um, you 00:19:14.687,00:19:19.959 know the basic tool just as USB, but if you want to do USB with an application level protocol 00:19:19.959,00:19:26.298 like we did with ZWIFT, then you write plugins and sit on top of that. Um, and there’s basic 00:19:26.298,00:19:30.536 plugins for doing things like getting and sending packets and decoding them to a scapey 00:19:30.536,00:19:36.142 representation. So that can then eh manipulate the fields uh and gives you some convenience 00:19:36.142,00:19:42.448 features for development. Some of the convenience features that will help you out. It’ll always 00:19:42.448,00:19:47.253 do a PCAP capture so you can look at ca- look at what happened on the wire after 00:19:47.253,00:19:53.926 you’re done. Uh, but most useful to me was that uh I coded an ability to be able to reload uh 00:19:53.926,00:19:59.799 plugins on the fly. Um, lots of times you’ll be hacking things that take a while to boot up. Or 00:19:59.799,00:20:03.102 there’s a complex synchronization process, something that you know like you 00:20:03.102,00:20:08.841 don’t want to reboot the board every time. Uh and in in the case of ZWIFT, the game takes 00:20:08.841,00:20:14.747 about like 3 or 4 minutes to start up. So that’s pretty slow. Um, and so I can start up the 00:20:14.747,00:20:19.785 game, have it running and then load the plugins that introduce the hacks. Change stuff, unload 00:20:19.785,00:20:25.324 them, reload them again. Uh and do all of that through a pretty convenient interface. There’s uh 00:20:25.324,00:20:30.196 IPython console support too so you can just you know, reach in there and manipulate packets on 00:20:30.196,00:20:35.201 the fly. So USBQ is available now at USBQ dot org. It’s an MIT licensed uh component. Uh piece 00:20:42.041,00:20:47.046 of software I should say. Uh, I’ve got some planned work that I want to work do with it. First 00:20:47.046,00:20:52.818 of all, it’s dependent now on this loadable kernel module. Which is GPLV2 licensed. That 00:20:52.818,00:20:58.924 module is good, but it’s not part of the mainline kernel. And so I’d like to work on USBQ so 00:20:58.924,00:21:03.596 that it can use a native feature called USBIP that’s in most Linux kernels. USBIP support is 00:21:03.596,00:21:08.134 so that uh the kernel can reach up and use a remote USB device. Over a TCP connection. It’s it’s 00:21:08.134,00:21:10.569 really pretty cool. Um and and that’s half of the problem that I need. We ne- need to also 00:21:10.569,00:21:12.571 implement another mainline kernel feature to be able to then create the emulated USB 00:21:12.571,00:21:14.573 device. On the other interface on the board. So that’s something that right now the 00:21:14.573,00:21:16.575 kernel can’t do. I’d like to see that improved. Um and we’ve got one working example in an out of 00:21:16.575,00:21:21.580 kernel module thinks to Benoit. The GreatFET One as I mentioned looks like a really great board. 00:21:23.649,00:21:28.654 I want to start figuring out and see if I can integrate that with USBQ as well. Looks pretty 00:21:42.701,00:21:48.474 straight forward and then on the more important side, I want to start building other types of 00:21:48.474,00:21:53.712 US- other types of protocols that will write on top of USB, so that no matter what your 00:21:53.712,00:21:58.384 hacking project is, you’ve got a, you got a main in the middle tool that knows how to work with 00:21:58.384,00:22:03.322 that packet format. Uh just by installk=ing a new Python module. But back to the cycling 00:22:07.526,00:22:13.732 part. And more importantly the cheating part. So like I said, USBQ is just a generic main in 00:22:13.732,00:22:18.938 the middle tool. But I wrote a I wrote another plugin that sits on top of it. Uh, that I like to 00:22:18.938,00:22:25.611 call ELANCE, the e Leet Automatic Network Cheating Enhancement. Um, for my man 00:22:25.611,00:22:30.616 Lance. [applause/laughter] So so there’s there’s a lot of great features that you you get with 00:22:35.254,00:22:40.726 ELANCE. Um, how many of you guys ride ZWIFT? Anybody here? Alright. Ok, you’re gonna be 00:22:40.726,00:22:46.298 winners tomorrow. It’s going to be awesome. Um, because you get in two modes. You get EPO mode. 00:22:46.298,00:22:50.002 EPO mode is great. This is probably the one you want to start with, ‘cause, ‘cause like 00:22:50.002,00:22:54.473 Mike Zussman over there, Mike Mike is like a real bicycle rider. I ride bikes like kids 00:22:54.473,00:22:59.078 ride bikes. Like I just like riding down the hills fast and goofing around and you know, I 00:22:59.078,00:23:04.917 just like to go places. Mike is serious. Mike actually trains. Um and and so if I’m ever going 00:23:04.917,00:23:10.422 to have a chance to beat Mike on ZWIFT, I need this EPO mode thing. And what it does is it 00:23:10.422,00:23:14.426 let’s you like sustain that performance without having to work nearly as hard, so you can 00:23:14.426,00:23:18.731 dial up like how much a performance boost you want. Would 20 percent help you beat 00:23:18.731,00:23:23.736 Mike? I’d probably need 50. Um, and it also makes the world flat. So like when your avatars 00:23:25.871,00:23:30.442 riding up hill and instead of the pedaling getting harder. You just stay the same. Only Mike 00:23:30.442,00:23:36.515 has to work. And that’s a good thing. And so EPO mode is what you want. It’s also realistic, 00:23:36.515,00:23:40.719 ‘cause like you do have to work a little bit, but for some people this this might not be 00:23:40.719,00:23:45.724 good. Uh and so for you, there is slacker mode. If it’s too important to risk sweating, this 00:23:48.861,00:23:54.933 is the mode for you. So slacker mode gives you the ability to use an Xbox controller to run 00:23:54.933,00:24:01.273 the game. And and it’s and it it’s really kind of stupid, because it takes a game and like 00:24:01.273,00:24:06.145 turns into a one dimensional game. Like you just squeeze the trigger. I mean it’s [laughter] 00:24:06.145,00:24:11.150 at that point what are you doing? Ah huh. But you know. You do you. Uh so, so slacker mode 00:24:14.753,00:24:18.557 ge- does this for ya and I’ve got some new features that I’m working on. I want to do cruise 00:24:18.557,00:24:23.395 control on there. That’s really easy. I I actually built that and then I erased the code. Uh, 00:24:23.395,00:24:28.200 sorry. Uh but then most importantly, because the bike police are out there in ZWIFT 00:24:28.200,00:24:34.239 world, uh, I want to work on a mode that will use other riders real world performance from a 00:24:34.239,00:24:39.578 website called Strava. People all over the world publish rides they do on Strava and they’ll 00:24:39.578,00:24:45.417 have um, their power data on there. And you can get course elevation data. So I’m going to 00:24:45.417,00:24:50.289 use that and say, ok, when all these other riders ride this course, this is their maximum 00:24:50.289,00:24:55.294 power, I just want that plus one. Um, and so then I think I can pull this off. So the ELANCE 00:24:59.331,00:25:05.471 plugins for USB, I I put together really cause it looked fun and it’s a good like example 00:25:05.471,00:25:11.410 plugin for how to work with a pretty straighT forward protocol like you find on ZWIFT. Um and 00:25:11.410,00:25:16.415 so e- uh USBQ gives you the blue parts at the bottom. The basic hosting device interfaces, uh, 00:25:19.051,00:25:23.989 the ability to pass the packets back and forth. But the orange parts on top are what are in 00:25:23.989,00:25:29.561 ELANCE. And if you are working on a new protocol, something you know, that’s not in there now. 00:25:29.561,00:25:34.433 You’d want to write new hooks and you can use ELANCE as a model for that. And so the 00:25:34.433,00:25:41.039 plugins that I have on ELANCE will decode these ANT plus protocol packets. AN- ANT plus 00:25:41.039,00:25:45.744 you might not have heard, you probably haven’t heard of it before, but it’s a predecessor 00:25:45.744,00:25:50.716 to uh Bluetooth low energy and it’s something that’s used primarily in sporting and 00:25:50.716,00:25:55.521 fitness equipment. Life if you, it’s owned by Garmin nowadays. So if you have a Garmin watch, 00:25:55.521,00:26:00.392 it probably supports ANT plus and you can hook it up to an ANT plus heart rate monitor or a a 00:26:00.392,00:26:05.197 foot cadence meter. So when you go out and do your run, you get all this data that streams off 00:26:05.197,00:26:11.170 there. Um and it’s a it’s a predecessor to Bluetooth low energy, but has very low level 00:26:11.170,00:26:14.973 security support. Pretty much none at all. You can set a network key and from that it 00:26:14.973,00:26:20.279 derives an AES key. But since it’s really hard to type in a network key onto a piece of 00:26:20.279,00:26:24.550 fitness equipment, I don’t think anybody does that. So it’s always in the clear. They just 00:26:24.550,00:26:29.555 do a pairing stitch- step. Um, but the ANT plus protocol is really well documented uh it at 00:26:31.757,00:26:37.329 at the website E Dope dot bike. That’s the site for this talk. Um, it’ll link you over to find 00:26:37.329,00:26:42.201 the ANT plus payload definitions and you can just register as a developer and get those payload 00:26:42.201,00:26:47.873 definitions. And in there, there’s a field that has um, that in the case for power just 00:26:47.873,00:26:53.812 defines what’s the instantaneous power that this rider is is mashing the pedals with. And 00:26:53.812,00:27:00.285 that’s what we are hacking in this example. So when you put it all together, you you have USBQ 00:27:00.285,00:27:04.623 in the middle and it’s doing three things really well. It’s modifying power as it streams 00:27:04.623,00:27:09.661 passed from the sensors to the game. It’s uh tweaking your heart rate and your cadence to 00:27:09.661,00:27:15.400 keep stuff normal looking. Uh and then it’s also controlling the grade or the resistance that 00:27:15.400,00:27:20.405 the trainer sets. Uh and all of this uh you guys could do yourself if you want too. So 00:27:23.609,00:27:28.614 let’s do the demo. So this is uh, ELANCE running in the top left on top of USBQ and then I’m 00:27:32.784,00:27:37.756 gonna get it it fires up here and connects with the kernel module and now it’s set up so 00:27:37.756,00:27:43.228 that my device which I’ve plugged in uh it all the packets are running through USBQ and I’m 00:27:43.228,00:27:50.002 starting up ZWIFT. Uh. Like I said, ZWIFT goes a little slow on starting up. But the first 00:27:50.002,00:27:55.941 step that you go through anytime is uh setting up the sensors. This box over here on the left, 00:27:55.941,00:28:01.046 that’s just a rendition of my xBox controller. The horizontal band at that the top, that’s the 00:28:01.046,00:28:06.018 the rate trigger on there. So you can see that, that’s my throttle input. And we’re 00:28:06.018,00:28:12.958 connecting over ANT plus to the three sensors I have. Uh for for this experiment here and then 00:28:12.958,00:28:19.598 we’ll get off riding shortly. Now you may not be familiar with like how many watts you make 00:28:19.598,00:28:23.468 when you’re riding a bicycle. Like you know if if you’re a kid and you’re riding a bicycle and 00:28:23.468,00:28:27.539 you’re working really hard, you might be making a hundred watts or something. That’s that’s kind 00:28:27.539,00:28:32.544 of what you feel like. If I ride a bicycle like 187 watts, That’s that’s pretty good pace. But but 00:28:34.680,00:28:40.118 now I don’t have to be limited by my own physical limitations and disinterest in training. Uh, 00:28:40.118,00:28:45.891 ‘cause I can hack stuff. 500 watts is crazy power. For me, that’s nutty. Mike probably does 00:28:45.891,00:28:50.896 that like every day riding home. Uh from work. But like um, ya- you know like Homer Simpson said 00:28:54.399,00:29:00.706 um, you know there’s there’s the right way, the wrong way and the max power way. And so I want to 00:29:00.706,00:29:05.744 see like we’ve got this big 16 bit field, can we really crank it up. So I took the limits off 00:29:05.744,00:29:11.049 and you know, screw the bike police, let’s get this thing going. And so when you crank up 00:29:11.049,00:29:17.589 ZWIFT, this is crazy power right here. [laughter] Uh, you get achievements and then and then 00:29:17.589,00:29:23.895 you get this one the two point, the one point two one gigawatts. Um, award. But ZWIFT has some 00:29:23.895,00:29:30.369 senses in there that the the game like you go too hard, too fast in certain sections of the 00:29:30.369,00:29:36.908 course and they ding you. And they’re like no, your something is broken cheater. Uh why don’t 00:29:36.908,00:29:42.414 you fix that. And and something you may not have seen in there, you get a little dunce cap, when 00:29:42.414,00:29:46.918 when you do that. So when your, when your sensors go all wonky like that. Your avatar gets a 00:29:46.918,00:29:52.424 dunce cap, this little orange triangle. And every rider can see that out there. So if you 00:29:52.424,00:29:56.428 want to pull off this trick with your friends, you got to make sure you set your power limits 00:29:56.428,00:30:01.433 so you don’t get the dunce cap. Ok. That’s important. But then you know, we’re back to like, 00:30:04.202,00:30:09.207 this is really about, can we cheat? Can we like really cheat in a competitive event? Um and 00:30:11.677,00:30:16.848 and we’ve definitely like proven if you just want to cheat out of, out of a workout and you 00:30:16.848,00:30:21.987 know drink beer with your bike on cruise control. Yeah, you can do that. That’s not a problem. 00:30:21.987,00:30:26.992 Um, eh- you just kind of have to use sensible limits so you don’t get the dunce cap. But cheating 00:30:29.728,00:30:34.900 in an online race is gonna be a little bit harder for you. In ZWIFT everyday, there’s just 00:30:34.900,00:30:40.605 dozens and dozens of rides that they have. And there’s uh a website where every rider who 00:30:40.605,00:30:45.143 enrolls in a ride. Their performance is recorded on there. So they’re winner, right? 00:30:45.143,00:30:49.381 And like anything where there is a ranking, some people are really super competitive about 00:30:49.381,00:30:55.120 it and and one point I want to make is that, in this research I took care, never to actually 00:30:55.120,00:31:00.659 compete and finish in a race. Because even if, you know, I’m not taking this seriously, but 00:31:00.659,00:31:04.629 other people do and it’s really important to them and I don’t want to like, you know, screw 00:31:04.629,00:31:11.503 somebody who’s like actually trying to be a good cyclist. Um, most people on ZWIFT are just 00:31:11.503,00:31:16.141 there for the workout. They’re having fun. But I do think it’s very plausible to take a 00:31:16.141,00:31:20.612 mediocre rider like me and stretch them into somebody that’s more competitive. But 00:31:20.612,00:31:24.983 you’re gonna have to be careful about it. First of all, you’re gonna have to have, multiple 00:31:24.983,00:31:29.221 accounts. Not a big challenge. Um, but you’re gonna have multiple accounts, just to so 00:31:29.221,00:31:36.128 you can probe the limits of um, you know getting the dunce cap and also in what is uh eh, in 00:31:36.128,00:31:40.532 any you know, any kind of bike police, are out there, you want to figure out, well what are the 00:31:40.532,00:31:45.470 things that clue them off? You’re also going to have to with your real competitor 00:31:45.470,00:31:50.475 account, build an in real life track record riding that bicycle. This is because the in 00:31:52.844,00:31:58.083 the ZWIFT eRacing rules, this is part of what they look at. They want your rider profile to be 00:31:58.083,00:32:02.788 open. They want to see that you’ve done a lot of real world riding out there. And luckily 00:32:02.788,00:32:07.325 you can fake all that too. Uh you you just upload data to Strava and it’s like, yeah, 00:32:07.325,00:32:12.330 you’ve done that ride. And so you’ve got more hacking to do. To uh to pull that off. But you 00:32:15.200,00:32:21.640 can just like with the drug testing, uh the ZWIFT eRacing rules say that in competitive 00:32:21.640,00:32:28.046 events, that anybody finishes on the podium, top 3 finishers and 2 other competitors will be 00:32:28.046,00:32:34.219 subject to the ominous sounding performance review board. Uh the performance review board has a 00:32:34.219,00:32:38.690 couple of things that they talk about. That they might do. One of them is they might require 00:32:38.690,00:32:43.695 you to weigh in on video. Um so you know get busy hacking your scales so that when you step on 00:32:46.131,00:32:51.169 them, you actually measure lower, uh and make some funny little rulers, that are you know 00:32:51.169,00:32:56.174 ha not quite a foot. So you come out short. I think you guys can do this. Um, eh but there’s a 00:32:58.510,00:33:03.915 catch we’ll get to on the next slide. The other thing is that they want you to possibly submit 00:33:03.915,00:33:10.322 at their request other, uh like a second power source uh recording. So you’re gonna have 00:33:10.322,00:33:15.760 to get another power meter, put it on your bike. Maybe on your crank. Do a ride and then 00:33:15.760,00:33:21.833 download that data file with no authentication. Um, modify it then upload it to them. So I 00:33:21.833,00:33:28.039 don’t see a big barrier in doing that. Uh, cause we like hacking things, it’s not a big deal. Uh, 00:33:28.039,00:33:32.377 but then there’s a requirement that they might ask you, you know, maybe if they’ve seen you 00:33:32.377,00:33:38.383 present at DefCon to go to a third party verification lab, where you have to hop on a real 00:33:38.383,00:33:43.521 a real bicycle and ride it in front of people. So by this point, if you’ve already 00:33:43.521,00:33:49.594 committed to doing all of this stuff, you might as well bribe, like, do whatever you need to do 00:33:49.594,00:33:54.699 to get a third party test lab to to sign off and give you, give you you know say yeah, he 00:33:54.699,00:34:00.005 actually can generate 2,000 watts for half an hour. [laughter] I don’t know how his 00:34:00.005,00:34:06.711 muscles didn’t melt. Um, ha. So get to work on that. That that’s an important part of the of the 00:34:06.711,00:34:11.716 ruse. Um, but then not every competition in ZWIFT is gonna be online. Um, next year the UCI is 00:34:16.021,00:34:20.992 going to have a world championship of of what they call eBike racing. Ah and this 00:34:20.992,00:34:26.131 is virtual cycling, not to be confused with bikes with batteries in them. Um, so like 00:34:26.131,00:34:30.802 they’re gonna have a world champion of virtual cycling. That’s a big deal. Um and that 00:34:30.802,00:34:36.041 competition and the and the prior for money competitions that happen in the ZWIFT world 00:34:36.041,00:34:41.046 have all been live competitions. Things where you show up and you know maybe unlike the Fortnight 00:34:43.114,00:34:46.718 Championship where that kid won 3 million dollars and there’s not like thousand people, 00:34:46.718,00:34:51.690 there’s like ten people watching, but but you got to do it live. And that’s harder. 00:34:51.690,00:34:56.361 ‘Cause you’re gonna have to weigh in and you’re not gonna be able to bring your funky scale. 00:34:56.361,00:35:03.001 Or your short ruler. Um, and so you you probably don’t want to lie about that. And you’re gonna 00:35:03.001,00:35:08.273 have to figure out if you’re gonna use this hack someway to get your exploit, actually in 00:35:08.273,00:35:12.844 the chain. Um, and our friends at the NSA, when they’re not busy writing software reverse 00:35:12.844,00:35:18.083 engineering tools have been building funky USB cables for years. Mike Glossman also built 00:35:18.083,00:35:23.388 one um an and it’s really fascinating to look at it and just this week, uh, another 00:35:23.388,00:35:29.394 presenter had a doctored uh iphone cable that that was like a dead ringer, so you can 00:35:29.394,00:35:36.001 definitely make these cables. The hard part though is gonna be getting them on your bike. So I 00:35:36.001,00:35:40.805 don’t know. Higher a magician or somebody with like slight of hand skills. You’re gonna have 00:35:40.805,00:35:46.277 to figure that out. Maybe do it the NSA way, just interdict all the cables. Replace all of them 00:35:46.277,00:35:51.416 with doctored cables so that you can control your bike and everybody elses. I think that 00:35:51.416,00:35:58.223 will work. But there’s other ways too that we’re working on. Uh and hopefully be simpler that 00:35:58.223,00:36:04.429 won’t require physical access uh just just not quite done with them yet. But I also want to 00:36:04.429,00:36:08.833 mention that you know I found out just this week, uh, that there’s another researcher out 00:36:08.833,00:36:13.838 there who took a different path to cheating in ZWIFT. Uh his name is Keith Wakum and I’ll 00:36:13.838,00:36:18.843 have his video linked to uh E Dope dot bike. And so Keith took the path of saying, um, forget 00:36:21.346,00:36:26.351 buying hardware man in the middle stuff. I’m just going to build completely fake sensors. 00:36:26.351,00:36:31.423 And so he has a a complete consor emulator board, uh, that that just does a way with that. 00:36:31.423,00:36:34.926 He can control everything directly and that’s an interesting approach and it 00:36:34.926,00:36:41.332 definitely worked. Um, but it it one of the things it’s like I, you know as as um, as the bike 00:36:41.332,00:36:46.304 police get smarter, you know, they’ll maybe take more steps in software to verify that the 00:36:46.304,00:36:50.975 hardware is actually the expected hardware. And so that might involve probing for 00:36:50.975,00:36:56.714 behaviors which are not commonly used by the game. Um, but can be used to at least try to 00:36:56.714,00:37:01.553 authenticate the hardware. And so if those features are emulated, your cheat might be 00:37:01.553,00:37:06.558 uh, be caught. So you know two different ways and and there’s gonna be some more definitely. 00:37:09.160,00:37:15.233 So wrapping up, um, if you want to cheat yourself out of a workout. Go ahead, it’s it’s 00:37:15.233,00:37:21.206 it’s it’s totally possible. But but this this shows like the general challenges that we see 00:37:21.206,00:37:26.978 in industries, when they to- try to take sensors and software that haven’t been designed by 00:37:26.978,00:37:32.951 secure applications and then shifted to a place where people, like care about status and money 00:37:32.951,00:37:39.357 and fame. Like what could go wrong. Um, we’ve seen this movie before. And and this situation 00:37:39.357,00:37:43.661 with ZWIFT is just one of these things that’s that’s happening. And it’s not just ZWIFT. All the 00:37:43.661,00:37:47.932 cycling, uh, all the virtual cycling applications. Are gonna have the same kinds of 00:37:47.932,00:37:53.872 difficulties, because they all depend on the same kinds of sensors. Um, so it’s just not a 00:37:53.872,00:37:59.744 good foundation for security. And the second part is is that well third on the bullets here 00:37:59.744,00:38:04.415 is that there’s a lot more electronics and software creeping into cycling. So if 00:38:04.415,00:38:10.455 those organizations that govern cycling are not already looking at security as part of i- you 00:38:10.455,00:38:16.294 know software and electronic security is part of their um, uh, competitive integrity 00:38:16.294,00:38:21.032 measures, they really need to start doing that. Because we really like hacking things and 00:38:21.032,00:38:27.172 when people have lots of money on the line, they’ll do weird things. Uh, you know when it can 00:38:27.172,00:38:32.277 make a difference for them. So I hope you enjoyed this little insight into the crazy world of 00:38:32.277,00:38:38.383 cyclist, their cheats and I really recommend, go find something that’s got USB and go 00:38:38.383,00:38:45.056 start hacking with it. Uh if you want to find all all the slides, all the links to the software, 00:38:45.056,00:38:49.894 I’ve got a bunch of references you can read as well, so you can go find all these articles and 00:38:49.894,00:38:55.900 also find all the technical details that you need. All of that’s e dope dot bike. Thank 00:38:55.900,00:39:00.205 you very much. [applause]