1 00:00:00,000 --> 00:00:10,980 Good morning, everyone. It's a long walk over here. This is Breaking the Back End, DEF CON China 1.0. Congratulations. 2 00:00:14,120 --> 00:00:19,860 My name is Gregory Pickett with Hellfire Security. I'm part of the Cybersecurity Operations Group. 3 00:00:22,020 --> 00:00:27,140 Brief overview of what we'll be talking about today. I'm going to start with transit systems. 4 00:00:27,140 --> 00:00:34,140 Just a brief history, honestly, of several different talks, the major talks that we've seen so far. 5 00:00:35,020 --> 00:00:36,840 And then, of course, we'll talk about our target. 6 00:00:38,820 --> 00:00:45,180 After that, we're going to reverse engineer that target. We're going to learn a little bit about how it works, how that system works. 7 00:00:46,260 --> 00:00:54,100 Then we'll talk about the discoveries, what we discovered through that reverse engineering, and then the exploit developed from it. 8 00:00:54,720 --> 00:00:57,120 And, of course, always at the end of talks, lessons learned. 9 00:00:59,140 --> 00:01:01,980 So we've had a couple talks over the years. 10 00:01:03,040 --> 00:01:09,980 The anatomy of a subway hack in 2008 was taking traditional attacks and applying them to a subway station. 11 00:01:11,380 --> 00:01:15,100 Bypassing physical security, hacking the wired and wireless network. 12 00:01:16,580 --> 00:01:18,400 Actually, oops, I got that backwards. 13 00:01:18,520 --> 00:01:23,480 That was bypassing physical security and then hacking the terminal. 14 00:01:23,980 --> 00:01:26,660 The terminal is set up as a kiosk. 15 00:01:28,380 --> 00:01:34,800 So the next one after that was the NFC subway hack of 2012, where you're looking at attacking the hardware. 16 00:01:35,380 --> 00:01:40,440 There's a read-only bit. I think there were a couple different bits on that card because they weren't set. 17 00:01:40,780 --> 00:01:44,700 They were writable. They were able to replenish that stored value card. 18 00:01:46,580 --> 00:01:53,100 Then we had the how to hack all the transport networks of a country in 2012, going back to traditional attacks. 19 00:01:53,500 --> 00:01:55,700 This time around, it was social engineering. 20 00:01:55,920 --> 00:01:57,120 This one was the... 21 00:01:57,120 --> 00:02:03,180 Attacking the wired and wireless networks, and I believe several what-ifs, as far as attacking the encryption. 22 00:02:03,960 --> 00:02:06,180 What if we did this? What if we did that? 23 00:02:07,220 --> 00:02:10,000 Could we get the keys to write to the ticket? 24 00:02:10,680 --> 00:02:16,980 And then the breaking Korea transit card with side-channel attack in 2017, going back to attack the hardware. 25 00:02:17,440 --> 00:02:24,040 NFC again, doing side-channel attacks to get the secret key so that you could then write to that card and replenish it. 26 00:02:24,560 --> 00:02:25,040 Okay? 27 00:02:27,120 --> 00:02:27,820 This is a little different. 28 00:02:28,560 --> 00:02:29,240 Not illegal. 29 00:02:31,380 --> 00:02:32,780 We aren't sneaking into the station. 30 00:02:33,020 --> 00:02:39,660 We aren't hacking their terminals or we aren't social engineering anyone or attacking the wired or wireless network. 31 00:02:40,540 --> 00:02:42,160 And it's also not about the hardware. 32 00:02:43,040 --> 00:02:44,440 We aren't cracking anyone's encryption. 33 00:02:44,700 --> 00:02:48,360 We aren't cloning the mag stripe, the RFID, or in most cases, of course, NFC. 34 00:02:51,580 --> 00:02:53,520 This is about flaws in application logic. 35 00:02:54,280 --> 00:02:55,280 There's cloning involved. 36 00:02:55,600 --> 00:02:56,360 I will admit that. 37 00:02:56,360 --> 00:03:00,540 We do clone, but that's not the vulnerability that we're exploiting. 38 00:03:01,120 --> 00:03:05,780 Instead, we're using AppSec to attack a complex, multilayered, real-world solution. 39 00:03:07,100 --> 00:03:08,160 Lots of moving parts. 40 00:03:08,300 --> 00:03:08,980 We'll see where they break. 41 00:03:11,660 --> 00:03:13,860 So our target is the elevated train. 42 00:03:14,260 --> 00:03:18,200 That's the Bangkok Mass Transit System, or BTS, in Bangkok, Thailand. 43 00:03:19,220 --> 00:03:23,320 Elevated rapid transit system there serves the greater Bangkok area, 44 00:03:24,000 --> 00:03:26,020 operated by the BITSC. 45 00:03:26,100 --> 00:03:27,400 Actually, there are several different companies involved. 46 00:03:27,920 --> 00:03:29,720 Holding company, holding company, holding company. 47 00:03:30,380 --> 00:03:32,240 43 stations along two lines. 48 00:03:32,640 --> 00:03:34,200 I think that's from the website. 49 00:03:34,500 --> 00:03:36,260 And they've been expanding. 50 00:03:36,360 --> 00:03:37,920 So there's probably a couple more stations. 51 00:03:38,360 --> 00:03:40,260 They have lots of different lines planned. 52 00:03:41,280 --> 00:03:42,280 So more stations. 53 00:03:43,540 --> 00:03:49,360 The tickets the system uses is a sort of value card that's based off NFC. 54 00:03:49,540 --> 00:03:52,580 And then all-day pass and a single-journey ticket. 55 00:03:52,580 --> 00:03:54,580 Both using the mag stripe. 56 00:03:55,920 --> 00:03:57,960 And that is what we'll be looking at. 57 00:03:58,440 --> 00:04:01,420 Those tickets have two mag stripes each. 58 00:04:02,440 --> 00:04:03,680 There's a hole through one mag stripe. 59 00:04:04,140 --> 00:04:07,380 And it's about 0.27 millimeters thick. 60 00:04:08,640 --> 00:04:11,540 You're not going to go to this corner store and order these. 61 00:04:11,840 --> 00:04:12,860 You're not going to go to a warehouse. 62 00:04:13,120 --> 00:04:14,160 You're not going to open a catalog. 63 00:04:14,720 --> 00:04:15,940 So not easy to get. 64 00:04:18,820 --> 00:04:21,320 There are our tickets there. 65 00:04:21,320 --> 00:04:22,100 You can see. 66 00:04:22,760 --> 00:04:24,840 Okay, I was very excited that they have a laser pointer. 67 00:04:26,900 --> 00:04:28,060 I see the hole there. 68 00:04:28,140 --> 00:04:29,500 And there's actually a little hole there. 69 00:04:32,040 --> 00:04:33,560 So top is the single journey. 70 00:04:33,720 --> 00:04:35,700 And the bottom is the all-day pass. 71 00:04:38,600 --> 00:04:39,120 Very thin. 72 00:04:39,300 --> 00:04:40,340 I wanted to stress that. 73 00:04:43,220 --> 00:04:44,360 So we have the gates there. 74 00:04:44,960 --> 00:04:45,760 When you enter. 75 00:04:45,860 --> 00:04:46,420 And the two. 76 00:04:46,920 --> 00:04:50,480 I'm going to make use of this laser pointer here a lot. 77 00:04:50,480 --> 00:04:52,680 So the two there are set up for enter. 78 00:04:52,800 --> 00:04:53,500 Little arrows there. 79 00:04:54,140 --> 00:04:55,440 You slide it in a slot. 80 00:04:55,880 --> 00:04:56,820 It gets processed. 81 00:04:57,740 --> 00:04:58,700 Pops out at the top. 82 00:04:59,460 --> 00:05:00,260 Gate opens up. 83 00:05:00,300 --> 00:05:00,720 You walk through. 84 00:05:01,340 --> 00:05:02,780 And the same thing when you exit. 85 00:05:03,240 --> 00:05:04,960 You're going to go ahead and slide it in there. 86 00:05:05,100 --> 00:05:06,560 It's actually going to capture it at that time. 87 00:05:06,780 --> 00:05:07,680 The gate opens up. 88 00:05:07,780 --> 00:05:08,800 And you get to leave. 89 00:05:10,340 --> 00:05:10,700 Okay. 90 00:05:11,040 --> 00:05:11,720 So why them? 91 00:05:12,360 --> 00:05:13,700 Well, mag stripe, really. 92 00:05:14,260 --> 00:05:15,780 You know, it's something very, very old. 93 00:05:16,380 --> 00:05:17,780 Seemed then very, very interesting. 94 00:05:19,180 --> 00:05:20,020 And, of course. 95 00:05:20,020 --> 00:05:21,820 Of all the issues out there. 96 00:05:21,940 --> 00:05:24,620 You know, mag stripe is very popular for having quite a number of them. 97 00:05:25,480 --> 00:05:28,660 Almost as many, you know, famous as windows. 98 00:05:30,480 --> 00:05:31,880 So you have all these questions. 99 00:05:31,980 --> 00:05:32,600 You talk about it. 100 00:05:32,640 --> 00:05:33,160 You talk about it. 101 00:05:33,220 --> 00:05:35,680 So, you know, at some point in time you have to put up. 102 00:05:35,740 --> 00:05:36,580 If they say you're shut up. 103 00:05:37,040 --> 00:05:39,240 So I wanted to answer these questions for myself. 104 00:05:40,620 --> 00:05:41,240 My friends. 105 00:05:41,500 --> 00:05:42,740 And really just get this done. 106 00:05:42,800 --> 00:05:44,920 Get it out of the way so I can move on to other things. 107 00:05:47,680 --> 00:05:48,000 Okay. 108 00:05:48,000 --> 00:05:51,380 So we have to have some equipment to read these tickets. 109 00:05:51,460 --> 00:05:54,460 That's the first thing you really are able to do and you want to do is read those tickets. 110 00:05:54,920 --> 00:05:55,840 So you get the equipment. 111 00:05:55,940 --> 00:05:58,520 It's a standard reader rider that I ended up using. 112 00:05:59,300 --> 00:06:01,080 And I went through lots of different equipment. 113 00:06:01,560 --> 00:06:04,360 As my understanding changed, so did the equipment that I used. 114 00:06:04,640 --> 00:06:08,220 But I ended up here with a standard reader rider manufactured in China. 115 00:06:08,600 --> 00:06:09,120 Thank you. 116 00:06:10,400 --> 00:06:11,100 It does standards. 117 00:06:11,700 --> 00:06:11,920 All right. 118 00:06:11,940 --> 00:06:14,960 So it reads it and will decode it according to the standards. 119 00:06:15,200 --> 00:06:17,520 Or you can do a raw read where it just dumps. 120 00:06:17,520 --> 00:06:19,200 What's on the card. 121 00:06:19,740 --> 00:06:20,520 What's on the ticket. 122 00:06:21,300 --> 00:06:22,020 Errors are rare. 123 00:06:22,640 --> 00:06:24,600 It handled that hole really well. 124 00:06:25,420 --> 00:06:29,020 Originally I thought that hole was kind of a 1980s style copy protection. 125 00:06:30,400 --> 00:06:33,140 I don't think maybe many of you are old enough to know what that is. 126 00:06:33,500 --> 00:06:36,860 Essentially what they would do is introduce an error or damage. 127 00:06:36,980 --> 00:06:42,760 They would damage a sector on a disc so that if the utility from the OS would attempt to copy it, it would fail. 128 00:06:42,900 --> 00:06:43,640 The copy would fail. 129 00:06:43,720 --> 00:06:44,800 You couldn't then copy the disc. 130 00:06:44,860 --> 00:06:46,320 You couldn't copy the game. 131 00:06:46,940 --> 00:06:54,820 So I'm thinking they're introducing this hole so that essentially if you tried to use it with a standard reader rider, it would just fail and you couldn't get any of the data off there. 132 00:06:55,520 --> 00:07:01,680 It turns out it was just to make sure that the ticket was facing the right way. 133 00:07:02,400 --> 00:07:05,560 And essentially oriented the right way and that the mag stripes were down. 134 00:07:06,460 --> 00:07:06,900 Okay. 135 00:07:06,960 --> 00:07:09,740 So I could end up just using a standard reader rider. 136 00:07:10,280 --> 00:07:11,640 And very reliable performance. 137 00:07:12,240 --> 00:07:13,240 Very reliable performance. 138 00:07:14,960 --> 00:07:16,200 It's important that you have. 139 00:07:16,700 --> 00:07:17,340 Reliable performance. 140 00:07:17,540 --> 00:07:18,800 That way you get reliable data. 141 00:07:19,040 --> 00:07:22,640 And that way your analysis goes much, much easier. 142 00:07:23,720 --> 00:07:24,140 All right. 143 00:07:24,160 --> 00:07:27,940 So when you're sitting down with this reader and you're reading the tickets, you have a lot of questions. 144 00:07:28,340 --> 00:07:29,740 You know, data location. 145 00:07:30,380 --> 00:07:30,920 Encoding schemes. 146 00:07:31,920 --> 00:07:35,440 How does the data change as the ticket's used, as it goes through the system? 147 00:07:36,400 --> 00:07:39,100 And then ultimately you're looking to find out what that data means. 148 00:07:40,060 --> 00:07:45,340 And if you're seeking to break that system, you're trying to get it to error or manipulate it somehow. 149 00:07:45,340 --> 00:07:51,480 You want to see what the system response is to data tampering, to repeating states or out of order state transitioning. 150 00:07:52,040 --> 00:07:55,640 So your repeating state, you take a ticket that you've used to enter. 151 00:07:55,720 --> 00:07:57,300 Can you enter with it again? 152 00:07:57,620 --> 00:08:02,560 If you attempt to maybe take a ticket you've purchased but you haven't used yet, can you exit with it? 153 00:08:02,820 --> 00:08:03,940 How does the system respond? 154 00:08:07,960 --> 00:08:08,880 So you sit down. 155 00:08:08,960 --> 00:08:09,360 You read that. 156 00:08:10,040 --> 00:08:11,320 And you're going to read the mag stripe. 157 00:08:11,540 --> 00:08:13,320 And you're going to decode the data. 158 00:08:13,320 --> 00:08:13,340 And you're going to read up. 159 00:08:14,700 --> 00:08:16,220 There it is in all its glory. 160 00:08:17,160 --> 00:08:18,400 Just in a hex there. 161 00:08:18,760 --> 00:08:22,220 We have the two mag stripes each with three tracks. 162 00:08:25,440 --> 00:08:27,840 So I attempted to decode that using the standards. 163 00:08:28,060 --> 00:08:30,720 The International Organization for Standardization. 164 00:08:31,460 --> 00:08:33,080 There's lots in that standard. 165 00:08:33,200 --> 00:08:36,700 But it boils down to six character sets and four-bit character sets. 166 00:08:37,200 --> 00:08:38,600 Some with parity and some without. 167 00:08:39,200 --> 00:08:41,460 I attempted to decode that both forwards and backwards. 168 00:08:41,460 --> 00:08:44,160 And I did it many, many, many times. 169 00:08:46,160 --> 00:08:47,440 I'm always concerned about my work. 170 00:08:47,480 --> 00:08:48,580 I'm always double checking my work. 171 00:08:48,660 --> 00:08:50,200 So I wanted to do it over and over again. 172 00:08:50,240 --> 00:08:51,140 Make sure I'm not making mistakes. 173 00:08:51,620 --> 00:08:52,740 And I did it with software. 174 00:08:52,860 --> 00:08:54,820 I used the software that came with the reader. 175 00:08:55,000 --> 00:08:55,920 And I also did it manually. 176 00:08:56,540 --> 00:08:57,440 Now there's two reasons. 177 00:08:58,520 --> 00:09:00,100 I went through lots of different equipment. 178 00:09:00,200 --> 00:09:02,720 And some of the equipment was not the most accurate. 179 00:09:02,800 --> 00:09:03,560 It wasn't most reliable. 180 00:09:03,960 --> 00:09:07,120 So I wanted to make sure that the software was doing it properly. 181 00:09:07,300 --> 00:09:08,100 It was decoding properly. 182 00:09:09,420 --> 00:09:10,640 And there's an added benefit. 183 00:09:11,460 --> 00:09:14,020 If you go over that data again and again and again, 184 00:09:14,240 --> 00:09:16,320 you start to... 185 00:09:16,320 --> 00:09:17,120 There's patterns, right? 186 00:09:17,260 --> 00:09:18,420 There's patterns that you can see. 187 00:09:19,400 --> 00:09:21,140 And you get to understand that data. 188 00:09:21,280 --> 00:09:25,040 And hopefully by doing so, there's some insights that you can come to 189 00:09:25,040 --> 00:09:26,640 as you're doing the work. 190 00:09:28,280 --> 00:09:31,100 So after doing this again and again and again, 191 00:09:31,360 --> 00:09:34,080 I finally decided that maybe it wasn't using the standards. 192 00:09:34,700 --> 00:09:36,960 Maybe it wasn't encoded at all. 193 00:09:37,240 --> 00:09:38,440 Maybe it was just raw data. 194 00:09:38,980 --> 00:09:40,020 So let's see. 195 00:09:42,040 --> 00:09:44,000 Now when you're going to do your analysis, 196 00:09:45,100 --> 00:09:47,580 you want to reduce the amount of work that you're going to do. 197 00:09:48,600 --> 00:09:50,120 So I'm not a professional. 198 00:09:50,620 --> 00:09:53,300 So all of this is just self-taught. 199 00:09:53,300 --> 00:09:56,340 So if I'm getting anything wrong, let me know. 200 00:09:56,620 --> 00:09:58,380 But I did see a lot of duplication. 201 00:10:00,360 --> 00:10:04,600 So if it's just duplication, I don't need to understand it, right? 202 00:10:04,720 --> 00:10:06,180 It's just something that's duplicated somewhere else. 203 00:10:07,120 --> 00:10:10,560 So I can immediately eliminate these big sections here. 204 00:10:10,560 --> 00:10:14,460 It's the same data over again. 205 00:10:14,560 --> 00:10:16,400 So it leaves me with just these four sections here. 206 00:10:17,520 --> 00:10:22,520 And I didn't need to know this either because, you know, talking about insights, 207 00:10:22,780 --> 00:10:27,540 I realized by looking at that enough times that it's 74. 208 00:10:27,820 --> 00:10:28,180 Whoops. 209 00:10:28,340 --> 00:10:28,880 Go back. 210 00:10:29,520 --> 00:10:30,220 Wrong button. 211 00:10:30,940 --> 00:10:33,660 That is essentially 100 plus the ticket price. 212 00:10:34,060 --> 00:10:38,440 So this was basically a 16-bot single journey ticket. 213 00:10:38,600 --> 00:10:40,200 And that was 100 plus. 214 00:10:41,220 --> 00:10:42,100 16, 116. 215 00:10:42,940 --> 00:10:48,280 So I knew what that was right away based on all that time going over and over again, that data. 216 00:10:48,820 --> 00:10:53,160 So I automatically knew what that was, so I didn't need to worry about that. 217 00:10:53,220 --> 00:10:54,420 I just focused on these. 218 00:10:55,240 --> 00:10:56,180 I'm going to keep doing that. 219 00:10:56,240 --> 00:10:56,800 Hopefully not. 220 00:10:57,300 --> 00:10:58,640 Those four blocks right there. 221 00:11:01,940 --> 00:11:07,760 Now, looking at that, seeking to understand it, I realize there's no encryption. 222 00:11:08,620 --> 00:11:09,580 It's not all different. 223 00:11:10,620 --> 00:11:11,420 So there's no encryption. 224 00:11:12,420 --> 00:11:13,360 There's no parity checks. 225 00:11:13,480 --> 00:11:18,560 If you break out those bits into little blocks and you calculate parity and you see, 226 00:11:18,660 --> 00:11:22,280 does that match what you have on that ticket, it's not there. 227 00:11:22,980 --> 00:11:23,980 Same thing with LRC. 228 00:11:24,800 --> 00:11:25,980 And there are no timestamps. 229 00:11:26,320 --> 00:11:30,860 If you purchased one ticket, you waited 10 seconds, and you purchased another ticket, 230 00:11:31,520 --> 00:11:33,440 none of those values incremented by 10. 231 00:11:37,800 --> 00:11:40,540 So that means you're going to have to go into the field. 232 00:11:41,160 --> 00:11:42,780 You have to run that through the system. 233 00:11:43,740 --> 00:11:44,940 You're going to have to make changes. 234 00:11:45,560 --> 00:11:48,600 Each time you go through the system, you're going to vary that input. 235 00:11:49,980 --> 00:11:53,140 You're going to go through one station, a particular dispenser. 236 00:11:53,440 --> 00:11:59,800 Then you're going to purchase from a particular station from a particular dispenser. 237 00:12:00,000 --> 00:12:04,340 Then you're going to go ahead and use that ticket in a particular station with a particular turn style. 238 00:12:05,200 --> 00:12:06,960 And you do that different each time. 239 00:12:07,040 --> 00:12:10,200 Vary one input variable and then see how that changes. 240 00:12:10,200 --> 00:12:13,140 Each time you're using it to identify not meaning. 241 00:12:16,640 --> 00:12:20,000 After collecting lots of these tickets, I had some additional insight here. 242 00:12:21,240 --> 00:12:24,620 That little section there, the orange section, never changes. 243 00:12:27,900 --> 00:12:28,940 So that was good. 244 00:12:28,980 --> 00:12:29,960 I didn't need to worry about that then. 245 00:12:30,540 --> 00:12:33,980 If it's not changing, I'd have a hard time understanding what the meaning was going to be, 246 00:12:34,020 --> 00:12:34,880 so I wouldn't worry about it. 247 00:12:35,880 --> 00:12:39,440 And this little section here, while this does change from ticket to ticket, 248 00:12:41,260 --> 00:12:43,380 changes as the ticket is used. 249 00:12:43,460 --> 00:12:44,300 That little section there. 250 00:12:44,920 --> 00:12:52,440 I can't see the green, but it's actually blue up there. 251 00:12:53,160 --> 00:12:55,800 That little section changes as the ticket is used. 252 00:12:58,040 --> 00:13:00,820 Now, as I observed those changes, this is what I found. 253 00:13:02,480 --> 00:13:05,180 Each ticket has a GUID associated with it. 254 00:13:05,260 --> 00:13:06,660 It kind of rolls down there. 255 00:13:06,880 --> 00:13:07,820 And the location. 256 00:13:08,440 --> 00:13:10,180 Initially, it is in a dispenser. 257 00:13:10,200 --> 00:13:12,720 And there's a GUID associated with its arrival there. 258 00:13:13,680 --> 00:13:19,400 When the ticket moves, that location is updated to a turnstile. 259 00:13:19,800 --> 00:13:21,840 And there's a GUID associated with its arrival there. 260 00:13:25,800 --> 00:13:29,920 When the ticket moves, it also changes state. 261 00:13:30,400 --> 00:13:32,980 Going from issued to used to collected. 262 00:13:33,620 --> 00:13:37,360 When you buy it, it's in a dispenser there. 263 00:13:37,760 --> 00:13:38,300 Underline. 264 00:13:40,060 --> 00:13:41,140 It's in the issued state. 265 00:13:41,980 --> 00:13:44,600 When you enter, it goes through a turnstile. 266 00:13:45,100 --> 00:13:46,100 Little turnstile there. 267 00:13:46,640 --> 00:13:47,540 It's in the used state. 268 00:13:48,040 --> 00:13:50,500 When you exit, it's captured by a turnstile. 269 00:13:51,840 --> 00:13:53,160 And then it's in the collected state. 270 00:13:56,940 --> 00:13:58,580 Some additional things I learned. 271 00:13:59,040 --> 00:14:02,420 For all-day passes, the known section, or the 100-plus price, 272 00:14:02,620 --> 00:14:04,260 is used to track trips taken. 273 00:14:04,920 --> 00:14:08,020 The price of that all-day pass is 140 baht. 274 00:14:08,640 --> 00:14:09,580 So it's 240. 275 00:14:10,160 --> 00:14:14,360 So when you take one trip, it's 239, then 238, and then 237. 276 00:14:15,160 --> 00:14:17,460 And there is a different never changes for all-day passes. 277 00:14:17,700 --> 00:14:20,700 Now, this should have struck me earlier. 278 00:14:20,940 --> 00:14:22,760 But unfortunately, I didn't think about it. 279 00:14:22,800 --> 00:14:25,740 It just didn't hit me until after my slides were finalized. 280 00:14:26,080 --> 00:14:28,700 But that would then appear to be a ticket type. 281 00:14:29,700 --> 00:14:32,660 That little section there ends up looking like a ticket type. 282 00:14:36,740 --> 00:14:37,140 Okay. 283 00:14:37,840 --> 00:14:39,220 There's also some handling rules. 284 00:14:39,440 --> 00:14:43,160 To enter, the ticket must have previously been in a collected state. 285 00:14:43,280 --> 00:14:44,860 It would have been sitting in a turnstile someplace, 286 00:14:45,400 --> 00:14:48,520 taken out, brought around, put in that dispenser. 287 00:14:48,600 --> 00:14:50,360 So it's previously in a collected state, 288 00:14:51,300 --> 00:14:55,180 comes out of the dispenser, now in an issued state. 289 00:14:56,760 --> 00:14:58,720 You can use that then, that ticket, to enter. 290 00:14:59,420 --> 00:15:04,200 To exit, the ticket must then be, after that point, in a used state. 291 00:15:05,640 --> 00:15:06,800 Very simple handling rules. 292 00:15:10,540 --> 00:15:10,940 Okay. 293 00:15:12,440 --> 00:15:14,940 Now, we're going to talk about, of course, exploiting a system. 294 00:15:15,100 --> 00:15:16,240 That's kind of why we're here. 295 00:15:16,880 --> 00:15:20,620 But what I want to do is really talk about the conditions 296 00:15:20,620 --> 00:15:21,820 under which the research was done. 297 00:15:23,180 --> 00:15:25,760 I realize now that I was a little bit paranoid during this whole thing. 298 00:15:26,400 --> 00:15:29,580 But you can imagine, being in security, why I might be paranoid. 299 00:15:29,740 --> 00:15:31,540 Because we see bad things. 300 00:15:31,940 --> 00:15:33,540 Some of us do very bad things. 301 00:15:34,160 --> 00:15:37,120 And we do hear occasionally about bad things happening to us. 302 00:15:37,140 --> 00:15:39,340 That's because there's security research outside of actually the work itself. 303 00:15:40,340 --> 00:15:44,540 So at the time, and even right now, I believe, though they're transitioning, 304 00:15:44,920 --> 00:15:46,440 this was done in Thailand, obviously, 305 00:15:46,680 --> 00:15:50,320 and the government is a junta, a military dictatorship. 306 00:15:51,560 --> 00:15:55,100 In those sorts of situations, and I think for the most part in many legal systems, 307 00:15:55,440 --> 00:15:58,120 you are guilty until proven innocent. 308 00:15:59,560 --> 00:16:03,200 They do this very easily with the Majis Laws. 309 00:16:03,620 --> 00:16:06,160 Essentially, you've embarrassed the king, you've embarrassed the government, 310 00:16:06,160 --> 00:16:07,460 you've embarrassed the country. 311 00:16:08,580 --> 00:16:10,620 They say that you do, and you do. 312 00:16:10,900 --> 00:16:12,620 They claim you're guilty. 313 00:16:12,720 --> 00:16:12,880 You are. 314 00:16:14,260 --> 00:16:21,260 As a foreigner, as a farang, you may know the term guailo or laoway, right? 315 00:16:22,960 --> 00:16:24,660 You know, I don't have rights. 316 00:16:24,680 --> 00:16:29,640 So there was no chance I was going to be able to prove myself innocent. 317 00:16:29,960 --> 00:16:33,820 And anyway, I don't think even if I was a Thai, it would matter too much 318 00:16:33,820 --> 00:16:35,480 because I think in the history of the Majis, 319 00:16:36,160 --> 00:16:39,580 not only one person has ever successfully escaped their fate. 320 00:16:40,820 --> 00:16:44,060 So essentially, if anyone was concerned about what I was doing, 321 00:16:44,580 --> 00:16:48,000 for any number of reasons, they could have just snatched me and put me in jail, 322 00:16:48,180 --> 00:16:50,860 and then I would just stay there until they felt like letting me out. 323 00:16:52,700 --> 00:16:55,680 So needless to say, I took a lot of precautions. 324 00:16:57,860 --> 00:16:59,720 I tried my best not to get arrested. 325 00:17:00,820 --> 00:17:03,360 I did lots of things not to get arrested. 326 00:17:03,360 --> 00:17:06,160 The first thing I did was try to avoid them. 327 00:17:06,460 --> 00:17:08,460 Anybody involved with the BTS. 328 00:17:09,700 --> 00:17:10,880 I avoided the security guards. 329 00:17:12,220 --> 00:17:14,940 Not all entrances apparently had security guards. 330 00:17:15,240 --> 00:17:16,620 There were some entrances that did not. 331 00:17:16,820 --> 00:17:19,620 I found which ones those were, and I spent my time there. 332 00:17:21,420 --> 00:17:23,260 Also, I did something called a dip and dash. 333 00:17:23,640 --> 00:17:26,860 If you're familiar, probably not familiar with Monty Python, but I ran away. 334 00:17:27,100 --> 00:17:30,140 You know, I would go up to, I would saunter. 335 00:17:30,360 --> 00:17:31,620 I'd practice my sauntering. 336 00:17:31,620 --> 00:17:34,340 I would saunter up to, you know, like I'm going to enter. 337 00:17:34,600 --> 00:17:36,020 Maybe I'd pause, look at my phone. 338 00:17:36,520 --> 00:17:39,840 I would dip it, actually slide it in, let it come out, 339 00:17:39,960 --> 00:17:41,960 and then I would just turn around, and I would just walk away. 340 00:17:44,080 --> 00:17:45,540 Not quickly, but not too quickly. 341 00:17:47,160 --> 00:17:48,420 And of course I had an escape route. 342 00:17:48,560 --> 00:17:50,640 I had some dark alley I could go down and disappear to. 343 00:17:51,800 --> 00:17:53,140 I did say I was paranoid, right? 344 00:17:54,300 --> 00:17:57,180 So I had these techniques, this plan really. 345 00:17:58,240 --> 00:18:01,600 But I also could count on them doing their best to avoid me. 346 00:18:02,680 --> 00:18:03,760 Punish for disruptions. 347 00:18:04,300 --> 00:18:04,980 Harmony is important. 348 00:18:05,920 --> 00:18:09,940 In those sort of situations, you have a tendency not to notice stuff. 349 00:18:10,160 --> 00:18:10,940 You don't want to notice stuff. 350 00:18:11,620 --> 00:18:12,860 Also a tendency not to care. 351 00:18:13,760 --> 00:18:14,740 Not going to worry about it. 352 00:18:15,340 --> 00:18:17,020 And you're going to follow procedures. 353 00:18:18,540 --> 00:18:23,780 Exactly what procedure would they have for a strange white guy walking up to a turnstile, 354 00:18:23,820 --> 00:18:25,240 putting a ticket in, and walking away? 355 00:18:26,300 --> 00:18:27,240 Odd, odd behavior. 356 00:18:28,280 --> 00:18:29,320 Not going to be in the manual. 357 00:18:30,560 --> 00:18:34,220 And then of course, avoiding frang or guai lo. 358 00:18:35,200 --> 00:18:36,180 We do weird things, right? 359 00:18:36,280 --> 00:18:36,940 White people are weird. 360 00:18:37,060 --> 00:18:37,700 We do weird things. 361 00:18:38,000 --> 00:18:39,240 And what do you do with weird people? 362 00:18:39,580 --> 00:18:40,300 You leave them alone. 363 00:18:40,780 --> 00:18:42,200 Let them be weird by themselves. 364 00:18:42,440 --> 00:18:43,120 Do what they're going to do. 365 00:18:43,180 --> 00:18:44,600 And then you just stay away from them. 366 00:18:44,980 --> 00:18:45,800 So that does happen. 367 00:18:45,900 --> 00:18:51,480 And any number of reasons, from not being very confident in your English 368 00:18:51,480 --> 00:18:52,960 to any number, as I said, weird behavior. 369 00:18:56,400 --> 00:18:57,120 It's the bees again. 370 00:18:57,280 --> 00:18:57,480 Okay. 371 00:18:57,480 --> 00:18:58,720 Thank you. 372 00:18:59,240 --> 00:19:00,480 I feel included now. 373 00:19:01,440 --> 00:19:01,880 All right. 374 00:19:02,640 --> 00:19:06,800 So, you know, we basically, this is the way I kind of kept my distance and kept myself safe. 375 00:19:09,700 --> 00:19:10,880 So, exploiting the system. 376 00:19:11,380 --> 00:19:12,500 That's what this is about, right? 377 00:19:12,540 --> 00:19:13,400 This is the fun part. 378 00:19:14,600 --> 00:19:18,260 We're going to briefly review, very briefly, what we learned so far. 379 00:19:19,300 --> 00:19:22,020 Talk about the system safeguards that become evident. 380 00:19:22,680 --> 00:19:26,580 When you look at this, you know, this transit system we have here, 381 00:19:26,580 --> 00:19:27,940 this set of subway stations. 382 00:19:28,500 --> 00:19:31,120 The assumptions that they would have had putting this together. 383 00:19:32,140 --> 00:19:33,980 We'll talk about some attacks against their assumptions. 384 00:19:34,280 --> 00:19:37,180 And then, of course, the epic fail that was involved in their design. 385 00:19:38,800 --> 00:19:39,200 Okay. 386 00:19:39,640 --> 00:19:40,760 So what we've learned so far. 387 00:19:41,660 --> 00:19:42,600 It's object-based. 388 00:19:43,040 --> 00:19:43,440 All right. 389 00:19:43,940 --> 00:19:45,820 Physical object and a database object. 390 00:19:47,700 --> 00:19:50,960 I knew there was a database object because I did tamper with the data on the card. 391 00:19:51,080 --> 00:19:54,720 And it knew that something was wrong. 392 00:19:54,840 --> 00:19:55,840 It would say go to the office. 393 00:19:55,840 --> 00:19:58,240 So there's some sort of reference involved. 394 00:19:59,140 --> 00:20:00,760 There are also properties to that object. 395 00:20:01,060 --> 00:20:05,000 And then an identification, a value, a location, and as I realized there, 396 00:20:05,120 --> 00:20:07,460 it's kind of like a type, right? 397 00:20:09,220 --> 00:20:10,000 And there are states. 398 00:20:11,000 --> 00:20:13,040 Issued, used, and collected. 399 00:20:13,420 --> 00:20:16,080 And there's some sort of history. 400 00:20:19,660 --> 00:20:22,820 I don't know why I keep looking at the Chinese slides because I don't read Chinese. 401 00:20:24,620 --> 00:20:27,500 So there's some system safeguards that become evident. 402 00:20:28,200 --> 00:20:30,460 Ticket composition and ticket design. 403 00:20:30,860 --> 00:20:34,060 You weren't going to just walk down to the corner store, right? 404 00:20:34,780 --> 00:20:37,880 Circle K, 7-Eleven, and just pick one of these up. 405 00:20:38,960 --> 00:20:41,720 Mirror, the physical object and database object to prevent tampering. 406 00:20:43,000 --> 00:20:44,900 Handling rules to find values of the objects. 407 00:20:45,560 --> 00:20:48,180 And there's a limited life cycle of the ticket. 408 00:20:48,280 --> 00:20:49,520 They only lasted 24 hours. 409 00:20:49,840 --> 00:20:51,580 And they were, of course, collecting that ticket. 410 00:20:52,820 --> 00:20:55,480 And the final turnstile at the very end of your use. 411 00:20:57,860 --> 00:20:59,840 So the assumptions in putting that together, of course, 412 00:21:00,000 --> 00:21:02,520 would be that no one will be able to reproduce our ticket. 413 00:21:04,620 --> 00:21:06,360 Our system has the only valid objects. 414 00:21:08,200 --> 00:21:09,720 Handling rules will prevent concurrent use. 415 00:21:11,500 --> 00:21:13,840 The damage is limited to that life cycle. 416 00:21:13,940 --> 00:21:15,880 What could happen, right, in 24 hours? 417 00:21:17,120 --> 00:21:19,580 And, of course, after use, the ticket will be in our possession. 418 00:21:20,300 --> 00:21:21,340 They would feel safe, right? 419 00:21:21,340 --> 00:21:22,280 We have all the tickets now. 420 00:21:22,520 --> 00:21:23,940 We would feel good about that. 421 00:21:27,000 --> 00:21:29,300 So we're going to, of course, attack those assumptions, 422 00:21:29,460 --> 00:21:30,580 attempt to invalidate them. 423 00:21:31,260 --> 00:21:32,960 We're going to acquire a suitable ticket. 424 00:21:34,200 --> 00:21:35,640 We're going to capture a valid object. 425 00:21:37,340 --> 00:21:38,940 We're going to try to bypass those rules. 426 00:21:41,240 --> 00:21:44,500 And then see if we can extend that attack to increase the damage. 427 00:21:49,340 --> 00:21:50,560 So I did find someone. 428 00:21:51,540 --> 00:21:52,500 To make blank tickets. 429 00:21:53,340 --> 00:21:55,840 And I did copy a shit ton of objects in the issued state. 430 00:21:56,960 --> 00:21:58,320 You can do that. 431 00:21:59,740 --> 00:22:00,940 That's what's nice about magstripe. 432 00:22:01,960 --> 00:22:03,260 Found a flaw in the handling rules. 433 00:22:04,160 --> 00:22:06,720 The collected state found in the current life cycle 434 00:22:07,800 --> 00:22:09,040 overrides all other states. 435 00:22:09,240 --> 00:22:10,480 It overrides even concurrency. 436 00:22:12,760 --> 00:22:14,520 So objects are always seen as recently collected. 437 00:22:15,560 --> 00:22:16,900 You can run that original ticket. 438 00:22:18,380 --> 00:22:20,160 And then all the copies immediately become valid. 439 00:22:21,980 --> 00:22:23,500 Honestly, I think they were worried about 440 00:22:24,860 --> 00:22:26,180 someone going through the turnstile, 441 00:22:27,260 --> 00:22:28,420 handing it back to a friend. 442 00:22:29,280 --> 00:22:31,860 They had been using that same ticket to go in. 443 00:22:32,200 --> 00:22:34,420 And that's honestly all I think they were concerned about. 444 00:22:36,520 --> 00:22:40,180 Unfortunately, that didn't work. 445 00:22:44,100 --> 00:22:46,420 Not quite a demonstration, but just a visualization 446 00:22:46,420 --> 00:22:48,200 of how this is working. 447 00:22:48,200 --> 00:22:53,040 So typically, you got the original in use there. 448 00:22:54,080 --> 00:22:56,620 Someone tries to use one of those copies. 449 00:22:57,040 --> 00:22:58,200 It follows those rules. 450 00:22:58,520 --> 00:23:00,520 When we saw it before, it was in used state. 451 00:23:01,400 --> 00:23:02,780 It's now currently in the issued state. 452 00:23:05,360 --> 00:23:06,540 It violates the rules. 453 00:23:08,100 --> 00:23:09,480 And you can't use it. 454 00:23:10,480 --> 00:23:12,120 Any of the copies you try to use. 455 00:23:14,440 --> 00:23:17,620 However, if you let it pass through all the way, 456 00:23:23,300 --> 00:23:28,360 it blocks any concurrent use of the ticket. 457 00:23:28,440 --> 00:23:29,480 So if you've got three other friends, 458 00:23:29,520 --> 00:23:30,840 four other friends using this ticket, 459 00:23:30,880 --> 00:23:31,540 it doesn't really know it. 460 00:23:32,480 --> 00:23:34,040 All it does is see if previously it's collected. 461 00:23:36,700 --> 00:23:37,420 Last one. 462 00:23:37,680 --> 00:23:39,320 Now it sees it in the issued state. 463 00:23:39,720 --> 00:23:41,340 And so it sees it in isolation, really. 464 00:23:42,420 --> 00:23:44,560 And then allows that to pass through. 465 00:23:45,560 --> 00:23:46,940 And that's the same for any of them. 466 00:23:47,000 --> 00:23:47,600 They're all seeing the same thing. 467 00:23:47,600 --> 00:23:48,700 They're seeing it in isolation at that point. 468 00:23:48,800 --> 00:23:50,940 It just sees the previous state for where the object is collected. 469 00:23:51,180 --> 00:23:52,120 It's now in the issued. 470 00:23:52,340 --> 00:23:53,000 You've got it. 471 00:23:53,540 --> 00:23:55,940 And you can just then walk in. 472 00:23:58,260 --> 00:23:59,420 It's not complicated. 473 00:23:59,920 --> 00:24:01,960 It's not like a really technical hack. 474 00:24:02,140 --> 00:24:03,900 It's just you just learn how the system works. 475 00:24:05,060 --> 00:24:06,020 You learn the state machine, 476 00:24:06,240 --> 00:24:08,480 and then you learn ways to abuse it, 477 00:24:08,480 --> 00:24:09,160 ways to manipulate it. 478 00:24:10,480 --> 00:24:11,480 So you can abuse it. 479 00:24:15,500 --> 00:24:16,520 Of course, you've got to prove it. 480 00:24:17,700 --> 00:24:20,520 We're going to have some data to show exactly what's going on. 481 00:24:20,840 --> 00:24:22,340 And in fact, that is what is happening. 482 00:24:23,040 --> 00:24:27,320 So you have three single journey tickets there. 483 00:24:27,580 --> 00:24:30,020 You can see that the price is the same. 484 00:24:30,400 --> 00:24:32,080 The station is the same. 485 00:24:33,480 --> 00:24:34,780 You have the dispenser. 486 00:24:36,200 --> 00:24:41,520 And you can see that it's basically the same instance of the object. 487 00:24:42,660 --> 00:24:43,620 So the same ticket. 488 00:24:43,780 --> 00:24:44,880 The original and copies. 489 00:24:45,200 --> 00:24:47,320 And you can see that it's been used three separate times. 490 00:24:47,600 --> 00:24:50,420 It's the same station, different turn styles, 491 00:24:50,640 --> 00:24:52,860 and different arrivals there. 492 00:24:53,020 --> 00:24:54,960 So you've got different GUIDs for that entry. 493 00:24:55,600 --> 00:24:56,780 So you use it three times. 494 00:24:56,960 --> 00:24:59,780 And it's the same thing with the lower one here, 495 00:24:59,840 --> 00:25:01,760 which is the all-day pass. 496 00:25:03,660 --> 00:25:06,620 Basically got the same ticket, the same object. 497 00:25:06,820 --> 00:25:10,080 And you're going ahead and using it two separate times. 498 00:25:10,200 --> 00:25:12,360 Different stations, different turn styles, 499 00:25:12,600 --> 00:25:15,060 and obviously different usage based on the different GUIDs there. 500 00:25:15,640 --> 00:25:16,100 Okay. 501 00:25:18,840 --> 00:25:19,540 Ah, yes. 502 00:25:19,720 --> 00:25:20,160 The demo. 503 00:25:21,540 --> 00:25:28,100 So we're going to go ahead and show you me using one of my counterfeit tickets. 504 00:25:29,780 --> 00:25:31,060 Yes, it's mostly my feet. 505 00:25:32,340 --> 00:25:34,700 Saaz said that he could tell it was me by my sandals. 506 00:25:37,300 --> 00:25:41,100 I'm glad he didn't say he could tell it was me because of my feet. 507 00:25:41,200 --> 00:25:41,800 That would have been weird. 508 00:25:45,480 --> 00:25:46,860 A lot of my sandals there. 509 00:25:48,640 --> 00:25:51,620 But what I wanted to capture, I was still very paranoid, 510 00:25:51,680 --> 00:25:56,080 was the fact that I was using a counterfeit ticket. 511 00:25:57,200 --> 00:26:00,020 I was exiting the station using a counterfeit ticket. 512 00:26:01,000 --> 00:26:01,960 You know, accepted it. 513 00:26:02,020 --> 00:26:02,460 It let me out. 514 00:26:02,880 --> 00:26:04,860 Mainly, you know, it let me out, right? 515 00:26:07,180 --> 00:26:08,480 So, yes, simple hack. 516 00:26:09,700 --> 00:26:10,880 Just understanding that system. 517 00:26:10,880 --> 00:26:11,740 Learning how it works. 518 00:26:12,780 --> 00:26:13,720 And then manipulating it. 519 00:26:14,220 --> 00:26:14,380 Right? 520 00:26:19,520 --> 00:26:20,500 Now, that's an exploit. 521 00:26:21,480 --> 00:26:22,160 Very simple. 522 00:26:23,700 --> 00:26:24,700 Let's turn that into an attack. 523 00:26:25,440 --> 00:26:25,900 All right? 524 00:26:26,100 --> 00:26:27,540 To do that, you're going to have to have tickets. 525 00:26:28,360 --> 00:26:29,140 Lots of them, right? 526 00:26:30,100 --> 00:26:30,740 And a plan. 527 00:26:33,460 --> 00:26:34,460 You got to find some cards. 528 00:26:34,700 --> 00:26:35,940 And you have to punch some holes. 529 00:26:37,900 --> 00:26:38,400 All right. 530 00:26:38,420 --> 00:26:39,340 So the cards. 531 00:26:40,740 --> 00:26:42,960 You can't go, as I said, you can't go to the store. 532 00:26:43,080 --> 00:26:44,140 You can't order from a catalog. 533 00:26:45,300 --> 00:26:46,020 Ah, Alibaba. 534 00:26:46,740 --> 00:26:47,460 Thank you again. 535 00:26:47,760 --> 00:26:48,640 I love Alibaba. 536 00:26:50,080 --> 00:26:51,540 So I put RFP on Alibaba. 537 00:26:52,320 --> 00:26:53,700 I got lots of samples. 538 00:26:53,820 --> 00:26:54,480 I ran some trials. 539 00:26:54,980 --> 00:26:57,920 And finally, after a very long time, found a winning bid. 540 00:26:59,060 --> 00:26:59,560 All right? 541 00:26:59,640 --> 00:27:00,740 So there's thousands of companies. 542 00:27:01,040 --> 00:27:01,900 I'm just, of course, guessing. 543 00:27:02,140 --> 00:27:02,980 Probably millions. 544 00:27:04,540 --> 00:27:05,620 And you just tell them what you want. 545 00:27:06,440 --> 00:27:07,060 Anything at all. 546 00:27:07,060 --> 00:27:09,060 And they'll make it for you. 547 00:27:09,720 --> 00:27:10,120 All right? 548 00:27:12,280 --> 00:27:13,320 I had many, many offers. 549 00:27:15,840 --> 00:27:17,060 All failed at one company. 550 00:27:17,980 --> 00:27:19,240 Most of them said you couldn't do it. 551 00:27:19,940 --> 00:27:20,560 Can't be done. 552 00:27:21,960 --> 00:27:24,240 Those that said you could, they'd send me a sample. 553 00:27:24,280 --> 00:27:24,800 It was too thick. 554 00:27:25,440 --> 00:27:26,740 You had some Vernier calipers. 555 00:27:27,260 --> 00:27:27,840 Too thick. 556 00:27:28,500 --> 00:27:29,900 One finally said, yes, we can. 557 00:27:30,940 --> 00:27:31,940 And they actually did. 558 00:27:32,860 --> 00:27:33,220 Okay? 559 00:27:34,400 --> 00:27:34,900 All right. 560 00:27:35,440 --> 00:27:36,960 Took many months to find them. 561 00:27:36,960 --> 00:27:38,260 Many, many months. 562 00:27:39,020 --> 00:27:41,720 And lots of difficult conversations via e-mail. 563 00:27:43,680 --> 00:27:45,080 There is our winning bid. 564 00:27:46,760 --> 00:27:47,360 See there? 565 00:27:47,520 --> 00:27:48,160 The two mag stripes. 566 00:27:50,100 --> 00:27:51,040 It is very thin. 567 00:27:52,880 --> 00:27:54,580 I was concerned about it jamming. 568 00:27:55,400 --> 00:27:56,260 I didn't need attention. 569 00:27:57,100 --> 00:28:00,660 I was probably overdoing it with my precautions as far as running the ticket through. 570 00:28:01,080 --> 00:28:03,560 But if it got jammed, yeah. 571 00:28:04,280 --> 00:28:06,940 There was no way I was going to escape attention if that thing got jammed. 572 00:28:06,940 --> 00:28:10,480 So I was very concerned about that thickness. 573 00:28:11,160 --> 00:28:12,340 So we have that thickness there. 574 00:28:13,800 --> 00:28:14,680 And then the hole. 575 00:28:18,360 --> 00:28:19,860 This is what I used to punch the holes. 576 00:28:20,860 --> 00:28:21,820 I went out back. 577 00:28:22,540 --> 00:28:23,600 That's a construction refuge. 578 00:28:25,300 --> 00:28:26,100 Construction waste. 579 00:28:26,980 --> 00:28:29,740 And so I just grabbed what looked like a piece of a pallet. 580 00:28:30,060 --> 00:28:31,060 A chunk of a pallet. 581 00:28:31,200 --> 00:28:35,040 A rusty, yes, a very rusty pipe. 582 00:28:35,220 --> 00:28:36,580 I had to clean that sucker off. 583 00:28:36,580 --> 00:28:38,420 And I got these concrete. 584 00:28:39,180 --> 00:28:40,580 I was in Cambodia. 585 00:28:41,300 --> 00:28:42,060 I had no way. 586 00:28:42,280 --> 00:28:42,960 It was crazy. 587 00:28:43,080 --> 00:28:46,460 It took me a very long time to find those concrete nails. 588 00:28:46,600 --> 00:28:47,520 Because I travel quite a bit. 589 00:28:48,060 --> 00:28:50,700 But I did find some concrete nails for that. 590 00:28:50,840 --> 00:28:52,700 And so I would just sit there in my room and just pound. 591 00:28:53,700 --> 00:28:55,340 And get another one and then pound. 592 00:28:56,420 --> 00:28:59,020 And, yeah, go at it and just create a bunch of those things. 593 00:29:01,960 --> 00:29:02,760 So our plan. 594 00:29:03,380 --> 00:29:05,060 We're going to buy a daily pass. 595 00:29:07,060 --> 00:29:11,440 We're going to copy that daily pass to lots of other tickets. 596 00:29:11,500 --> 00:29:12,140 These counterfeit tickets. 597 00:29:13,140 --> 00:29:14,120 We're going to use that original. 598 00:29:15,540 --> 00:29:19,360 They're going to hand out those copies to a couple of your friends. 599 00:29:19,680 --> 00:29:20,380 Have some fun. 600 00:29:20,800 --> 00:29:22,020 And you can do that every day. 601 00:29:23,920 --> 00:29:24,820 Every single day. 602 00:29:24,920 --> 00:29:26,220 And you can use them all at the same time. 603 00:29:26,280 --> 00:29:27,340 It has no problem with it. 604 00:29:30,200 --> 00:29:31,700 But, I mean, yes, it's fun. 605 00:29:33,440 --> 00:29:34,360 It's a fun thing to do. 606 00:29:35,920 --> 00:29:38,720 But it's something that could end up being much, much bigger. 607 00:29:39,580 --> 00:29:42,280 You've got a lot of people writing to BTS. 608 00:29:44,380 --> 00:29:49,200 So you could start with that one daily pass that you have. 609 00:29:49,260 --> 00:29:50,660 It's 140 baht or $3. 610 00:29:51,320 --> 00:29:56,560 Spend 50 cents to buy some blanks for your friends. 611 00:29:56,580 --> 00:29:58,580 So that's $3.50. 612 00:30:00,360 --> 00:30:02,200 Loss to the company, $22.58. 613 00:30:04,560 --> 00:30:07,740 I think it probably does not include the original $3 purchase. 614 00:30:08,620 --> 00:30:10,720 Eh, you know, then I'm going to notice. 615 00:30:11,820 --> 00:30:14,840 But let's say you want to escalate a little bit there. 616 00:30:15,260 --> 00:30:17,640 So you spend your $3 to get your all-day pass. 617 00:30:17,920 --> 00:30:20,060 And then maybe instead you get, you know, $1,000. 618 00:30:21,240 --> 00:30:21,900 It's $100. 619 00:30:22,100 --> 00:30:27,840 So it's $103 to do $4,516 worth of damage. 620 00:30:30,560 --> 00:30:34,080 If you use all-day pass, and of course you want to use an all-day pass, 621 00:30:34,500 --> 00:30:35,500 you get to keep those. 622 00:30:35,780 --> 00:30:38,480 They don't get captured by the turnstile. 623 00:30:38,560 --> 00:30:38,860 They come out. 624 00:30:39,040 --> 00:30:42,240 So every subsequent day, your tech is costing you $3. 625 00:30:42,480 --> 00:30:47,280 So $3 to do $4,516 worth of damage. 626 00:30:48,160 --> 00:30:49,440 And you're going to keep doing this. 627 00:30:49,480 --> 00:30:51,500 Let's say you're a devious guy. 628 00:30:51,620 --> 00:30:52,740 You're not doing this for a lot of fun. 629 00:30:52,800 --> 00:30:54,480 I think at $1,000 you're not doing this for fun anymore. 630 00:30:55,480 --> 00:30:56,380 You're doing this for a month. 631 00:30:57,640 --> 00:30:59,520 You know, $137,000. 632 00:31:00,380 --> 00:31:02,760 Six months, $824,000. 633 00:31:02,920 --> 00:31:03,920 One year, five years. 634 00:31:03,920 --> 00:31:07,700 $8,241,000 worth of damage. 635 00:31:09,180 --> 00:31:10,460 You could make something out of this. 636 00:31:11,640 --> 00:31:14,280 You could, you know, I don't know their budgets, 637 00:31:14,460 --> 00:31:16,060 but you could slowly bleed them to death. 638 00:31:17,600 --> 00:31:18,200 Missing funds. 639 00:31:18,820 --> 00:31:21,780 Not having necessarily the money to do the repairs they need to do. 640 00:31:23,140 --> 00:31:24,840 To do upgrades that they need to do. 641 00:31:24,920 --> 00:31:26,860 If you're talking about making that network unreliable, 642 00:31:26,920 --> 00:31:29,100 you're undermining that transport system. 643 00:31:30,440 --> 00:31:31,220 That's $1,000. 644 00:31:31,220 --> 00:31:33,260 If you wanted to do a little bit more, if you wanted to spend more time, 645 00:31:33,260 --> 00:31:35,380 you could spend, you know, a nation state could, 646 00:31:36,100 --> 00:31:38,100 could certainly ramp it up a little bit more than that. 647 00:31:38,280 --> 00:31:40,100 And with $1,000 or $2,000 in these tickets, 648 00:31:40,180 --> 00:31:41,320 you could probably escape notice. 649 00:31:41,740 --> 00:31:42,100 Right? 650 00:31:43,660 --> 00:31:45,700 I guess it really depends on how they're eyeballs on. 651 00:31:45,940 --> 00:31:47,700 But it's not just something that's fun. 652 00:31:47,840 --> 00:31:50,320 It's something that could do a lot of damage to an organization over time. 653 00:31:52,240 --> 00:31:54,080 So yeah, we can extend that attack. 654 00:31:54,220 --> 00:31:59,500 We can do more to them than just that one quick ride through the system. 655 00:32:01,060 --> 00:32:02,820 So the implications for the BTS. 656 00:32:04,480 --> 00:32:06,260 Millions of dollars in losses, obviously, over time. 657 00:32:07,540 --> 00:32:09,420 More important to the Thais, loss of face. 658 00:32:09,960 --> 00:32:10,740 Public embarrassment. 659 00:32:11,220 --> 00:32:12,360 It's much more important to them. 660 00:32:15,820 --> 00:32:17,620 So what was the response from the BTS? 661 00:32:18,400 --> 00:32:19,700 And maybe I'm asking for trouble. 662 00:32:20,340 --> 00:32:22,320 Maybe I'll be stopped in immigration when I get back. 663 00:32:23,700 --> 00:32:24,480 We'll find out. 664 00:32:25,200 --> 00:32:28,240 You know, I was not in the right social circles. 665 00:32:28,240 --> 00:32:32,140 I didn't have the status necessary, unfortunately, to be acknowledged. 666 00:32:34,020 --> 00:32:35,540 I'm not passing judgment. 667 00:32:35,660 --> 00:32:36,560 That's just the rules of the game. 668 00:32:37,900 --> 00:32:39,160 So they didn't recognize me. 669 00:32:39,320 --> 00:32:41,120 They didn't return email, phone calls. 670 00:32:41,400 --> 00:32:42,780 I tried multiple times. 671 00:32:43,000 --> 00:32:45,720 Different people, different parts of the organization. 672 00:32:48,340 --> 00:32:51,820 So some lessons for us, obviously, and lessons for them. 673 00:32:54,520 --> 00:32:56,260 There is no hardware-only solution. 674 00:32:56,600 --> 00:32:58,220 I don't think there has been for a very long time. 675 00:32:58,240 --> 00:33:04,200 The most common way of realizing that is you talk about the firmware attacks, right? 676 00:33:04,420 --> 00:33:05,240 Lots of firmware attacks. 677 00:33:05,380 --> 00:33:06,140 There's software in there. 678 00:33:06,920 --> 00:33:07,760 Solutions are complex. 679 00:33:07,920 --> 00:33:11,240 And there is software in there and logic flaws as well, right? 680 00:33:13,140 --> 00:33:15,560 Also, trusting assumptions can be dangerous. 681 00:33:15,660 --> 00:33:19,640 I think that's something you can stick at the end of every single talk here, not to trust your assumptions. 682 00:33:21,260 --> 00:33:24,960 Don't be afraid where the research might lead you. 683 00:33:26,340 --> 00:33:27,620 You know, measure your risk wisely. 684 00:33:28,240 --> 00:33:28,800 And if you think about this, I was not worried about breaking a law before proceeding. 685 00:33:28,960 --> 00:33:36,120 I was thinking over and over again what could go wrong, and, of course, I was including the people. 686 00:33:37,120 --> 00:33:38,440 In fact, it was primarily the people. 687 00:33:38,620 --> 00:33:40,020 I wasn't worried about breaking anything. 688 00:33:40,220 --> 00:33:41,740 I was worried about their reaction. 689 00:33:42,680 --> 00:33:43,440 It was a junta. 690 00:33:43,480 --> 00:33:43,960 They have guns. 691 00:33:45,440 --> 00:33:45,800 Right? 692 00:33:48,700 --> 00:33:49,480 The BTS? 693 00:33:51,340 --> 00:33:52,980 This is probably a harder thing to learn, right? 694 00:33:53,140 --> 00:33:54,880 Don't let social conventions blind you. 695 00:33:54,880 --> 00:34:00,980 you. I think this is all about, you know, learning to break free of that. Not everyone thinks like 696 00:34:00,980 --> 00:34:05,780 you, all right? There are Guailó running around. There are Farang. There are various different types 697 00:34:05,780 --> 00:34:12,560 of people that think differently than you. Some are here to help, like me. Others are not. Others 698 00:34:12,560 --> 00:34:17,840 might be looking to do you some harm, so it's important that you talk to them, even if it's 699 00:34:17,840 --> 00:34:24,080 just an assistant, all right? If you're worried about wasting a lot of time, don't. You ask them 700 00:34:24,080 --> 00:34:29,180 to show you something, all right? If you do that, you're not going to be spending a lot of time with 701 00:34:29,180 --> 00:34:39,760 people, all right? And the time you do spend will be well worth it. And, of course, the ever-popular 702 00:34:40,620 --> 00:34:44,340 cover it up later. Once again, not passing judgment. There are different ways to handle 703 00:34:44,340 --> 00:34:49,420 situations. I would not choose to handle it that way. I suspect they would, but they can. 704 00:34:50,120 --> 00:34:52,000 And they can always, they could have talked to me, 705 00:34:53,460 --> 00:34:54,060 you know, said, 706 00:34:54,080 --> 00:35:00,400 hey, don't talk about this. Okay, I won't. You can always cover it up later. Seriously. I say it 707 00:35:00,400 --> 00:35:09,040 with all sincerity. So avoiding their fate. You want to test all layers, all layers of a solution. 708 00:35:10,160 --> 00:35:14,940 Testing for application issues or system responses. And, of course, checking your 709 00:35:14,940 --> 00:35:22,000 assumptions. And that is what the yearly pen test is for. Many companies are either not doing a pen 710 00:35:22,000 --> 00:35:22,260 test. 711 00:35:24,520 --> 00:35:30,720 Or it's just a check box. And they aren't really concerned about who's doing it or why. They just want a good score. 712 00:35:31,720 --> 00:35:35,180 All right? They need to pay more attention to these things. They need to actually have these pen tests. 713 00:35:35,320 --> 00:35:41,620 They need to make sure it's done by someone who knows what they're doing. All right? Because I'll tell you, if 714 00:35:41,620 --> 00:35:47,600 they were doing some of these things, this wouldn't happen. Doing things like compensating and 715 00:35:47,600 --> 00:35:53,840 mitigating controls. They're monitoring the use of that system. I was doing this over two years, man. 716 00:35:53,840 --> 00:36:00,060 Two years. Because I would do this part-time. I'd be in Bangkok and I would just run down to the BTS station. 717 00:36:01,380 --> 00:36:07,800 So two years. And they apparently didn't notice anything because nothing was fixed. And I was never, of course, 718 00:36:07,800 --> 00:36:17,480 grabbed by anybody. All right. So what are they doing now? They're on to second generation. Everything's NFC now. 719 00:36:18,220 --> 00:36:22,060 I presume the issues are still there. A little harder to get to. 720 00:36:23,840 --> 00:36:31,540 But I suspect that's possible. You know, we are seeing attacks against NFC. There's also other types of attacks you can do and move 721 00:36:31,540 --> 00:36:41,200 laterally to get that key in order to crack the NFC card and get access to that key to basically do the same attack again. 722 00:36:41,300 --> 00:36:46,580 Because you can read the ticket. You can make another one on your own. And you can do the same attack. And, of course, 723 00:36:46,620 --> 00:36:53,740 there are still no channels for sharing. I did check the website. There's no contact us for this. There's no contact us for that. Knowing the wrong 724 00:36:53,840 --> 00:37:05,880 people, I suppose. And definitely ignore me. So ignore me. So final thoughts. Transit systems are fun. But they can also get you 725 00:37:05,880 --> 00:37:15,040 into trouble. I believe that first talk, anatomy of a subway hack, they were prepared to give that talk. But I think they were 726 00:37:15,040 --> 00:37:23,440 threatened with legal action. So they didn't end up giving the talk. The slides got out. That's why we know about the details. But, yeah, they 727 00:37:24,000 --> 00:37:31,480 could not do that talk. So these kind of talks can get you into trouble. But you don't know until you try. You've got to give it a try. 728 00:37:32,780 --> 00:37:39,160 Reverse engineering is key. I think that's what exploitation really is about is doing some reverse engineering, understanding how the 729 00:37:39,160 --> 00:37:48,840 system, how its software works. You know, so you can exploit it, of course. And then you've got to have some balls. You know, you 730 00:37:48,840 --> 00:37:53,420 have to go out there. You have to know that something may happen. That's fine. Just be prepared. 731 00:37:55,380 --> 00:38:02,640 Don't believe, you know, a lot of the assurances. They're always giving you assurances about how safe a system is. Look to see 732 00:38:02,640 --> 00:38:11,240 yourself. And I hate to say this as a network guy. I never did want to do AppSec. I just got forced to do AppSec. But, yeah, AppSec 733 00:38:11,240 --> 00:38:23,280 was the win here. Just understanding that system. Nothing too complicated. Some links. If you want to learn more about 734 00:38:23,280 --> 00:38:33,620 those other talks. Different companies involved. Equipment. Follow in the footsteps there. The people who made that card for 735 00:38:33,620 --> 00:38:37,560 me. And, of course, the BTS. That's it. Thanks, everybody.