1 00:00:15,190 --> 00:00:18,010 Hello and welcome to Rock the Cache Box. 2 00:00:18,010 --> 00:00:25,570 This talk is about hands-on ATM protocol analysis, and we'll be covering ATMs and, of course, the protocols that power them. 3 00:00:25,570 --> 00:00:28,030 At least one specific protocol. 4 00:00:28,050 --> 00:00:32,550 This talk has been made specifically for DEF CON 30 and Retail Hacking Village. 5 00:00:32,550 --> 00:00:39,930 I hope that for those of you who have not been at Hacker Summer Camp in some time, this will be a good refresher on ATMs. 6 00:00:39,930 --> 00:00:48,230 And if you're new to security and you want to know how ATMs work or you want to look at protocol analysis, this talk should and is tailored for you. 7 00:00:48,230 --> 00:00:53,470 I really wanted to focus on the basics and how protocols work. 8 00:00:53,730 --> 00:00:56,190 So with that, enough about the introduction. 9 00:00:56,190 --> 00:00:59,390 You really aren't here to just hear about the talk, you want to actually see it. 10 00:00:59,390 --> 00:01:00,990 So let's get started. 11 00:01:01,990 --> 00:01:03,230 So about me. 12 00:01:03,230 --> 00:01:09,470 I am Wasabi, sometimes Spicy, at least on Twitter, and I am a perpetual volunteer. 13 00:01:09,470 --> 00:01:18,910 That's how this whole event started, and that's how I get a lot of interesting ideas and work for some of the research I do. 14 00:01:19,170 --> 00:01:27,210 The events that I help put on are the Collegiate Pen Testing Competition, the Global Collegiate Pen Testing Competition, my apologies. 15 00:01:27,210 --> 00:01:30,530 It's a very awesome competition, which is how we got to this. 16 00:01:30,530 --> 00:01:35,470 In this particular year, they were tasked with pen testing a bank. 17 00:01:35,470 --> 00:01:42,150 And I also participate in the Collegiate Cyber Defense Competition, which is the cyber defense aspect of that. 18 00:01:42,150 --> 00:01:47,310 These events are very interesting, and if you're a student , you should definitely look into getting involved. 19 00:01:47,310 --> 00:01:50,570 I am a researcher of embedded devices. 20 00:01:50,570 --> 00:02:00,190 I have researched voting machines, ATMs, of course, and many routers and other devices of an embedded nature. 21 00:02:00,430 --> 00:02:08,130 The great thing about embedded devices, there's always something new, and you may think, oh, this device is secure and it's fully updated. 22 00:02:08,330 --> 00:02:09,490 Nope, never is. 23 00:02:09,490 --> 00:02:16,930 So it's a very interesting topic, and I can go on and on about all the embedded devices that are out there today. 24 00:02:17,090 --> 00:02:25,870 This includes the Internet of Things, but we're really focusing on ATMs, and these ATMs specifically are quite old, but they're still in use. 25 00:02:25,870 --> 00:02:30,470 So it should be an interesting rediscovery for everyone. 26 00:02:30,850 --> 00:02:37,990 Now, I will be sitting in the audience probably that way, and if you happen to see me, please ask questions. 27 00:02:37,990 --> 00:02:39,550 I know that this is a little weird. 28 00:02:39,550 --> 00:02:45,670 I was not either expecting to be doing an in-person talk via recording, but here we are. 29 00:02:45,670 --> 00:03:01,710 And I'm grateful for this opportunity because, for one, everyone's going to be wearing masks, and two, this gives me an opportunity to make sure that all the content and demo and videos are all working as expected, because if anyone's ever done a talk before, 30 00:03:01,710 --> 00:03:03,210 you know things go sideways. 31 00:03:03,690 --> 00:03:18,530 Anyway, finally, I am a cloud engineer by day, so none of the stuff we're talking about really is my day job, but if you are interested in these topics, I'm happy to answer questions or find people who might know or do know the answers to those questions. 32 00:03:18,610 --> 00:03:23,310 Now, my partner with this was formerly known as JRWR. 33 00:03:23,310 --> 00:03:26,810 He's now going as Balsa, at least on Twitter. 34 00:03:26,810 --> 00:03:29,130 He is the creator and designer of Hatchant. 35 00:03:29,130 --> 00:03:36,590 He is working with the Defcon Scavenger Hunt for some really cool stuff this year, and so you should go check him out. 36 00:03:36,590 --> 00:03:41,370 And also, he does some really interesting work on some CTFs and things like that. 37 00:03:41,370 --> 00:03:49,610 Overall, he is a really good guy to work with, and if you have any questions about so many topics, please go reach out to him. 38 00:03:49,610 --> 00:03:50,250 He's awesome. 39 00:03:50,250 --> 00:04:01,450 Unfortunately, I don't think he's going to be here today because, of course, he's running the Scavenger Hunt, but I wanted to give credit where credit's due, and that was the team that helped make this happen. 40 00:04:02,130 --> 00:04:06,590 So, anyway, you're here not to hear about us, of course. 41 00:04:06,590 --> 00:04:08,870 You're here about rocking the cash box. 42 00:04:08,870 --> 00:04:15,650 And, fun fact, if you ever see an ATM do what's in the picture, it's fake. 43 00:04:15,650 --> 00:04:20,030 It's, in fact, so fake that it's been modified. 44 00:04:20,030 --> 00:04:20,750 It's tampered with. 45 00:04:20,750 --> 00:04:22,230 It's not real. 46 00:04:22,470 --> 00:04:37,570 In fact, the ATMs that we're dealing with, that is one of them, they have a guard to prevent money from flying out because, as one should with designing an ATM, you probably don't want the money flying out into the air. 47 00:04:38,130 --> 00:04:40,130 And, of course, what is a cash box? 48 00:04:40,130 --> 00:04:43,030 Well, inside of an ATM, you have to get money. 49 00:04:43,050 --> 00:04:49,590 Now, unlike a vending machine, you don't want to have the vendors who refill the machines handling the money. 50 00:04:49,590 --> 00:04:51,950 They could take some, do all sorts of stuff. 51 00:04:51,950 --> 00:05:00,330 So they are handed cash boxes with specific keys, and the machine can pull money out of that cash box. 52 00:05:01,270 --> 00:05:04,490 So our goal is to get the money out of the cash box. 53 00:05:04,490 --> 00:05:05,630 And how are we going to do that? 54 00:05:05,630 --> 00:05:08,170 Well, we're not modifying the ATMs. 55 00:05:08,170 --> 00:05:10,570 We are not modifying the firmware. 56 00:05:10,570 --> 00:05:14,030 We are not doing anything with the ATMs. 57 00:05:14,030 --> 00:05:15,810 In fact, the ATMs are stock. 58 00:05:15,810 --> 00:05:22,670 We have not customized them except for maybe a few repairs because the ones that we got were in pretty bad condition. 59 00:05:23,570 --> 00:05:38,130 We think this talk, at the very least, is interesting and unique because not many people have looked at the protocol... my headset's falling off... looked at the protocol that powers a lot of these ATMs. 60 00:05:38,130 --> 00:05:44,190 These ATMs are still in use, and so we are specifically talking about that protocol that powers them. 61 00:05:44,290 --> 00:05:50,690 And we are bringing ATM protocols, at least one of them, to the masses at DEF CON 30 Retail Village. 62 00:05:50,690 --> 00:05:54,070 So I'm excited that everyone here is interested in that. 63 00:05:54,070 --> 00:05:57,790 And again, feel free to ask me any questions. 64 00:05:58,550 --> 00:05:59,990 So here's a photo. 65 00:05:59,990 --> 00:06:02,230 This was actually a couple of weeks ago. 66 00:06:02,410 --> 00:06:06,490 That is, in fact, the same ATM that we will be talking about today. 67 00:06:06,530 --> 00:06:08,370 And it, in fact, was out of order. 68 00:06:08,370 --> 00:06:13,770 I almost was tempted to offer them a fix, but I thought better of it. 69 00:06:14,150 --> 00:06:27,290 So the background of this event and why we got so many ATMs and why we had to do this was ironically enough, the event was the Collegiate Pentesting Competition, and it was a prehistoric bank. 70 00:06:27,290 --> 00:06:29,290 And of course, we got prehistoric ATMs. 71 00:06:29,290 --> 00:06:35,410 These are circa 2000 to 2004, and then there was an EMV update in around 2010. 72 00:06:35,550 --> 00:06:41,490 I guess that's still a lot more modern than some may expect, but they're fairly old by ATM standards. 73 00:06:41,870 --> 00:06:46,110 And so the simulated bank had a lot of custom applications. 74 00:06:46,110 --> 00:06:54,310 We had custom tools and everything built to simulate custom software and what a real-world pen test would be like. 75 00:06:54,310 --> 00:06:57,150 And the students are required to write a report on their findings. 76 00:06:58,130 --> 00:07:09,030 In previous years, some of the event, well, at least the past three or four years, teams have found odays on the software that we use. 77 00:07:09,030 --> 00:07:13,830 It's not that the software is custom in those particular cases. 78 00:07:13,830 --> 00:07:21,070 It's actually off the shelf, and we did not know there were vulnerabilities, but because of the pen test that the students are performing, they find vulnerabilities. 79 00:07:21,090 --> 00:07:22,430 It's actually very exciting. 80 00:07:22,430 --> 00:07:27,570 We look forward to those findings every year, and so far the teams have not disappointed us. 81 00:07:28,050 --> 00:07:37,290 It's a really cool competition, and if you're like, oh my gosh, I don't think I can find zero days, odays, sorry, however you want to say it, don't worry. 82 00:07:37,290 --> 00:07:42,690 The competition is it goes through a regional qualifying and several rounds. 83 00:07:43,170 --> 00:07:50,590 We want it to be fun, so not every team finds vulnerabilities like that, but the key thing is it's a very interesting competition. 84 00:07:50,590 --> 00:07:52,690 We try to make it as realistic as possible. 85 00:07:52,950 --> 00:07:55,430 But you're probably wondering, how did you get ATMs? 86 00:07:55,430 --> 00:08:00,090 Well, it turns out you can buy anything on eBay, and sometimes in great numbers. 87 00:08:00,130 --> 00:08:14,530 Turns out you can get an entire truckload of ATMs for maybe less than $500, and maybe you have to get that from one state to another and travel over a thousand miles. 88 00:08:14,730 --> 00:08:16,610 You know, just things. 89 00:08:16,730 --> 00:08:21,850 And the good news is the mission impossible for ATMs was a success. 90 00:08:21,850 --> 00:08:27,970 The truck almost flipped once, and it was a journey. 91 00:08:28,250 --> 00:08:31,730 But purchasing ATMs, it's a very strange world. 92 00:08:31,770 --> 00:08:38,910 People are no questions asked, and they expect you to just deliver an ATM, or get an ATM and buy it and take it away. 93 00:08:38,910 --> 00:08:42,550 So it's interesting, and all of these were from various locations. 94 00:08:42,550 --> 00:08:48,730 In fact, a lot of the ATMs as we were analyzing the configurations were from Waffle Houses. 95 00:08:48,790 --> 00:08:55,610 So some of them actually were sticky, one at least had some dead critters in it. 96 00:08:55,610 --> 00:08:57,290 They were pretty disgusting. 97 00:08:58,190 --> 00:09:01,050 But as it turns out, again, you can pretty much buy anything. 98 00:09:01,050 --> 00:09:02,370 This is the current listing. 99 00:09:02,370 --> 00:09:05,370 The bottom one is a single one for $300. 100 00:09:05,370 --> 00:09:11,310 We did much better than that, but you can see all the different variants of the ATM machines and parts. 101 00:09:13,190 --> 00:09:17,310 So here are all the ATM machines running in unison. 102 00:09:17,310 --> 00:09:24,730 I don't think that the audio will come through, and in fact, the video footage is pretty broken. 103 00:09:25,150 --> 00:09:30,850 But that was all the ATMs and doing their boot up. 104 00:09:30,850 --> 00:09:35,290 So unfortunately, the videos probably won't work today. 105 00:09:36,570 --> 00:09:41,850 So anyway, the problem with the ATMs was they were in bad shape. 106 00:09:41,850 --> 00:09:47,310 They were falling apart, and we needed to find a way to communicate them. 107 00:09:47,310 --> 00:09:51,990 So first we found the working ones, and then we had to figure out what to do. 108 00:09:52,210 --> 00:09:55,970 So it turned out there were a few things, not just one thing. 109 00:09:56,430 --> 00:09:59,610 And so we tried to find the user manual. 110 00:09:59,610 --> 00:10:04,910 Of course, the user manual is meant for users, and not people trying to make the ATMs work. 111 00:10:04,910 --> 00:10:15,090 Most of the time you go through a trusted vendor to buy your ATM and get a actual service for the payment processing. 112 00:10:16,430 --> 00:10:19,030 And our goal was to make them work. 113 00:10:19,030 --> 00:10:20,830 That was the most simple goal of them. 114 00:10:20,830 --> 00:10:22,970 We weren't trying to reverse engineer a protocol at the time. 115 00:10:22,970 --> 00:10:24,230 We just wanted to see what can we do. 116 00:10:24,230 --> 00:10:25,730 Can we make them dispense money? 117 00:10:25,730 --> 00:10:27,330 Can we do anything? 118 00:10:27,350 --> 00:10:33,910 Of course, it says out of order unless you do the correct sequence for the protocol, and so we were running into some issues. 119 00:10:34,150 --> 00:10:38,650 And our final goal was to make it as realistic as possible. 120 00:10:38,650 --> 00:10:40,470 We didn't have any defined goals. 121 00:10:40,470 --> 00:10:42,870 We didn't have anything other than make them work. 122 00:10:43,030 --> 00:10:46,030 So our one item was was where we started. 123 00:10:46,270 --> 00:10:53,050 Of course, the ATM itself is a Tranax Minibank 1500. 124 00:10:53,710 --> 00:10:59,530 Hayusong is the brand who took that over as far as I know, or one of them bought the other. 125 00:10:59,550 --> 00:11:03,030 So you see various names of those interchangeably. 126 00:11:03,030 --> 00:11:08,670 And some models actually support up to Windows CE 6.0 with EMV support. 127 00:11:08,670 --> 00:11:18,990 Now, Windows CE 6.0 end of life took place in February 2022, so I guess it was fairly modern until recently, but it is what it is. 128 00:11:19,010 --> 00:11:25,850 And the main problem though was that was released in about 2014, and they don't receive any updates since. 129 00:11:25,850 --> 00:11:33,310 And with that upgrade, you'd be switching between the current protocol we use and Ethernet if you so desired. 130 00:11:33,330 --> 00:11:37,970 However, in our particular case, the ATM did not have Ethernet. 131 00:11:37,970 --> 00:11:44,210 It supported 56 baud modem, and that was it. 132 00:11:44,210 --> 00:11:56,430 And there was a safe, fun fact, if you can get that door open on the bottom where the money dispenser comes out, most of these ATMs are actually programmed for code 1234 or 000. 133 00:11:57,830 --> 00:12:09,090 There were a couple where we actually had to get the locks, like they were spin locks, and so we had to actually listen and get in that way. 134 00:12:09,090 --> 00:12:18,190 But for the most part, the ATMs were with a default code, even though these were directly from the vendor. 135 00:12:18,190 --> 00:12:23,550 They said they didn't know the pins, so we ended up googling, and that was the answer. 136 00:12:23,550 --> 00:12:25,350 Google is your friend. 137 00:12:25,730 --> 00:12:27,330 So specs. 138 00:12:27,330 --> 00:12:28,970 It's a pretty old system. 139 00:12:28,970 --> 00:12:32,670 It's powered by a 16-bit microcontroller. 140 00:12:32,670 --> 00:12:35,850 Main communication mechanism is the dial-up system. 141 00:12:35,870 --> 00:12:37,770 The pin pad contains the crypto keys. 142 00:12:37,770 --> 00:12:41,290 If you remove the pin pad, it resets, and then nothing works anymore. 143 00:12:41,290 --> 00:12:42,530 You have to reset it. 144 00:12:42,650 --> 00:12:46,990 Printer controller also uses the same processor and is an independent board. 145 00:12:46,990 --> 00:12:54,690 This allows you to update the main board while keeping the dispenser controller and the printer controller the same. 146 00:12:55,210 --> 00:12:57,930 All of it's communicating via serial. 147 00:12:57,930 --> 00:13:09,190 People have tried to attack the serial protocol, but that was not as interesting for us because that means you have to have physical access to the ATM, and as we all know, once you have physical access, all bets are off. 148 00:13:09,190 --> 00:13:12,850 So with enough determination, you could break in. 149 00:13:12,950 --> 00:13:16,630 Here's a picture of the classic main board from the ATM. 150 00:13:16,830 --> 00:13:19,570 You can see the main logic chip right there. 151 00:13:19,570 --> 00:13:29,310 There's a real-time clock that actually did not work, I believe, because these were the ones with the integrated battery, and those go flat after a while. 152 00:13:29,610 --> 00:13:32,330 But either way, didn't quite work. 153 00:13:32,350 --> 00:13:35,750 So you can see here where the main board is. 154 00:13:35,750 --> 00:13:37,410 This is a different variant. 155 00:13:37,410 --> 00:13:42,590 You can see all the connections to the main or the accessories to the main board. 156 00:13:42,590 --> 00:13:44,410 And then there's this one little thing. 157 00:13:44,410 --> 00:13:48,810 If you take a look with the question mark, that was a soldered-on accessory board. 158 00:13:48,810 --> 00:13:49,990 We're not quite sure what it did. 159 00:13:49,990 --> 00:13:53,190 If you flip the DIP switches, it would not boot. 160 00:13:53,730 --> 00:13:55,970 We couldn't find any identifiers. 161 00:13:55,970 --> 00:14:04,390 It is a microcontroller, of course, on there, but what it was actually trying to do and how it was connected, we weren't able to fully trace. 162 00:14:04,590 --> 00:14:07,370 You can see the FPGA and the memory on board. 163 00:14:07,710 --> 00:14:13,130 Overall, fairly simple setup, but this is what powers the ATM. 164 00:14:13,290 --> 00:14:20,790 If you want to get the upgrade, the upgrade, you can see the LAN and modem options, and it's now in a metal enclosure. 165 00:14:21,090 --> 00:14:26,370 And then it has a new display board and the EMV-compatible reader. 166 00:14:26,730 --> 00:14:30,470 Of course, we didn't have this, and we weren't really trying to. 167 00:14:30,470 --> 00:14:35,190 We were just trying to get ATMs to work, so we figured EMV would add to the complications. 168 00:14:35,550 --> 00:14:39,870 And of course it did, but it does, but we didn't deal with that. 169 00:14:41,150 --> 00:14:43,810 So how does an ATM work? 170 00:14:43,810 --> 00:14:59,970 And if you're new to ATMs, and maybe I'm, you know, or not as familiar, I may be going over these things in a basic sense, but again, this is for people who are not familiar with anything, so we're going to go through a little bit of background quickly. 171 00:14:59,970 --> 00:15:04,950 But ATMs usually need to communicate to a payment processor. 172 00:15:04,950 --> 00:15:11,570 If you go over a network that can be online and whatnot, if you're going over the phone, there's two options. 173 00:15:11,570 --> 00:15:25,590 You either have to have a local payment processor that converts the dial-up communication to Ethernet and then off to the actual payment server with more security and whatnot, or you have to connect to a dial-in payment processor. 174 00:15:25,950 --> 00:15:34,990 Way back in the day, this was known as VisaNet, and we'll be following that again in a little bit on the talk, but we didn't have either. 175 00:15:34,990 --> 00:15:43,390 We didn't know where we could obtain a local payment processor, and we had no operating manuals or guides or figuring out how we could connect. 176 00:15:43,390 --> 00:15:53,530 The only options we had was to actually pay a service to give us access, and as an academic competition, we don't have a lot of funds, so that was off the table. 177 00:15:53,950 --> 00:15:58,030 Our first thing to look at, can we emulate the payment processor? 178 00:15:58,030 --> 00:16:01,450 And of course we did, but we weren't quite sure how. 179 00:16:02,290 --> 00:16:11,490 Of course, near the end of the competition, or right before the competition, one of the volunteers was able to obtain an actual payment processor. 180 00:16:11,490 --> 00:16:14,870 This one is the external for localized payment. 181 00:16:15,230 --> 00:16:19,330 In is the modem, and out is Ethernet, and it connects to the internet. 182 00:16:19,330 --> 00:16:32,770 You can configure it using the Ethernet port, and this allows you to communicate to either one or multiple phone dial-in ATMs. 183 00:16:33,490 --> 00:16:37,650 So in the competition setting, we had a challenge. 184 00:16:37,650 --> 00:16:42,470 We had, I believe, eight or nine ATMs in use. 185 00:16:42,550 --> 00:16:54,010 We needed a way for them all to communicate, and we only had so many Raspberry Pis and phone modems, USB modems. 186 00:16:54,010 --> 00:16:55,630 So how do you do that? 187 00:16:55,630 --> 00:17:05,630 Well, we ended up buying some PBXs to allow banks of ATMs to communicate to the PBX, which would then connect to two lines in to the Raspberry Pi. 188 00:17:05,630 --> 00:17:16,970 This allowed us to have two simultaneous connections, and then the additional ATMs would be queuing until they were able to dial to the payment processor. 189 00:17:16,970 --> 00:17:19,870 Each, in our case, which was the Raspberry Pi. 190 00:17:19,870 --> 00:17:30,730 And then each Raspberry Pi was connected to a central processor, which connected to our simulated bank. 191 00:17:31,750 --> 00:17:40,410 And then, of course, the challenge was, before all this was set up, how do we communicate? 192 00:17:40,730 --> 00:17:52,570 So in my case, I was one of the developers, so I connected to DevSystem, which tunneled through the internet to a jump box at, I almost said JRWR, but Balsa's house. 193 00:17:53,110 --> 00:17:58,510 And then it tunneled to the Raspberry Pi, which then allowed us to communicate to the ATM. 194 00:17:58,930 --> 00:18:12,970 Now, the many layers of connection posed a problem, because if you killed the connection to the Raspberry Pi or the Raspberry Pi crashed, you might still be able to get to the jump box, but the Pi would be dead and you'd have to reboot it. 195 00:18:13,030 --> 00:18:17,630 And then the other fun was the modems would lock up and you'd have to physically reset them. 196 00:18:18,130 --> 00:18:21,570 So those were quite a few challenges that we had to deal with. 197 00:18:21,570 --> 00:18:25,630 And then, of course, a few times the jump box itself would just die. 198 00:18:25,630 --> 00:18:27,930 So the Pi was up, but we couldn't reach it. 199 00:18:28,570 --> 00:18:31,210 So it's a bit of a challenge. 200 00:18:31,210 --> 00:18:44,310 And then, of course, because all the ATMs were on the East Coast and I was on the West Coast, we had to work through the time zone challenges where things were very challenging sometimes when I would be working at 9 p.m. 201 00:18:44,310 --> 00:18:45,070 or 8 p.m. 202 00:18:45,070 --> 00:18:48,430 and it was almost midnight for Balsa. 203 00:18:48,430 --> 00:18:50,550 So that was a challenge. 204 00:18:51,030 --> 00:18:55,330 But we worked through it and we found out a couple of things. 205 00:18:56,030 --> 00:18:58,750 Dial-up is a bit of a lost art. 206 00:18:58,750 --> 00:19:05,530 A few years ago, there was a CTF at DEF CON that used dial-up modems for people to connect in. 207 00:19:05,530 --> 00:19:07,390 Thought that was very cool. 208 00:19:07,390 --> 00:19:11,930 But it's a bit of a dying and lost art because people don't really use this. 209 00:19:11,930 --> 00:19:23,470 We had to get used but new, and I say that with quotes, of course, because they were pre-used, PBXs, and we had to find USB modems compatible actually with the Raspberry Pi and Linux. 210 00:19:24,750 --> 00:19:31,590 And then, of course, we had to find how to dial into the ATMs or have the ATMs dial. 211 00:19:32,470 --> 00:19:41,050 And then, of course, how many retries and how to get them to communicate was a problem. 212 00:19:41,050 --> 00:19:52,350 And, of course, the PBXs we got were off eBay and they were the wrong frequency, 50 versus 60 hertz, to communicate. 213 00:19:52,350 --> 00:19:57,250 So we had a lot of things going against us to figure out how to get this all working. 214 00:19:57,390 --> 00:20:05,910 And for those of you who are familiar with dial-up, you know, it was a learning experience and I'm glad I learned it again. 215 00:20:06,050 --> 00:20:16,330 It's been a few years, but it's something that we're just not familiar with anymore as a team because most of the time you're dealing with Ethernet or Wi-Fi. 216 00:20:17,230 --> 00:20:21,830 So, of course, this is the simplified diagram of the payment processor. 217 00:20:21,970 --> 00:20:33,670 The payment processor can operate off of a Raspberry Pi or a micro router running OpenWrt, which connects to the USB modem and then to a PBX. 218 00:20:33,670 --> 00:20:38,510 You probably don't need the PBX to directly communicate, but it's a good idea. 219 00:20:38,810 --> 00:20:50,630 And then, of course, you can control in the final version, the one that I've released more recently, you can control the way the ATM operates from a web interface if you connect over Wi-Fi. 220 00:20:50,710 --> 00:21:00,030 This can force the ATM to accept or reject cards, change transaction fees, and, of course, manipulate the payments in transit. 221 00:21:00,030 --> 00:21:06,630 So, for example, if a user thinks they're getting $20, you can request $100 out of their bank account. 222 00:21:07,210 --> 00:21:14,790 And then the user gets back a validation, of course, not quite the correct validation that they expected. 223 00:21:15,670 --> 00:21:17,790 So that's the process. 224 00:21:17,790 --> 00:21:23,530 The only thing that's interesting for this is it actually checks to make sure that it's a valid card type that it knows. 225 00:21:23,530 --> 00:21:25,030 The ATM internally does. 226 00:21:25,030 --> 00:21:29,550 So we were trying to find ATM-valid cards. 227 00:21:29,550 --> 00:21:36,450 The only thing that we were able to obtain that wasn't an old credit card, because we didn't want to hand them out for the competition, was gift cards. 228 00:21:36,450 --> 00:21:38,610 Visa prepaid gift cards. 229 00:21:39,290 --> 00:21:45,670 So those actually were accepted, and we were able to use them and read the card data. 230 00:21:46,510 --> 00:21:52,390 So, of course, we worked on weekends and weekdays to get this working. 231 00:21:53,230 --> 00:21:56,830 Of course, I would start on the weekends at least at 6 a.m. 232 00:21:56,830 --> 00:21:59,090 Pacific time, which was about 9 a.m. 233 00:21:59,090 --> 00:21:59,630 Eastern. 234 00:21:59,630 --> 00:22:09,810 We would spend the whole day over a Discord or voice call, and the end process was trying to just get them to communicate. 235 00:22:09,810 --> 00:22:13,830 We had two ATMs at once, but only one Raspberry Pi. 236 00:22:14,030 --> 00:22:27,810 And because we were working in parallel trying to understand how these worked, we rediscovered time sharing, because we would have to split the workload and wait till someone was done dialing in to get everything. 237 00:22:28,550 --> 00:22:32,730 And, of course, we rediscovered at commands, which are very fun. 238 00:22:32,730 --> 00:22:40,590 The ATM internally uses at commands, as well as at commands are required to ring and hang up the modems. 239 00:22:41,390 --> 00:22:48,710 We needed some way to configure the ATMs, of course, and the challenge was we weren't familiar with these ATMs. 240 00:22:48,710 --> 00:22:51,970 They have a guide, but it's a general maintenance guide. 241 00:22:52,110 --> 00:22:53,770 And the good news is U.S. 242 00:22:53,770 --> 00:23:02,790 Robotics still sort of exists, and they have actually some great documentation, as long as you're able to use an old browser, which was not so good. 243 00:23:03,870 --> 00:23:07,090 So here are some of the key at commands. 244 00:23:07,970 --> 00:23:10,670 Plus, plus, plus, which is the command mode. 245 00:23:10,970 --> 00:23:13,930 And then A is answer. 246 00:23:14,030 --> 00:23:17,650 And then there's a slash, which is, of course, the repeat. 247 00:23:17,650 --> 00:23:19,090 There's the dial. 248 00:23:19,090 --> 00:23:28,150 So when you do the ATS zero equals two, it would auto answer, and you needed the proper new lines, otherwise it wouldn't communicate right. 249 00:23:28,870 --> 00:23:30,230 So that was a lot of fun. 250 00:23:31,790 --> 00:23:40,070 So, of course, once we got this working, the ATM would dial, it would send a message, and that's it. 251 00:23:40,470 --> 00:23:41,910 How do we know what it's sending? 252 00:23:41,910 --> 00:23:48,490 In this particular case, you can see the data when we were trying to decode it, and we were seeing a pattern. 253 00:23:49,550 --> 00:23:52,990 We were seeing data, but we weren't quite sure what, you know, it was. 254 00:23:52,990 --> 00:23:56,390 So we really didn't know, and we tried sending the same string back. 255 00:23:56,390 --> 00:23:58,110 Maybe it was, you know, a handshake. 256 00:23:59,230 --> 00:24:01,970 But really we were only getting a reply from the modem. 257 00:24:01,970 --> 00:24:06,130 And it's even funnier in a second, because we were trying to make this work. 258 00:24:06,130 --> 00:24:08,610 We started with PySerial, and that wasn't good. 259 00:24:08,730 --> 00:24:12,650 We tried Screen, because we thought maybe it's just in a different encoding. 260 00:24:12,650 --> 00:24:18,990 Then we tried Minicom, and then we actually switched to Intercept TTY, which is an old program. 261 00:24:18,990 --> 00:24:27,150 You compile it, and it outputs a socket that allows you to run two things to the specific serial line. 262 00:24:27,810 --> 00:24:34,010 And that allowed us to run our Python code and Minicom to monitor the messages at the same time. 263 00:24:34,530 --> 00:24:39,110 Of course, with Balsa, everything is in PHP. 264 00:24:39,110 --> 00:24:47,630 He once described it to me that he is the Jack Sparrow of PHP programming, and I can't disagree. 265 00:24:47,630 --> 00:24:52,970 You don't know how he ends up with the stuff he does, but it works, and it exists. 266 00:24:52,970 --> 00:24:55,770 So we tried PHP, but it wasn't quite working. 267 00:24:56,170 --> 00:25:01,570 It was impressive how far we got with PHP, considering it's not really meant for serial work. 268 00:25:02,150 --> 00:25:08,350 But, you know, overall the serial was just unreliable. 269 00:25:08,350 --> 00:25:11,370 We kept seeing messages, and we kept seeing them stack. 270 00:25:11,510 --> 00:25:16,030 So we knew something was going on, but we weren't quite sure we saw the patterns. 271 00:25:16,170 --> 00:25:21,650 And so we switched back to Python using the OS sockets for serial. 272 00:25:22,310 --> 00:25:23,830 We thought maybe it's encoded. 273 00:25:23,830 --> 00:25:32,230 So we started looking for the patterns, and if you're ever doing protocol analysis, it's a really good idea to start breaking down the messages. 274 00:25:32,550 --> 00:25:35,670 If you look at some of these screenshots, you'll see new lines. 275 00:25:36,430 --> 00:25:38,710 But in this case, I was looking for patterns. 276 00:25:38,710 --> 00:25:48,250 We found 94, we found 0D0A, and then we found other strings of messages that were grouped together, and then it was repeating. 277 00:25:48,510 --> 00:25:53,030 There were some F7s, lucky 7s maybe, I don't know. 278 00:25:53,030 --> 00:25:58,330 But you can see I started highlighting things to try to find a pattern and where things started over. 279 00:25:58,590 --> 00:26:05,890 You can see because of the 7s, we were able to roughly get a reset of where the communication started over. 280 00:26:05,890 --> 00:26:09,490 So it wasn't actually just continuing the same message, it was resetting. 281 00:26:11,030 --> 00:26:20,190 You can probably find more patterns than this, but that is not necessarily needed as long as you can make the structure. 282 00:26:20,750 --> 00:26:31,230 We did have a major oops moment though, because when you just decode the text to ASCII, you get ring, ring, ring, connect, no carrier. 283 00:26:31,230 --> 00:26:33,770 Ring, ring, ring, connect, no carrier. 284 00:26:34,510 --> 00:26:35,990 Where was this coming from? 285 00:26:35,990 --> 00:26:38,610 Well, I will give you a hint. 286 00:26:38,610 --> 00:26:40,050 It is the modems. 287 00:26:40,050 --> 00:26:42,770 I guess that's not much of a hint, it's more of just the answer. 288 00:26:42,770 --> 00:26:49,530 But the unknown part, this FFF and 7s, was something interesting. 289 00:26:49,530 --> 00:26:54,770 We couldn't quite figure out what this was, but we figured it was from the ATM. 290 00:26:55,330 --> 00:27:03,010 So when you're looking for patterns, you're trying to find, especially with unknown protocols, protocols generally follow a structure. 291 00:27:03,010 --> 00:27:10,630 Even if they're encrypted, there's usually probably some kind of preamble or repeating pattern. 292 00:27:10,630 --> 00:27:23,930 I broke off the different hex to show you how it looks, and so we were looking for line level to see if maybe there was a pattern like you have to go so many highs before a low. 293 00:27:24,030 --> 00:27:28,010 Looking for a start of packet by the pattern. 294 00:27:28,650 --> 00:27:39,050 This is all logic signaling, so if it's high or it's low, it allows you to really start seeing if maybe there's like a sequence. 295 00:27:39,050 --> 00:27:46,490 You can see with the 077, this of course is a character, but you can see there's a distinct pattern. 296 00:27:46,690 --> 00:27:55,250 And when you divide these by time slots, that's how computers are able to process these and process the signal and respond. 297 00:27:55,250 --> 00:27:58,210 So we were looking for something that a machine might recognize. 298 00:27:58,210 --> 00:28:04,690 We didn't quite see anything, but we kept searching through vendor sites. 299 00:28:04,790 --> 00:28:17,830 The good news is the vendors talk about how this supports amazing encryption, including DES compliant or triple DES encryption and visa certified pin encryption. 300 00:28:17,830 --> 00:28:19,830 So don't worry, it's safe. 301 00:28:19,830 --> 00:28:25,450 But we were trying to find guides and documents and we were really struggling. 302 00:28:25,450 --> 00:28:32,750 And then we found a vendor guide and this vendor guide was not the typical vendor guide. 303 00:28:32,750 --> 00:28:36,450 It was very detailed and it was listed as a draft. 304 00:28:36,910 --> 00:28:38,810 So that was exciting. 305 00:28:38,810 --> 00:28:52,070 From the documentation, it spoke about how the modem connects, it talks about the bit configuration, the parity, and the way the message must start. 306 00:28:52,610 --> 00:28:56,890 So these are all ASCII control characters, STX, ETX, and ENQ. 307 00:28:58,170 --> 00:29:03,890 And specifically, it also spoke about how to configure and reset the ATM. 308 00:29:03,910 --> 00:29:07,190 And we are using, I believe, standard 3. 309 00:29:07,190 --> 00:29:11,850 These EPS link and ST3 link are ones that we didn't use. 310 00:29:11,890 --> 00:29:14,630 ST standard 3 is what we used. 311 00:29:15,190 --> 00:29:27,170 And so we, from researching and being able to, you know, with the breakthrough of the protocol, or the vendor guide, we were able to start figuring out the protocol. 312 00:29:27,490 --> 00:29:44,190 So the standard flow request was terminal call, it'll ring, it sends an inquiry, then we get a request, response, end of transmission, end of transmission, everyone's happy, disconnect. 313 00:29:45,650 --> 00:29:47,330 But how does that work? 314 00:29:47,470 --> 00:29:55,690 Well, we knew that from the vendor guide that it's supposed to do an ENQ to start, so we were sending ENQ and it just ignored us. 315 00:29:55,930 --> 00:30:09,850 But when you start looking online, and it's actually really funny, this was an old FRAC article from 1994, and on the other side of this article was an advertisement for DEF CON 2. 316 00:30:10,470 --> 00:30:14,970 So 28 years later, the FRAC article is relevant again. 317 00:30:14,970 --> 00:30:16,790 It was really cool to see that though. 318 00:30:16,790 --> 00:30:29,130 But based on VisaNet, it turns out that the way you trigger it is you send ENQ, ENQ, ENQ, which would trigger the ATM to respond. 319 00:30:29,610 --> 00:30:31,790 Good, you know, little tidbit. 320 00:30:31,790 --> 00:30:37,510 This was not documented anywhere else, and so once we found this, we were able to get a message. 321 00:30:38,530 --> 00:30:43,690 So this is the message we were seeing, and we were so excited we got a message back. 322 00:30:44,330 --> 00:30:54,170 It's funny, actually, because I'm looking at this message and I can see where the different protocol structure is for the different payment parts and things like that that it's trying to do for the setup. 323 00:30:54,850 --> 00:31:01,570 But this was the message we got back, and we didn't see an ENQ back, we didn't see an ETX, we didn't see a NAC. 324 00:31:01,650 --> 00:31:03,730 So what happened? 325 00:31:03,730 --> 00:31:05,430 It doesn't seem to match this at all. 326 00:31:05,710 --> 00:31:08,730 And well, we were a little concerned. 327 00:31:09,190 --> 00:31:16,270 We started looking at the manual again, and it says that it can operate either in a batch mode where it queues up all the transactions and then sends them all at once. 328 00:31:16,270 --> 00:31:23,030 So if someone wants to do a withdrawal, deposit, and things like that, it'll queue them up until they're ready to do a single transmission and send it over. 329 00:31:23,110 --> 00:31:29,270 Or it can do single mode, which every transaction is a dial-in and request. 330 00:31:29,790 --> 00:31:42,130 We tried both, concerned that maybe we had accidentally got it into batch mode, but the batch mode was unlikely because it requires a keep -alive connection with the payment process. 331 00:31:42,130 --> 00:31:45,810 So it dials in and it keeps sending messages back and forth. 332 00:31:45,810 --> 00:31:49,930 We didn't want to handle that, so we went with the simpler single option. 333 00:31:50,730 --> 00:31:54,070 So we were trying to figure out what's going on. 334 00:31:54,070 --> 00:31:59,070 We started doing parity bits, and it's a challenge. 335 00:31:59,550 --> 00:32:08,110 We were not familiar with the the raw parity bits because we don't really have to deal with it much. 336 00:32:08,130 --> 00:32:14,390 So we were able to identify some characters and find valid stuff, but we weren't sure what was going on. 337 00:32:14,390 --> 00:32:23,930 We tried shifting over, and you can see when you shift a message over, some of the stuff rolls off and you can restructure the message. 338 00:32:23,950 --> 00:32:25,370 But that didn't help. 339 00:32:25,370 --> 00:32:27,470 So it wasn't just a pure shift. 340 00:32:28,630 --> 00:32:37,910 But the question was, why would sending a valid ENQ return a response but not the invalid one that we were getting back? 341 00:32:38,210 --> 00:32:46,470 Well, it turns out with classic protocols at Classic ASCII, only six of the bits are used. 342 00:32:46,470 --> 00:32:48,510 The seventh bit is the parity bit. 343 00:32:48,510 --> 00:32:58,350 The parity bit is allowing it so that you can make sure that a message comes through correctly. 344 00:32:58,950 --> 00:33:07,330 And so in our case, we were able to strip the parity bit and get the correct ASCII code. 345 00:33:07,330 --> 00:33:16,030 Usually the seventh bit, the eighth bit actually, sorry, is not used nowadays. 346 00:33:16,030 --> 00:33:19,230 It's just static, but it can be used. 347 00:33:19,270 --> 00:33:23,710 And so that was how we were getting messed up because it was error detection. 348 00:33:24,430 --> 00:33:28,010 Even or odd, it would either get turned on or off. 349 00:33:28,010 --> 00:33:30,790 So we were seeing some valid characters and some not. 350 00:33:31,250 --> 00:33:35,990 So now we were getting an actual message back where we could actually see the ASCII control characters. 351 00:33:36,190 --> 00:33:42,210 And of course, that was a challenge because we weren't sure what was going on. 352 00:33:42,390 --> 00:33:47,070 We got these messages back, but we were like, huh, there's some blank parts and things like that. 353 00:33:47,290 --> 00:33:50,610 We were trying to empty out certain fields to see what we were doing. 354 00:33:50,910 --> 00:33:54,490 I have actually transcoded this into things that it is. 355 00:33:54,490 --> 00:33:55,690 This is the terminal ID. 356 00:33:55,690 --> 00:34:00,130 This is a field separator, field separator, the transaction code. 357 00:34:00,710 --> 00:34:08,350 And so we were able to start building up like what was what by editing the ATM configuration to send out specific messages. 358 00:34:10,330 --> 00:34:13,650 Of course, things still didn't work. 359 00:34:13,830 --> 00:34:17,930 There was a LRC at the end for parity. 360 00:34:18,110 --> 00:34:21,410 It was trying to make sure that the messages were good. 361 00:34:21,410 --> 00:34:25,410 It's essentially like a CRC or a validation bit. 362 00:34:27,150 --> 00:34:36,070 And I got a bad implementation that I'd used to implement. 363 00:34:36,190 --> 00:34:39,930 And it was overly complex and didn't work. 364 00:34:39,930 --> 00:34:44,030 So we were sending the wrong LRC. 365 00:34:44,150 --> 00:34:52,670 What we ended up doing was going and finding another reference guide to make sure we were correct. 366 00:34:52,890 --> 00:34:55,830 And there's a couple of ways you can do this. 367 00:34:55,830 --> 00:35:04,430 If the field is small, you can make a table, a lookup table to make sure that you have all the values based on a specific calculation. 368 00:35:04,430 --> 00:35:09,190 Or you can do what in this case, and that would be like CRC. 369 00:35:09,270 --> 00:35:13,190 In this case, it's even simpler. 370 00:35:13,190 --> 00:35:14,450 It's just bit math. 371 00:35:14,670 --> 00:35:18,210 And so we were able to get everything out with that. 372 00:35:18,310 --> 00:35:24,050 And once we got this, with the invalid one, we would get an ACK. 373 00:35:24,130 --> 00:35:27,670 And once we sent the valid one with the message, we got an ACK. 374 00:35:27,670 --> 00:35:30,710 So that was a nice progress. 375 00:35:30,890 --> 00:35:31,770 So how does it work? 376 00:35:31,770 --> 00:35:34,770 Now we're talking to the ATM and that's really exciting. 377 00:35:34,770 --> 00:35:40,150 Well, the ATM does a host download table request. 378 00:35:40,150 --> 00:35:50,110 This request gives the ATM everything it needs, including encryption keys, charge amount, and a few other values. 379 00:35:50,110 --> 00:35:56,870 It supports up to triple DES with left and right key combos, so you could do multiple hosts. 380 00:35:56,870 --> 00:35:59,450 So not everyone knows the whole key. 381 00:36:00,110 --> 00:36:02,110 It's a 64-bit key. 382 00:36:02,270 --> 00:36:06,690 However, what we found is you can also just send it to all zeros, which is great. 383 00:36:06,690 --> 00:36:12,650 And so when the ATM loads this up, everything is just zeros. 384 00:36:12,650 --> 00:36:13,930 And it's like, okay, cool. 385 00:36:15,490 --> 00:36:17,790 And that makes it really easy to decrypt. 386 00:36:18,610 --> 00:36:27,930 There is an actual standard, the ANSI standard for pin management security, X.9.8. 387 00:36:28,950 --> 00:36:46,510 And it actually is where this comes from, that the pin codes will be 64 bits in length, each nibble being stored as an ASCII value, 0 through 9, A through F, as a hex representing the hex characters left to right. 388 00:36:46,510 --> 00:36:48,030 So that was interesting. 389 00:36:48,030 --> 00:36:49,750 That was actually a well-documented piece. 390 00:36:49,750 --> 00:36:51,330 You can actually see it here. 391 00:36:51,330 --> 00:36:55,030 This is the protocol handler that we wrote. 392 00:36:55,090 --> 00:36:59,310 And you can see the messages and sending messages back. 393 00:36:59,930 --> 00:37:02,490 It was actually a very basic message handling. 394 00:37:02,490 --> 00:37:08,550 You can see below the field separate terminal ID, code, encryption, field separator. 395 00:37:09,230 --> 00:37:17,710 And so this is all the messages, the data, and breaking it off, and where we would have dangling bits and bytes. 396 00:37:17,710 --> 00:37:24,230 So we were dealing with the extra characters and trying to find the replies. 397 00:37:24,490 --> 00:37:27,910 And we would always get either a success or a failure. 398 00:37:27,910 --> 00:37:33,950 And that allowed us to keep moving forward because it was very simple in response. 399 00:37:33,950 --> 00:37:34,450 Did it work? 400 00:37:34,450 --> 00:37:34,790 Nope. 401 00:37:34,790 --> 00:37:35,930 Okay, let's keep trying. 402 00:37:35,930 --> 00:37:37,610 So that was helpful. 403 00:37:37,970 --> 00:37:45,630 You can see at the end, we got the ASCII character, the control character. 404 00:37:46,210 --> 00:37:48,690 But it was still sending a failure. 405 00:37:48,770 --> 00:37:53,550 So we also needed to send a second message. 406 00:37:53,590 --> 00:38:03,410 After the host download, we needed to send the host totals, which gives the ATM the information about the date, the time, the fees, and a few other fields. 407 00:38:03,950 --> 00:38:14,250 But because we were having to handle these messages afterward, we realized that we have to build a state machine. 408 00:38:14,250 --> 00:38:23,410 So state machines, for those of you who are not familiar, are a very fundamental of computer science and building. 409 00:38:23,410 --> 00:38:38,130 It allows you to build essentially code that works through a flow and allows us to take steps to either go back to the beginning, reset, or follow specific conditions. 410 00:38:38,610 --> 00:38:44,330 It allows us to scale with new protocols and messages and see what's going on. 411 00:38:44,330 --> 00:38:50,550 So from the start, we receive either nothing or we get a clear parity bit. 412 00:38:50,690 --> 00:38:54,970 Then complete the handshake, start the timer. 413 00:38:54,990 --> 00:38:59,850 If everything does not succeed within 30 seconds, reset back to here and wait for a message. 414 00:38:59,950 --> 00:39:04,610 If it's success or failure, failure, you stop, and the message sends a failure. 415 00:39:04,790 --> 00:39:10,450 With success, we have a few things that we have to check for the messages. 416 00:39:10,470 --> 00:39:18,930 And then the message type, we can send it off, see what it is, and send it to our payment processor. 417 00:39:19,130 --> 00:39:27,130 The original code looks something like this, where we are hand constructing the message and looking for the parity to make sure everything worked. 418 00:39:27,130 --> 00:39:34,190 And I do love the comment at the beginning, encryption keys should be changed from static at some point. 419 00:39:34,230 --> 00:39:35,750 Probably a good idea. 420 00:39:37,530 --> 00:39:48,850 But from that big block of text to something very simple, where it just is process message, if everything works, send it to the handler and get this handler's response. 421 00:39:49,930 --> 00:40:07,410 Very much cleaner, and it allows us to do things like this, where we can see unknown messages, unknown parts, process the messages, and you can actually see here in this message the components that actually make up the terminal ID transaction code, the amount, 422 00:40:07,410 --> 00:40:12,950 the pin block, and then all the other data that is associated. 423 00:40:12,950 --> 00:40:14,770 And so then we can send it back. 424 00:40:15,410 --> 00:40:22,290 So once you get an ATM working, you know, you need to get everything working because it's out of service. 425 00:40:22,290 --> 00:40:34,610 So once we were able to get the ATMs in service, we started working on a protocol to allow the ATMs to communicate to us in a meaningful manner. 426 00:40:36,210 --> 00:40:53,130 So this one is the first successful message that we had, and you will see in a second that it actually... I don't know if you can hear it dialing, but it makes the actual dial-up noises and then thinks for a second, and then now it's going to spit out the money. 427 00:40:55,150 --> 00:40:58,990 And so that was our first successful message through. 428 00:40:59,150 --> 00:41:01,810 The problem was, again, we were on a budget. 429 00:41:01,810 --> 00:41:04,590 This is not real money, this is play money. 430 00:41:05,110 --> 00:41:11,050 And the ATMs are designed for a specific fabric type and weight, so it was shredding all our fake money. 431 00:41:11,130 --> 00:41:22,610 And we found out that Jamaican currency is the perfect format for emulating real money because it's very cheap, for us at least, and it doesn't get shredded. 432 00:41:23,170 --> 00:41:31,470 So the end result was we support, and we built out support, I should say, for over 20 different transaction types. 433 00:41:31,990 --> 00:41:35,590 We actually wrote 10 types. 434 00:41:36,210 --> 00:41:46,510 And then there's success messages, failure messages, error, where we had special response handlers for those. 435 00:41:46,570 --> 00:41:51,990 We only read one track on a two-track card. 436 00:41:51,990 --> 00:41:55,890 Usually there's two tracks, one with the card number and then some name information. 437 00:41:55,890 --> 00:41:57,110 Only track one is red. 438 00:41:57,110 --> 00:42:01,290 That's not a feature of us, we can't read the second track really. 439 00:42:01,350 --> 00:42:09,550 It only is coming through with the ATM, so we only can read what it provides. 440 00:42:09,770 --> 00:42:11,990 The hard part was actual padding. 441 00:42:11,990 --> 00:42:26,030 It's a zero padded number, so you have three sets of pairs of zeros, so six in total, and you have to move it over to either get cents, dollars, or a larger amount. 442 00:42:28,070 --> 00:42:37,790 When you don't pad it correctly, this was all static when this was done, you can either get negative numbers or cents. 443 00:42:37,790 --> 00:42:43,730 So this was a ledger balance of negative amount, because you input all these values. 444 00:42:43,750 --> 00:42:47,270 Each one of these is a field back from the payment processor. 445 00:42:47,270 --> 00:42:50,730 It's not actually necessarily counted in the ATM. 446 00:42:50,730 --> 00:43:01,610 Well, the fees are counted in the ATM, but everything else like ledger balance, dispense, requested fee, those are all responded back as the ATM. 447 00:43:02,110 --> 00:43:04,530 So here's a successful run. 448 00:43:04,530 --> 00:43:10,710 This was actually at the competition, so I'm gonna mute it because nobody can hear that. 449 00:43:10,870 --> 00:43:19,270 So she successfully did the enter to send the message, and then you could see it where it took a second and the screen updated and the money came out. 450 00:43:20,610 --> 00:43:31,470 So at the end of this, what we want to do is switch gears a little bit and ask ourselves, why are, you know, 16 to 20 year old ATMs still in use? 451 00:43:31,830 --> 00:43:34,930 Why is the protocol still the same way? 452 00:43:36,070 --> 00:43:45,830 I know we're going to EMV on a lot of these, and that's a much better protocol, but as you were seeing at the beginning, it's still Windows CE 6, which is end of life. 453 00:43:45,950 --> 00:43:54,150 Those ATMs are still going to be in use for many years, and it is an expensive upgrade at that. 454 00:43:54,570 --> 00:44:04,210 So, you know, it's something to think about, that these ATMs are still out there, and that people are putting their banking details into these systems. 455 00:44:05,010 --> 00:44:15,830 You know, there's, there is some security, but Triple Des is not exactly known at DefCon for being particularly good, let alone anywhere else. 456 00:44:15,830 --> 00:44:19,270 So, you know, we really need to think about that. 457 00:44:19,810 --> 00:44:33,970 And when designing protocols, yeah, these were designed in the late 90s, early 2000s, but we need to be making security first focus protocols for especially banking systems. 458 00:44:34,630 --> 00:44:36,330 And we don't. 459 00:44:36,350 --> 00:44:44,050 You know, there's modern stuff, let's use maybe at least HTTP instead of unencrypted dial-up. 460 00:44:44,050 --> 00:44:49,690 Not much better, but there's HTTPS, there's WebSocket, which should be used and can be used. 461 00:44:50,090 --> 00:45:01,830 But most of all, make the modules upgradable and cheap, because at the end of the day, if you give someone an easy way to upgrade their components, they will. 462 00:45:02,350 --> 00:45:05,670 And they will use the security that is provided to them. 463 00:45:05,830 --> 00:45:12,290 Most people are not security experts, so that would be a good point of starting. 464 00:45:12,370 --> 00:45:14,430 Anyway, I'm happy to answer questions. 465 00:45:14,430 --> 00:45:21,870 I will be wandering around the village, maybe waving at this point. 466 00:45:21,870 --> 00:45:30,050 If not, you can find both of us on Twitter, you can ask there, and you can download the ATM processor firmware yourself. 467 00:45:30,050 --> 00:45:35,530 It uses OpenWorld Image Builder to build a custom image. 468 00:45:35,710 --> 00:45:47,710 All the code is based on Python, so you can get that working, it has the web interface, and you can go from there if you happen to have the specific ATM or series of ATMs. 469 00:45:48,010 --> 00:45:55,730 So with that, if there's any questions, feel free to ask me, and then if not, contact us. 470 00:45:55,850 --> 00:45:57,370 All righty, thank you!