1 00:00:00,000 --> 00:00:09,920 I am Joe Grand. I'm Jay Kappelbaum. And we are talking about smart parking meters. Just to 2 00:00:09,920 --> 00:00:14,820 give you a little bit of background, I'm an electrical engineer, hardware hacker. I live and 3 00:00:14,820 --> 00:00:19,720 breathe electronics. I love this stuff. And the reason I got into looking at parking meters is 4 00:00:20,160 --> 00:00:25,520 there's a lot of them in San Francisco where I live. And I use them all the time. And I said, 5 00:00:25,520 --> 00:00:29,940 hey, these things are electronic. They look fun. Let's, you know, maybe do something security 6 00:00:29,940 --> 00:00:36,820 related. I don't know. I guess that's about it for me. I designed the DEF CON badge this year. 7 00:00:38,300 --> 00:00:46,700 I'm interested in photography and BDSM. Chris isn't here today. He was here with us at Black 8 00:00:46,700 --> 00:00:52,760 Hat. But for various reasons, he's gone. But he's an amazing hardware hacker. He's one of the 9 00:00:52,760 --> 00:00:55,420 best, right? You want to decap a chip or dump something from it. 10 00:00:55,520 --> 00:01:02,160 You talk to him. Yeah. Chris talked last year about silicon dye analysis. And he's like one of 11 00:01:02,160 --> 00:01:10,040 the best smart card hackers in the world for sure. So we'll make up stuff on his slides. 12 00:01:11,600 --> 00:01:16,720 We'll hand wave. Yeah. So why parking meters? I mentioned why I was into it. But why in 13 00:01:16,720 --> 00:01:20,720 general? Parking meters are these, you know, they're just everywhere. They're in every city. 14 00:01:20,760 --> 00:01:25,500 They're in every city in the world. These things on stage. They're in every city in the world. 15 00:01:27,300 --> 00:01:27,740 Here's is as well. You can park your car. You can walk away. You can walk in and out. You can 16 00:01:27,740 --> 00:01:30,300 bar. Go to a bar. Go to a bar. And we just totally take them for granted. We go, we park our 17 00:01:30,300 --> 00:01:36,160 car, put some money in, walk away. We don't think about it at all. But it's one system that we 18 00:01:36,160 --> 00:01:42,620 thought needed a little kick in the ass. Because a lot of these meters now are electronic. They're 19 00:01:42,620 --> 00:01:48,460 essentially individual computer systems that can now be analyzed. Think globally. Hack locally. 20 00:01:48,960 --> 00:01:49,400 Yes. 21 00:01:56,000 --> 00:01:57,460 And there's also big money. 22 00:01:57,560 --> 00:01:59,520 So anywhere there's money, there's going to be fraud. 23 00:01:59,740 --> 00:02:02,900 There's going to be people, you know, taking advantage of the system. 24 00:02:03,200 --> 00:02:11,000 So the parking industry is a $28 billion industry annually, I think, just in the U.S. alone. 25 00:02:12,640 --> 00:02:14,460 And there's a bunch of stuff that can go on. 26 00:02:14,520 --> 00:02:20,380 So not only, like, the financial fraud of getting free parking, but there are social issues and legal issues, and we're going to get into all of that. 27 00:02:22,360 --> 00:02:29,600 So, generally, the thing we wanted to do was understand the current state of the unfair collection systems, or fair collection systems. 28 00:02:30,040 --> 00:02:32,220 And we wanted to be able to demonstrate some attacks. 29 00:02:32,460 --> 00:02:35,020 We wanted to be able to come here and show that something had been done. 30 00:02:35,100 --> 00:02:37,000 It's not just enough to say how some things work. 31 00:02:37,120 --> 00:02:42,180 We also wanted to show you how they don't work or how they work when you probably don't want them to work that way. 32 00:02:43,800 --> 00:02:46,640 Anyway, we also wanted to show the whole process from start to finish. 33 00:02:46,900 --> 00:02:50,080 Because, you know, for me, this was my first real hardware hacking project. 34 00:02:50,080 --> 00:02:55,020 Where, like, we took some, like, foreign things, and we basically, like, understood them as best as we could. 35 00:02:55,140 --> 00:02:58,080 And then using that, we were able to go all the way to a full break. 36 00:02:58,880 --> 00:03:02,940 And so this should hopefully take you from start to finish if you've never done it before. 37 00:03:03,120 --> 00:03:06,740 Which I think it's important to sort of, you know, bring people to the next level. 38 00:03:06,800 --> 00:03:07,680 And Joe really thinks that. 39 00:03:07,780 --> 00:03:10,020 So he brought us together to work on this. 40 00:03:10,080 --> 00:03:12,240 So it was pretty epic to be able to work with him and Chris. 41 00:03:12,880 --> 00:03:15,940 And, of course, we took on the SFMTA. 42 00:03:16,880 --> 00:03:20,060 But, of course, it's also important to say that... 43 00:03:20,080 --> 00:03:24,080 This is not really specific to San Francisco, other than our particular case study, right? 44 00:03:24,220 --> 00:03:28,000 The meters that we examined all had pretty much the same problems. 45 00:03:28,400 --> 00:03:30,400 And we just happened to live in San Francisco. 46 00:03:30,480 --> 00:03:33,220 So it was just kind of a no-brainer to kill that one. 47 00:03:33,440 --> 00:03:33,780 Yeah. 48 00:03:33,820 --> 00:03:38,020 So going through the process is the most important part that you should take out of this. 49 00:03:38,940 --> 00:03:42,480 You know, because you can apply this to other parking meter systems in your area. 50 00:03:42,540 --> 00:03:43,960 Or you can apply it to other products. 51 00:03:44,020 --> 00:03:49,420 Anything you're looking at sort of goes through this general process of analysis and gathering information and stuff like that. 52 00:03:49,460 --> 00:03:49,960 So you'll see it. 53 00:03:50,080 --> 00:03:52,500 And then we'll hit the case study towards the end. 54 00:03:52,580 --> 00:03:57,680 We're going to talk about more general parking meter stuff and general process stuff. 55 00:03:57,760 --> 00:04:00,140 And then go into specifics of San Francisco. 56 00:04:01,100 --> 00:04:01,500 Yeah. 57 00:04:01,500 --> 00:04:05,580 So there's some different things that are kind of interesting about the parking meters in San Francisco. 58 00:04:05,720 --> 00:04:07,200 And, of course, generally everywhere. 59 00:04:07,560 --> 00:04:10,580 You've got these single space meters that are everywhere lining the streets. 60 00:04:10,740 --> 00:04:15,420 In some cities, like Oakland, they've cut them down and put in multi-space meters, which have really confused a lot of people. 61 00:04:15,700 --> 00:04:20,000 But the idea with the single space is you put in some change or you use a smart card or some, like, 62 00:04:20,080 --> 00:04:20,780 cell phone token. 63 00:04:21,200 --> 00:04:24,060 And the multi-space, you usually get, like, a printed paper token. 64 00:04:24,180 --> 00:04:25,620 In some cities, you tape it to your window. 65 00:04:25,720 --> 00:04:26,880 In other ones, you put it on your dash. 66 00:04:27,700 --> 00:04:34,060 And the meters generally are sold with this idea that they'll stop people from lifting money, like the meter maids from lifting money. 67 00:04:34,420 --> 00:04:35,580 And so they have audit logs. 68 00:04:35,760 --> 00:04:40,120 So they should know about how much the meters are used and also about how much money should be in the meters. 69 00:04:40,320 --> 00:04:42,260 And maybe they also have role separation. 70 00:04:42,540 --> 00:04:46,120 So the audit logs are pulled by someone other than the person that collects the money. 71 00:04:47,140 --> 00:04:50,060 And then, of course, they have different ways to, like, collect the money. 72 00:04:50,060 --> 00:04:50,740 Like, repair the meters. 73 00:04:50,840 --> 00:04:53,000 So the person that repairs the meter might not pull the audit logs. 74 00:04:53,220 --> 00:04:54,520 They also might not pull the change. 75 00:04:55,560 --> 00:04:59,820 And this is, I think this is generally a pretty important thing to do in a security system. 76 00:04:59,940 --> 00:05:08,240 But it's kind of ironic because the things that we found problems with would be, like, probably even worse if the threat model was that an insider was attacking the system. 77 00:05:08,600 --> 00:05:16,780 So a lot of these systems were sold with the idea that you basically would want to have this so you could stop your employees from, like, skimming money. 78 00:05:16,940 --> 00:05:19,500 I can, in, I think it was San Francisco, actually. 79 00:05:19,500 --> 00:05:21,840 Someone was arrested with $7,000 in coins. 80 00:05:22,140 --> 00:05:24,680 In 2007 or 1997 or something. 81 00:05:24,800 --> 00:05:26,180 It was a news article we found online. 82 00:05:27,080 --> 00:05:27,800 Oh, yeah. 83 00:05:28,260 --> 00:05:29,720 Actually, no, that was a different thing. 84 00:05:29,880 --> 00:05:31,980 I think they landed on the moon, right? 85 00:05:32,160 --> 00:05:32,820 Yeah, yeah. 86 00:05:32,900 --> 00:05:33,400 I'm not sure. 87 00:05:34,660 --> 00:05:41,760 Anyway, so the idea, though, that the insider is the threat means that they probably designed this wrong because we're not insiders either. 88 00:05:42,500 --> 00:05:45,600 But, I mean, it seems like there's some pretty bad design flaws. 89 00:05:47,120 --> 00:05:49,480 So the way parking works. 90 00:05:49,500 --> 00:05:52,720 So the first way parking worked was, I think, with the digital meter technology sort of started was obviously mechanical-based. 91 00:05:53,160 --> 00:05:56,360 In the early 90s, these hybrid meters started coming up. 92 00:05:56,420 --> 00:06:00,760 So it was mechanical-based where you put your money in and you'd turn the knob in some way to feed the money through. 93 00:06:00,880 --> 00:06:12,360 But then there was an electronic system, very minimal, to keep track of timing, possibly for sending out some startup messages or some administrative messages. 94 00:06:13,120 --> 00:06:17,140 But now, as I mentioned, everything is just a pure electronic system. 95 00:06:17,260 --> 00:06:19,100 You know, going from the coin detection. 96 00:06:19,820 --> 00:06:25,080 which is some inductive method using coils and some electronics and processing to figure out the coin type, 97 00:06:26,080 --> 00:06:28,280 to a microprocessor with memory. 98 00:06:28,800 --> 00:06:31,820 And now we treat these systems as actual embedded systems, 99 00:06:31,880 --> 00:06:36,460 and we would go about analyzing them and breaking them the same way we would any other type of hardware product. 100 00:06:36,580 --> 00:06:39,140 So, you know, we've gone from mechanical to essentially solid state. 101 00:06:41,340 --> 00:06:45,940 So here you can see some reconnaissance, just kind of like accidental reconnaissance. 102 00:06:46,040 --> 00:06:47,880 Yeah, I just happened to walk up right to her. 103 00:06:47,880 --> 00:06:53,700 Yeah, so basically it looks like this person has, like, a small electronic device stuck into the key slot, 104 00:06:53,900 --> 00:06:57,180 and if you look at the crash cart that you have there, that's kind of crazy. 105 00:06:57,240 --> 00:06:58,880 Your meter system has a crash cart. 106 00:07:00,120 --> 00:07:05,340 But it looks like she has a small handheld device, which if you read some of the documentation for this particular meter, 107 00:07:05,460 --> 00:07:11,340 you'll find out that they have, like, a super secure Windows CE device that you can plug into the serial bus that's in the coin slot, 108 00:07:11,540 --> 00:07:14,040 or in the key lock. 109 00:07:14,200 --> 00:07:17,860 But it doesn't look like the lock is open, so it's as if they made the actual lock. 110 00:07:17,880 --> 00:07:21,640 into a serial port, which seems, like, kind of crazy. 111 00:07:21,780 --> 00:07:24,460 Right, so we think that this person, this was in San Francisco, 112 00:07:24,680 --> 00:07:30,680 and we think that this person was going around and grabbing audit logs or updating the meter in some way, 113 00:07:30,780 --> 00:07:32,380 so she wasn't there to pull the money out. 114 00:07:32,500 --> 00:07:38,260 So even though, you know, the coin, the serial interface for this PDA was through the coin lock, 115 00:07:38,680 --> 00:07:40,040 she couldn't get access to it. 116 00:07:40,100 --> 00:07:42,880 So that's the exact point of the role separation. 117 00:07:43,880 --> 00:07:46,180 Most parking meters have some sort of user interface. 118 00:07:46,240 --> 00:07:46,860 You can pay it. 119 00:07:47,880 --> 00:07:55,260 Whether it's coin, smart card, credit card, some now accept text messages in some form. 120 00:07:55,940 --> 00:07:57,220 And then there's administrator interfaces. 121 00:07:57,380 --> 00:07:58,100 Some of them are the same. 122 00:07:58,240 --> 00:08:03,180 So the coin slot, the smart card interface could be used for, depending on the system, 123 00:08:03,820 --> 00:08:06,720 for administrator access through some piece of hardware. 124 00:08:07,040 --> 00:08:08,340 Usually it's some serial interface. 125 00:08:08,540 --> 00:08:13,240 The coin slot, because it has inductive, it has coils, so you could do some really short-range wireless. 126 00:08:13,720 --> 00:08:17,800 Then you have infrared capabilities and other wireless capabilities. 127 00:08:17,880 --> 00:08:24,080 And then other stuff that might be completely meter-specific, like the serial via the coin lock. 128 00:08:24,260 --> 00:08:28,260 So a lot of interfaces out there, and the more interfaces that are out there per meter, 129 00:08:28,420 --> 00:08:30,140 we can target each of those. 130 00:08:30,360 --> 00:08:33,020 You know, it's like every single interface is an attack vector. 131 00:08:33,200 --> 00:08:35,740 The attack surface for some of these meters is just ridiculous. 132 00:08:36,000 --> 00:08:41,080 Like, I don't know how the designers of these systems thought they could get away with putting something like this 133 00:08:41,080 --> 00:08:44,500 in front of every single person all the time, especially something that often makes people mad. 134 00:08:45,360 --> 00:08:45,800 So... 135 00:08:45,800 --> 00:08:46,080 Yeah. 136 00:08:46,160 --> 00:08:47,220 It seems like a lot of the... 137 00:08:47,940 --> 00:08:51,140 The design work that had gone on for security is just for vandalism. 138 00:08:51,320 --> 00:08:52,420 And they never... 139 00:08:52,420 --> 00:08:56,660 The designers didn't think about, you know, this next generation of attacks. 140 00:08:57,160 --> 00:09:02,020 Basically, if you read some of the documentation, they say stuff like the smart card, you know, 141 00:09:02,020 --> 00:09:04,720 slot is modular so that it can serve as the sacrificial part. 142 00:09:04,920 --> 00:09:07,820 So they're like, AUG is going to attack our meter. 143 00:09:07,920 --> 00:09:08,940 AUG has tinfoil. 144 00:09:09,080 --> 00:09:11,360 Ah, AUG has shorted out smart card reader. 145 00:09:12,100 --> 00:09:14,460 Well, we can totally protect against AUG. 146 00:09:14,560 --> 00:09:15,240 No problem. 147 00:09:16,580 --> 00:09:17,020 Fuck. 148 00:09:18,400 --> 00:09:19,120 All right. 149 00:09:19,140 --> 00:09:23,060 So we took a few pictures of some parking meters just from various cities. 150 00:09:23,180 --> 00:09:25,040 This one has a smart card interface from Austin. 151 00:09:25,580 --> 00:09:31,180 This is a Chicago multi-space meter, which we'll mention in a few slides when we talk about some previous work and problems. 152 00:09:32,800 --> 00:09:35,080 For those of you that know me, you know that I love Canada. 153 00:09:36,560 --> 00:09:37,920 And this meter is great. 154 00:09:38,020 --> 00:09:41,280 It's also by the same company that designed the San Francisco meters, JJ McKay. 155 00:09:41,820 --> 00:09:43,000 And this one's interesting. 156 00:09:43,340 --> 00:09:44,460 I didn't actually use it. 157 00:09:44,500 --> 00:09:45,820 I didn't have a car when I was in Vancouver. 158 00:09:45,820 --> 00:09:54,580 And apparently, you call this number, or you text message this number, and you basically don't actually change the value on the meter. 159 00:09:54,680 --> 00:09:57,820 But the meter may have, like, a log that shows which ones have paid by that way. 160 00:09:57,920 --> 00:10:06,560 And then even though it's expired, they won't give you a ticket because they know the time in which it's supposed to be up, which is kind of an interesting system here. 161 00:10:06,620 --> 00:10:09,620 So you have a completely separate system that overrides the mechanical meter. 162 00:10:09,760 --> 00:10:15,560 So you could, in theory, give everyone free parking or something like that by doing that, like attacking this other system. 163 00:10:15,820 --> 00:10:17,620 So it's like, who designed those systems? 164 00:10:17,720 --> 00:10:18,780 Did they know they would work together? 165 00:10:19,000 --> 00:10:20,980 It's like, that's a really interesting idea. 166 00:10:21,140 --> 00:10:24,080 And if they haven't done some due diligence with that, it could be very, very bad. 167 00:10:24,620 --> 00:10:32,860 That one also seems sort of labor-intensive because if, you know, normally a meter maid will drive by the meters, and they'll look at the backsides to see if time's expired. 168 00:10:33,260 --> 00:10:41,900 But in this case, if somebody is paying online and then the meter actually does stay at zero, they're going to have to stop at each one and check to see if the person paid via phone instead. 169 00:10:42,240 --> 00:10:43,040 Yeah, it's pretty rough. 170 00:10:46,480 --> 00:10:51,000 Here's a parking meter from Jerusalem that was near the old city. 171 00:10:51,700 --> 00:10:57,000 And it's just, there's a few different major brands of parking meter manufacturer, and we'll talk about those. 172 00:10:57,180 --> 00:11:00,600 But this was, I believe this was POM. 173 00:11:02,700 --> 00:11:07,440 So some of the prior problems, we're not the first to look at parking meters, and hopefully we're not going to be the last. 174 00:11:07,720 --> 00:11:11,040 But there's been people messing with these things as long as they've been around. 175 00:11:11,860 --> 00:11:15,800 New York City in 2001, when some of the early electronic parking meters were made, they were not the first to look at parking meters. 176 00:11:15,820 --> 00:11:20,120 They had infrared capability for their administrator interface. 177 00:11:20,500 --> 00:11:28,420 And somebody figured out that they could take a universal remote control and hit one of the buttons to reset the value of money on the meter. 178 00:11:29,880 --> 00:11:34,920 Which is one of the exact social attacks that we had kind of come up with. 179 00:11:35,380 --> 00:11:37,360 Is Hikari here in the audience? 180 00:11:37,620 --> 00:11:38,860 Are you here, David? 181 00:11:39,480 --> 00:11:40,520 No, okay. 182 00:11:40,720 --> 00:11:45,800 Well, he wrote a pretty awesome paper in the Uninformed Journal, which if you don't read, does anybody here read Uninformed? 183 00:11:45,820 --> 00:11:46,720 Raise your hand. 184 00:11:48,100 --> 00:11:48,340 Wow. 185 00:11:48,620 --> 00:11:50,280 Okay, you should all read Uninformed. 186 00:11:50,400 --> 00:11:53,460 It's the most hardcore technical journal basically since Frack. 187 00:11:53,660 --> 00:11:56,400 So if you're not reading it, you're probably uninformed. 188 00:11:56,580 --> 00:11:58,180 So you should read Uninformed and be informed. 189 00:11:58,900 --> 00:12:05,600 But this is a great text file by Hikari, and it talks about attacking the San Diego stored value card, which is pretty, it's a good one. 190 00:12:05,940 --> 00:12:13,160 Yeah, it's a completely different smart card implementation, but it's almost a different type of smart card. 191 00:12:13,200 --> 00:12:15,220 So it's worth seeing so you can kind of get a view. 192 00:12:15,900 --> 00:12:18,140 Of how very smart cards are used. 193 00:12:18,420 --> 00:12:24,640 And then Chicago recently deployed a bunch of multi-space parking meters all over the city in June. 194 00:12:24,840 --> 00:12:26,200 How many people here are from Chicago? 195 00:12:27,260 --> 00:12:28,720 Have you seen these parking meters? 196 00:12:29,480 --> 00:12:29,960 Yes. 197 00:12:30,020 --> 00:12:30,920 Do you love them? 198 00:12:31,660 --> 00:12:34,480 Yeah, nobody in Chicago seems to like parking. 199 00:12:35,100 --> 00:12:39,760 Right, so, I mean, Chicago has been notorious for disliking the parking situation there. 200 00:12:40,520 --> 00:12:42,900 Meters are always being vandalized, they're always being damaged. 201 00:12:43,200 --> 00:12:45,160 And I don't know. 202 00:12:45,180 --> 00:12:45,720 For some reason. 203 00:12:45,720 --> 00:13:01,660 For some reason, when some of these parking meters came out, these multi-space meters, some of them failed, and they weren't working, and the media said, oh, no, hackers have taken over our parking meters, and they got in touch with me, and Jake politely declined to talk to them. 204 00:13:01,840 --> 00:13:03,000 I just deleted their email. 205 00:13:04,040 --> 00:13:11,820 But I called them back and had to give them my view, which was, sorry, it's not hackers. 206 00:13:12,200 --> 00:13:13,680 It's probably a firmware problem. 207 00:13:14,040 --> 00:13:15,700 Because the multi-space meters that failed. 208 00:13:15,720 --> 00:13:17,340 And I don't exactly know how they failed. 209 00:13:17,400 --> 00:13:18,180 I think they just didn't work. 210 00:13:19,140 --> 00:13:26,800 We're all situated in one neighborhood of Chicago that had a different rate than the rest of the city, and it was, like, a really expensive rate. 211 00:13:26,900 --> 00:13:30,880 And I don't think they tested that rate, so there might have been some firmware problem or some overflow or something. 212 00:13:31,060 --> 00:13:34,760 So it was in the news, and it was all over the place, and then it quietly disappeared. 213 00:13:35,060 --> 00:13:39,680 So I don't know if anybody from Chicago knows the real result of that. 214 00:13:40,460 --> 00:13:40,820 No. 215 00:13:40,900 --> 00:13:43,460 Are you suggesting that greed might have caused a firmware bug? 216 00:13:44,480 --> 00:13:44,840 Possibly. 217 00:13:45,080 --> 00:13:45,440 Whoops. 218 00:13:46,220 --> 00:13:48,480 They're like, let's jack up the rate as much as we can. 219 00:13:49,320 --> 00:13:52,620 That's pretty bad if you hit, like, an overflow condition from raising your prices. 220 00:13:54,700 --> 00:14:01,560 And Chicago, too, also has some sort of wireless communication back up to the cell phone network and then back to some mothership. 221 00:14:01,600 --> 00:14:04,920 So they were connected, and that opens up a whole new range of attacks. 222 00:14:05,260 --> 00:14:08,840 Who here thinks that just because you're using a cell phone, the file layer is secure? 223 00:14:09,340 --> 00:14:12,300 I mean, how many people have you seen around here just using, like, cell modems? 224 00:14:12,720 --> 00:14:15,620 Like, it seems like if there's some sort of... 225 00:14:15,620 --> 00:14:20,020 If you're using a cell modem back into these things, you should all start hacking on CDMA and GSM stuff. 226 00:14:20,440 --> 00:14:21,760 I mean, it's not hard, right? 227 00:14:22,360 --> 00:14:23,360 I'm sure someone is. 228 00:14:23,580 --> 00:14:23,720 Right. 229 00:14:23,800 --> 00:14:24,180 Well, definitely. 230 00:14:24,340 --> 00:14:24,960 Use a GNU radio. 231 00:14:27,360 --> 00:14:35,000 So this is just the general process of how we approach the problem and how we approach sort of any hardware problem. 232 00:14:35,980 --> 00:14:37,220 Kind of think about some attacks. 233 00:14:37,480 --> 00:14:45,220 We postulate some various attacks about what we could do, you know, from the most lofty goals to kind of the most maybe obvious. 234 00:14:45,220 --> 00:14:46,100 Or low-hanging fruit. 235 00:14:47,080 --> 00:14:48,080 Then we gather information. 236 00:14:48,700 --> 00:14:50,260 We will analyze hardware. 237 00:14:50,440 --> 00:14:52,080 We analyze firmware, if necessary. 238 00:14:52,440 --> 00:14:54,560 And then we look at any external interfaces. 239 00:14:54,800 --> 00:14:57,420 In our case, there's a smart card interface, so we looked at that. 240 00:14:59,320 --> 00:15:04,980 So no pun intended while saying this with a member of the loft on stage, but the loftiest one we thought was the covert channels. 241 00:15:05,200 --> 00:15:10,540 Like, imagine you know someone's serial number for their smart card, or you know how they pay via cell phone. 242 00:15:10,700 --> 00:15:14,540 You could potentially set up the LCD so that it sends, you know, a message like, 243 00:15:14,640 --> 00:15:14,820 Oh. 244 00:15:15,220 --> 00:15:15,800 Hello, Joe. 245 00:15:15,900 --> 00:15:16,880 The crow flies at midnight. 246 00:15:18,260 --> 00:15:19,000 Modifying the firmware. 247 00:15:19,280 --> 00:15:19,460 Right. 248 00:15:20,400 --> 00:15:21,840 And I think it was Jeff Moss. 249 00:15:22,020 --> 00:15:29,120 He suggested, well, you know, if you have these RF interfaces and, you know, the meters were exploitable, well, why don't you just, you know, make some malware that spreads between meters? 250 00:15:29,580 --> 00:15:32,000 I mean, if they're a mesh, then, you know, mesh it. 251 00:15:32,180 --> 00:15:32,540 Yeah. 252 00:15:33,880 --> 00:15:41,440 And then denial of service are sort of these destructive attacks, but depending on the attacker's goals might still be valid. 253 00:15:41,640 --> 00:15:44,400 So setting a meter out of order, just preventing people from parking there. 254 00:15:44,400 --> 00:15:47,420 Because a lot of cities, if the meter is out of order, you're not allowed to park there. 255 00:15:47,560 --> 00:15:49,360 Or you're only allowed to park there for an hour. 256 00:15:50,400 --> 00:15:51,440 And then you'll get a ticket. 257 00:15:51,680 --> 00:15:54,320 And that could also be useful if you're like, well, you know, I got to leave. 258 00:15:54,480 --> 00:15:56,680 I'll set the meter to out of order and then I'll come back. 259 00:15:56,800 --> 00:15:56,880 Right. 260 00:15:57,440 --> 00:15:57,760 Yeah. 261 00:15:59,260 --> 00:16:08,480 And then, of course, destroying any sort of user interface, smart card interface, or coin processing circuitry with a little ESD pulse using a little discharge tool. 262 00:16:09,000 --> 00:16:11,600 Some of the meters are designed to be electrically isolated. 263 00:16:11,840 --> 00:16:14,380 But, you know, I think that if you have a tech. 264 00:16:14,380 --> 00:16:17,320 Taser or stun gun, you could find out how well they did that. 265 00:16:19,220 --> 00:16:29,160 I'm not suggesting that I tested this, but if you just look at some of the boards that you can buy or the meters on eBay, you see that they very clearly take the route of, oh, well, the smart card interface is the one that's going to get attacked. 266 00:16:29,700 --> 00:16:32,500 But they forget about maybe like the external serial bus or something. 267 00:16:32,740 --> 00:16:32,980 Yeah. 268 00:16:34,520 --> 00:16:40,880 And then, you know, possibly even if you know if you know how the system operates, causing a legitimate user to be added to some fraud list. 269 00:16:40,880 --> 00:16:46,780 If there is a fraud list implemented in the city, say, based on serial number. 270 00:16:47,180 --> 00:17:01,220 So if I know Jake's serial number of his prepaid card that he's using, you know, maybe I would clone his card and use it all over the city all the time and generate some flag somewhere to prevent him from legitimately using his card. 271 00:17:03,360 --> 00:17:07,120 So it's also possible that you could do some sort of immediate deduction of credit. 272 00:17:07,220 --> 00:17:10,820 So if someone walks up and they put in three hours and then they leave. 273 00:17:11,520 --> 00:17:13,940 We mentioned this at Black Hat when we were talking about this. 274 00:17:14,060 --> 00:17:16,940 And some guy from Montreal is like, oh, yes, we love to do that in Montreal. 275 00:17:17,300 --> 00:17:18,800 We hate those fucking parking meters. 276 00:17:19,240 --> 00:17:26,360 And so apparently the deal is that you park the car, you put in the change, and you are not allowed to refill it. 277 00:17:26,440 --> 00:17:32,940 So if you put in more change, the incentive system, yes, it was that fine gentleman there, it resets to zero. 278 00:17:33,100 --> 00:17:40,380 So apparently there's like a social fad about going and dropping in coins across the whole block in order to raise doubts about the meter system. 279 00:17:40,880 --> 00:17:44,620 And basically anyone can contest a ticket because it's so easy to break that system. 280 00:17:45,240 --> 00:17:47,140 So in a way, I mean, that's great. 281 00:17:47,280 --> 00:17:51,440 They showed that the machine was not perfect, which is important. 282 00:17:51,800 --> 00:17:55,700 And this is exactly what people in New York were doing with the infrared remote controls as well. 283 00:17:55,840 --> 00:18:01,140 So it's one of the favorite things which would be, hey, you know, there's some guy that you don't like. 284 00:18:01,200 --> 00:18:09,860 He just parked his car, go remove all his credit, call a tow truck, call the parking officials, give him a ticket. 285 00:18:10,460 --> 00:18:15,320 There's also, of course, the possibility that you could change the audit log, right? 286 00:18:15,380 --> 00:18:21,200 So it doesn't look like any of the meters are actually using any sort of computational infeasibility, right? 287 00:18:21,260 --> 00:18:23,640 So it's not like there's a cryptographic problem you have to solve. 288 00:18:23,720 --> 00:18:25,880 It's generally just, do you know something? 289 00:18:26,020 --> 00:18:27,040 Like, do you know how it works? 290 00:18:27,200 --> 00:18:30,520 So that sounds a lot like security through obscurity to me, which means that it's what? 291 00:18:30,740 --> 00:18:31,480 Is that secure? 292 00:18:32,420 --> 00:18:33,080 Probably not. 293 00:18:33,980 --> 00:18:38,520 And of course, if you wanted to, well, you're better at this part of the slide than I am. 294 00:18:38,520 --> 00:18:39,220 I don't know about that. 295 00:18:39,220 --> 00:18:43,300 But so changing the time and date could always be fun, right? 296 00:18:43,380 --> 00:18:45,600 If you, you know, everybody gets free parking on Sunday. 297 00:18:45,700 --> 00:18:46,420 So what could you do? 298 00:18:46,560 --> 00:18:47,620 You know, change the date. 299 00:18:47,660 --> 00:18:50,280 And it's like every day is Sunday, Sunday, Sunday. 300 00:18:50,860 --> 00:18:52,240 Free parking in the city. 301 00:18:53,460 --> 00:18:54,100 They're already here. 302 00:18:54,140 --> 00:18:54,880 We don't have to get their money. 303 00:18:54,960 --> 00:18:56,120 I don't understand why you're saying that. 304 00:18:56,860 --> 00:18:59,460 For those of you that ever watched The Simpsons while growing up. 305 00:18:59,540 --> 00:19:01,360 Thanks for the two that got the reference. 306 00:19:01,640 --> 00:19:03,060 Is that the monorail episode? 307 00:19:03,380 --> 00:19:04,340 I don't even know. 308 00:19:04,400 --> 00:19:07,780 I think it's the one where What's-His-Face goes and works at the racetrack. 309 00:19:07,780 --> 00:19:08,940 And they're bilking everybody. 310 00:19:09,400 --> 00:19:13,440 And anyway, so the least lofty goal just so happens to be the one that probably everybody wants, 311 00:19:13,600 --> 00:19:15,220 which is unlimited payment via smart card. 312 00:19:16,220 --> 00:19:21,080 And that one is kind of incredible because you think, you know, you look at a smart card, 313 00:19:21,140 --> 00:19:22,520 you're like, oh, that's got to be secure. 314 00:19:22,700 --> 00:19:23,460 It's, you know, it's smart. 315 00:19:23,700 --> 00:19:25,380 It's a smart card, right? 316 00:19:25,960 --> 00:19:27,160 So that's got to be secure. 317 00:19:27,220 --> 00:19:28,840 I mean, even as smart in the name. 318 00:19:28,940 --> 00:19:29,620 And it's really tiny. 319 00:19:29,920 --> 00:19:30,140 Yeah. 320 00:19:30,200 --> 00:19:32,000 And so it must be like, you know, smart. 321 00:19:32,100 --> 00:19:32,560 Must be high tech. 322 00:19:32,780 --> 00:19:37,360 So that's actually what we're looking at for the case study in San Francisco is the unlimited payment via smart card. 323 00:19:37,480 --> 00:19:38,360 Not so smart card. 324 00:19:38,540 --> 00:19:38,760 Yeah. 325 00:19:40,040 --> 00:19:42,840 So here's here's the process just on information gathering. 326 00:19:43,000 --> 00:19:46,520 Of course, you do stuff like Google and browse the Internet. 327 00:19:47,640 --> 00:19:53,760 But yeah, you know, there's I'll talk about a little bit in the in the San Francisco case study. 328 00:19:53,920 --> 00:19:56,560 But I mean, social engineering can get you really far. 329 00:19:56,860 --> 00:20:04,660 I mean, just, you know, if you ask technically incorrect, but really specific questions that are maybe 330 00:20:04,660 --> 00:20:08,300 really eager to someone who cares about their job, they'll tell you the most 331 00:20:08,300 --> 00:20:10,380 amazing information about their system. 332 00:20:10,580 --> 00:20:14,480 And generally speaking, if they only tell you a little piece and someone else tells you another piece, 333 00:20:14,660 --> 00:20:17,740 you now have enough to put, you know, something together that is really useful. 334 00:20:18,460 --> 00:20:23,920 And combining that with, say, press releases where everyone's always tooting their own horn about all of the details of their system 335 00:20:23,920 --> 00:20:28,940 and how good it is, you can start to realize where they're lying before you even look at their systems, too, which is great. 336 00:20:29,040 --> 00:20:30,220 Like, for example, it's secure. 337 00:20:30,460 --> 00:20:30,940 Probably not. 338 00:20:31,140 --> 00:20:31,260 Yeah. 339 00:20:31,680 --> 00:20:36,640 And yeah, part of the hard racking process or any sort of analysis process is just gathering clues. 340 00:20:36,940 --> 00:20:38,280 So you do your social engineering. 341 00:20:38,300 --> 00:20:39,880 And you might get one bit of information. 342 00:20:40,080 --> 00:20:41,260 You find something on Google. 343 00:20:41,400 --> 00:20:42,780 You find something in the trash. 344 00:20:43,460 --> 00:20:46,760 All these things, you might not know how they all fit together until you start your work. 345 00:20:46,880 --> 00:20:48,260 And then you're like, oh, I can use that piece. 346 00:20:48,820 --> 00:20:51,960 So another thing is we said, you know, globalism. 347 00:20:52,060 --> 00:20:54,800 What does globalism have to do with, you know, parking meters in a city? 348 00:20:55,180 --> 00:20:59,040 Well, I mean, if you roll your own stuff, you can control your own stuff, right? 349 00:20:59,100 --> 00:21:00,840 You can make sure no one ever sells it on eBay. 350 00:21:01,420 --> 00:21:07,080 But if there's a meter company and they build a piece of hardware and they sell it to another city and they test it in that city, 351 00:21:07,080 --> 00:21:10,200 and then that city buys a new implementation because they didn't like it, 352 00:21:10,260 --> 00:21:12,780 they're going to possibly sell that meter infrastructure online. 353 00:21:13,160 --> 00:21:18,520 And now you can buy that and legitimately own something that's very similar to the meter that's in your city. 354 00:21:18,640 --> 00:21:19,920 And then you can attack that. 355 00:21:20,020 --> 00:21:22,300 And you don't need to take a meter or do something illegal. 356 00:21:22,560 --> 00:21:25,540 You can do it totally legally, which is exactly what we did for our case study. 357 00:21:25,740 --> 00:21:26,480 Thank you, eBay. 358 00:21:27,260 --> 00:21:29,620 Yeah, eBay is a magical place. 359 00:21:31,000 --> 00:21:36,840 And when we started looking at hardware, you know, in general, we just wanted to get an idea about parking meters. 360 00:21:37,080 --> 00:21:41,960 Because it's not often that you can, you know, walk up to one on the street and take it away. 361 00:21:42,160 --> 00:21:44,240 So we wanted to buy some. 362 00:21:44,340 --> 00:21:48,060 And, you know, we did some searches on parking meters on eBay over a span of like two months. 363 00:21:48,200 --> 00:21:50,300 And we bought every type that we could. 364 00:21:50,480 --> 00:21:51,880 And there were three that was available. 365 00:21:52,540 --> 00:21:58,060 The Duncan EMM7700 is the oldest one, the Palm APM, and then the McKay Guardian, 366 00:21:58,180 --> 00:22:03,080 which is the early revision of the McKay Guardian XLE, which is used in San Francisco. 367 00:22:03,300 --> 00:22:06,160 So we were hoping that we could get some clues about the system. 368 00:22:06,160 --> 00:22:13,800 And being a designer, I know this for a fact that revisions of products typically are based on previous revisions of the design. 369 00:22:14,320 --> 00:22:19,060 So we can learn a lot about current systems by looking at older systems 370 00:22:19,380 --> 00:22:24,080 and getting an idea about how, you know, even from a system level, how the design is. 371 00:22:24,180 --> 00:22:29,240 And maybe even from an electrical level about, you know, what microprocessor is being used, 372 00:22:29,340 --> 00:22:32,600 what memory do they like using, what's the interfaces, you know, what things can we look at. 373 00:22:32,700 --> 00:22:33,980 So it gives us clues. 374 00:22:36,160 --> 00:22:39,720 And also actually details and similarities between competing products, which is sort of interesting. 375 00:22:39,860 --> 00:22:42,100 Like most of these are low power, for example. 376 00:22:42,240 --> 00:22:43,800 And some of the things are kind of elegant. 377 00:22:44,000 --> 00:22:47,220 And then you think like for some of the problems that they want to solve, 378 00:22:47,300 --> 00:22:53,580 they might do something kind of, I don't know, like it's almost like a Rube Goldberg machine in some of these meters. 379 00:22:53,680 --> 00:22:59,620 Like this Duncan meter is kind of cool in that it actually is sort of like a hybrid mechanical electronic meter 380 00:22:59,620 --> 00:23:04,780 where they have like, you can see on this slide here, there's some little screws in there. 381 00:23:04,780 --> 00:23:06,240 Those are actually buttons. 382 00:23:06,760 --> 00:23:14,780 And you put a coin in, and then it weighs just a precise area out of the turning implement. 383 00:23:15,060 --> 00:23:16,480 And it turns like so. 384 00:23:16,680 --> 00:23:21,260 And when it turns, it scrapes across the heads of the screws and pushes an electronic button underneath. 385 00:23:21,640 --> 00:23:27,320 So there's sort of this sequence of, if you put a quarter in, it might hit, say here's a picture of the circuitry. 386 00:23:27,400 --> 00:23:33,160 It might hit one of the buttons, like button number one, button number three, and then button number four. 387 00:23:33,160 --> 00:23:36,780 But if it's a dime, it might hit button number two, button number three, and button number four. 388 00:23:36,840 --> 00:23:44,300 So there's a sequence to program the time corresponding to that value onto the screen. 389 00:23:45,900 --> 00:23:49,400 There's also some, so this is the circuitry, this is the oldest one, as I mentioned, from 1991. 390 00:23:50,420 --> 00:23:56,960 There's a bunch of the buttons that are used for the coin stuff, but there's also some administrator reset buttons, 391 00:23:57,040 --> 00:24:01,500 which are cool, there's infrared. So people have been using infrared for a really long time. 392 00:24:01,940 --> 00:24:02,320 And... 393 00:24:03,640 --> 00:24:10,100 It's still in use, and from what I know, all of that stuff is just being sent, if not in clear, with some just very poor encoding. 394 00:24:10,480 --> 00:24:14,100 Anybody see the microprocessor on this board? Anyone know where it is? 395 00:24:14,800 --> 00:24:15,940 It has to be there somewhere. 396 00:24:16,120 --> 00:24:17,940 Right, there's something. Anyone? Take a shot at it? 397 00:24:18,360 --> 00:24:20,180 Win my shirt. Win my shirt. 398 00:24:21,680 --> 00:24:24,360 Wow. That's pretty generous. Do you have another one to wear afterwards? 399 00:24:24,560 --> 00:24:24,960 No, I don't. 400 00:24:25,700 --> 00:24:28,240 So the microprocessor is actually hidden under the LCD. 401 00:24:30,480 --> 00:24:32,300 Which might not be an intentional... 402 00:24:34,260 --> 00:24:39,540 Thing to, you know, from a security point of view, it might just be because a lot of the pinouts go to drive the LCD, which is right there. 403 00:24:39,980 --> 00:24:46,180 But it is under the LCD, which means if you want to get access to it, and this has internal ROM, then you need to tear the meter apart. 404 00:24:48,100 --> 00:24:50,300 The Palm APM, this is a meter from Israel. 405 00:24:50,740 --> 00:24:54,240 It takes shekels. But it's made by Palm in the US. 406 00:24:54,480 --> 00:24:59,020 So there is this cross-pollination of various countries sharing their devices. 407 00:24:59,020 --> 00:25:04,560 Which could be ripe for international espionage, I guess. 408 00:25:04,740 --> 00:25:05,560 Yeah, I don't know. 409 00:25:05,660 --> 00:25:16,600 I mean, it seems like if you have someone designing the whole system in another country, there's a different set of economic and legal implications for the person that breaks that system. 410 00:25:16,920 --> 00:25:23,140 They maybe never need to set foot in that country and they could like sell cards or something and mail them abroad and make money from it. 411 00:25:23,200 --> 00:25:24,120 Like, oh, broke the system. 412 00:25:24,240 --> 00:25:26,840 So like an insider understanding how this works. 413 00:25:27,020 --> 00:25:28,500 If it isn't something that's... 414 00:25:29,020 --> 00:25:33,460 If it's actually secured by some infeasibility problem, it's just like a disaster waiting to happen, I think. 415 00:25:33,640 --> 00:25:38,920 Yeah, and some of you guys might be thinking, oh, well, you know, there's no way someone's ever going to get access to a parking meter. 416 00:25:39,060 --> 00:25:40,700 There's big locks on the meters. 417 00:25:41,460 --> 00:25:42,660 That's just physical protection. 418 00:25:42,920 --> 00:25:49,880 And if you're at DEF CON, you might realize that physical protection and locks don't really stop everybody. 419 00:25:50,380 --> 00:25:53,820 Maybe Barry's here and he could tell us how good locks are, mechanical locks, right? 420 00:25:54,020 --> 00:25:57,940 I mean, there's no real mechanical lock that is unbreakable, right? 421 00:25:57,940 --> 00:26:01,560 So, I mean, you might need to be buried to break some of them. 422 00:26:01,620 --> 00:26:09,260 But essentially, if you are relying on physical security to ensure you don't have what amounts to a class break for your entire city, you're probably doing it wrong. 423 00:26:09,540 --> 00:26:12,480 Key diversity is something that could be really useful to you here. 424 00:26:13,260 --> 00:26:17,720 Probably both in the actual physical keying of the metering infrastructure, but also in software. 425 00:26:18,480 --> 00:26:20,000 So there's a few more. 426 00:26:20,060 --> 00:26:21,000 I'm just going to breeze through these. 427 00:26:21,100 --> 00:26:24,600 There's some debug ports that I thought were interesting on the POM. 428 00:26:24,680 --> 00:26:27,660 The POM is also modular, so you can replace the various parts. 429 00:26:27,940 --> 00:26:30,340 They break easy access to the ROM. 430 00:26:30,920 --> 00:26:33,520 Here's another view, easy access to the microprocessor as well. 431 00:26:33,720 --> 00:26:34,560 There's a reset button. 432 00:26:37,140 --> 00:26:37,760 McKay Guardian. 433 00:26:38,380 --> 00:26:42,680 So this is one that was decommissioned from Tallahassee, Florida that we bought on eBay. 434 00:26:42,840 --> 00:26:48,320 Oh, I should mention, too, the price range was from 99 cents for a meter on eBay to $500. 435 00:26:50,320 --> 00:26:53,960 So, you know, well within a budget of most curious people. 436 00:26:55,120 --> 00:26:55,880 Here's the McKay. 437 00:26:55,880 --> 00:26:59,400 Again, easy access to the microprocessor, easy access to the ROM. 438 00:27:00,140 --> 00:27:09,220 The microprocessor in this case is a CLT840231G, which is a custom ASIC with a Z80 core. 439 00:27:10,280 --> 00:27:20,880 So if you were to pull off the ROM, which is an Atmel WProm, you could decompile that or disassemble it and it's Z80. 440 00:27:21,140 --> 00:27:23,100 Toss it into IDA Pro and start looking around. 441 00:27:23,460 --> 00:27:23,980 Yeah. 442 00:27:23,980 --> 00:27:30,140 Another interesting thing about the Guardian is there's this cool RJ45 connector on the lower right. 443 00:27:30,880 --> 00:27:37,920 And reading through some of the data sheets available on their website, it had made mention of some test connector, some interface. 444 00:27:38,160 --> 00:27:44,220 So we're like, oh, okay, maybe, you know, it says something about having a serial port and having some I2C, which is an inner chip communication port. 445 00:27:44,500 --> 00:27:46,620 So we said, oh, maybe we should look at that. 446 00:27:46,760 --> 00:27:47,580 You know, we have the meter. 447 00:27:47,660 --> 00:27:47,980 It's open. 448 00:27:48,060 --> 00:27:48,440 It works. 449 00:27:48,440 --> 00:27:49,240 We might as well look at it. 450 00:27:49,240 --> 00:27:56,580 So we hooked it up to my little lab setup with my digital oscilloscope and some level shifter circuitry. 451 00:27:56,660 --> 00:27:59,280 And we're probing all the different pins trying to figure out what's what. 452 00:27:59,460 --> 00:28:03,460 Because if there's an inner chip communication, maybe that's something useful to drive the display. 453 00:28:04,500 --> 00:28:09,340 But more importantly, I want to see the serial interface if that was the debug port for sucking audit log information. 454 00:28:09,920 --> 00:28:12,240 And they had infrared on this particular version. 455 00:28:12,380 --> 00:28:19,220 And what we figured out is that on reset, on power up, the infrared port would spew out a bunch of data. 456 00:28:19,220 --> 00:28:25,540 A bunch of stuff that also correlated to some data we were seeing over the wire. 457 00:28:25,720 --> 00:28:29,040 So sort of infrared and serial information being set out. 458 00:28:29,200 --> 00:28:30,620 And we tried to probe that for a while. 459 00:28:30,740 --> 00:28:31,580 And we're just kind of playing around. 460 00:28:31,680 --> 00:28:33,620 We didn't exactly figure out how it worked. 461 00:28:33,700 --> 00:28:36,540 But given time, we definitely would have. 462 00:28:36,820 --> 00:28:37,140 Yeah. 463 00:28:37,260 --> 00:28:38,880 It was only mildly interesting. 464 00:28:39,780 --> 00:28:46,000 But just looking at the way that it was designed, we realized that if this was sort of like the parent of the San Francisco meters, 465 00:28:46,120 --> 00:28:49,200 then that does not bode well for us. 466 00:28:49,220 --> 00:28:50,820 And that's why we decided to go for San Francisco's purchasing decision. 467 00:28:51,460 --> 00:28:51,800 Right. 468 00:28:53,500 --> 00:28:56,180 And then firmware analysis, which we did not do in our case. 469 00:28:56,380 --> 00:29:00,860 But just in general, if you do end up getting access to memory devices or to microprocessors, 470 00:29:01,400 --> 00:29:05,680 the first thing you would do is suck all of the data out of them, suck all the program code out of them, 471 00:29:05,740 --> 00:29:08,200 and then reverse engineer them, decompile them, do whatever you need to do. 472 00:29:08,400 --> 00:29:08,640 Right. 473 00:29:08,700 --> 00:29:15,380 So, I mean, if you know the company that's building the system and you understand what compiler they're using, for example, 474 00:29:15,520 --> 00:29:16,780 and you toss that into IDA Pro, 475 00:29:16,780 --> 00:29:19,660 you can help guide IDA Pro, for example. 476 00:29:19,800 --> 00:29:22,760 That would be pretty useful if you want to use OpsJump and grep, I guess. 477 00:29:22,880 --> 00:29:24,160 You could also do it that way. 478 00:29:24,980 --> 00:29:30,340 So it would be really useful because maybe there's some particular portion of a problem you want to solve, 479 00:29:30,440 --> 00:29:34,280 but you can't figure out the generalized algorithm or you can't figure out exactly what they're doing. 480 00:29:34,400 --> 00:29:37,880 Maybe they have some sort of shift feedback register thing going on. 481 00:29:38,020 --> 00:29:43,240 It would be useful to see the structure of the firmware so that you could better understand what's actually happening 482 00:29:43,720 --> 00:29:45,520 without just doing an intercept. 483 00:29:45,520 --> 00:29:49,300 Yeah, and you can also target specific areas if you don't want to reverse engineer the whole thing 484 00:29:49,300 --> 00:29:53,440 because you just want to get clues or maybe figure out an access point to get to an administrator menu. 485 00:29:53,820 --> 00:30:00,700 But what I like to do, since I'm not the greatest reverse engineer for binaries and for firmware and stuff for source code, 486 00:30:00,900 --> 00:30:07,080 I usually run stuff through strings first to see if there's any information, any cool constants and texts that are there. 487 00:30:07,220 --> 00:30:12,500 And usually there are because engineers like to leave stuff in that's going to help them, debug messages, stuff like that. 488 00:30:12,840 --> 00:30:14,940 And usually those are left in production products. 489 00:30:16,440 --> 00:30:17,940 And then smart card analysis. 490 00:30:18,260 --> 00:30:22,220 Again, I mentioned in this case if you have an external interface that is a smart card, you would do this. 491 00:30:22,240 --> 00:30:25,140 If you have an external interface for other things, you would analyze those. 492 00:30:25,380 --> 00:30:26,680 This is the process that we went through. 493 00:30:27,740 --> 00:30:31,140 Monitoring communications, you might want to try to decode the protocols, emulate the protocols. 494 00:30:32,380 --> 00:30:37,420 So one thing that's really good about this is that looking at press releases can be really helpful for this, 495 00:30:37,560 --> 00:30:39,120 especially when they're from the company. 496 00:30:39,220 --> 00:30:41,620 They'll say something like, it's secure and we use this standard. 497 00:30:42,120 --> 00:30:45,400 So then you go and read that standard and you think to yourself, this isn't secure. 498 00:30:45,520 --> 00:30:45,700 It's not secure at all. 499 00:30:46,560 --> 00:30:51,540 And that's really useful, especially when you start to do the decoding and you want to do the emulation 500 00:30:51,540 --> 00:30:53,260 because you can implement part of the standard. 501 00:30:53,440 --> 00:30:56,480 And then when you've done that, you of course know that that is not true, that it is secure. 502 00:30:59,220 --> 00:31:00,740 My coffee is almost working. 503 00:31:01,600 --> 00:31:02,740 Almost. A few more minutes. 504 00:31:02,940 --> 00:31:08,960 All right, so now we're going to jump into the case study of the San Francisco MTA. 505 00:31:09,880 --> 00:31:14,660 And the city of San Francisco for a long time has sort of been grasping at straws 506 00:31:14,660 --> 00:31:17,460 of what parking infrastructure should we use. 507 00:31:18,140 --> 00:31:20,600 Should we use electronic meters, single space meters? 508 00:31:20,680 --> 00:31:21,820 Should we use multi-space meters? 509 00:31:21,880 --> 00:31:23,380 That's made by a company called Rhino. 510 00:31:24,100 --> 00:31:28,600 The smart card that you see in the single space meter also works in the Rhino, 511 00:31:28,640 --> 00:31:31,580 so there is some modularity there. 512 00:31:32,200 --> 00:31:38,920 This system was essentially a pilot program in 2003 and it cost $35 million, which we'll get to. 513 00:31:39,420 --> 00:31:43,160 But we should make a disclaimer first about this. 514 00:31:43,160 --> 00:31:45,180 Yeah, go ahead. 515 00:31:45,400 --> 00:31:51,000 So first of all, contrary to Wired totally fucking us with the title of their story saying 516 00:31:51,000 --> 00:31:54,400 free parking for all, which we expressly told them not to say 517 00:31:54,400 --> 00:31:56,960 because we didn't want to end up like the MBTA kids, 518 00:31:58,080 --> 00:32:01,340 we are not trying to get people to defraud the San Francisco parking meters. 519 00:32:01,540 --> 00:32:03,720 The point here is more to undermine its authority. 520 00:32:04,420 --> 00:32:05,940 I think that's much more important. 521 00:32:06,120 --> 00:32:10,400 And we should all do our job to undermine authority wherever we can, 522 00:32:10,400 --> 00:32:13,700 especially when it isn't, you know, necessarily duly received. 523 00:32:13,840 --> 00:32:16,220 I mean, San Francisco essentially wants to create revenue here. 524 00:32:16,620 --> 00:32:19,200 I think it's good to put doubt in the perfection of the machine. 525 00:32:19,560 --> 00:32:22,700 I think that when people get parking tickets, you should be able to contest them. 526 00:32:22,840 --> 00:32:27,880 I think that there isn't... God, I can't do it, but I'm going to quote Jean-Luc Picard. 527 00:32:29,040 --> 00:32:30,200 Oh, this is going to be good. 528 00:32:30,440 --> 00:32:32,560 There can be no justice when rules are absolute. 529 00:32:34,000 --> 00:32:35,100 Okay? It's true. 530 00:32:38,260 --> 00:32:39,260 Machines are not perfect. 531 00:32:39,260 --> 00:32:43,040 And there was a 19th century anarchist who said something along the lines of, 532 00:32:43,080 --> 00:32:47,040 it is not that I fear that machines will begin to think like men. 533 00:32:47,200 --> 00:32:47,840 No, no. 534 00:32:47,900 --> 00:32:50,900 It is that I fear that men will begin to think like machines. 535 00:32:51,820 --> 00:32:53,840 And we have to fight against that, I think. 536 00:32:53,940 --> 00:32:56,500 So hopefully this is like, you know, chipping away at that, 537 00:32:56,580 --> 00:32:58,680 for the one anarchist an audience represent. 538 00:32:59,140 --> 00:33:05,060 And we are both San Francisco residents and we pay a lot of tax to the city. 539 00:33:05,220 --> 00:33:05,660 Yeah, seriously. 540 00:33:05,920 --> 00:33:07,820 And it's just that... 541 00:33:07,820 --> 00:33:12,100 It's okay for a city to try to figure out what parking system they want. 542 00:33:12,200 --> 00:33:12,800 And that's fine. 543 00:33:12,880 --> 00:33:15,240 Here's two other parking meters that are available in the city. 544 00:33:15,300 --> 00:33:19,160 This one is a credit card based machine that says the smart cards don't work on them. 545 00:33:20,060 --> 00:33:25,960 It's just our tax dollars are at work and a lot of money is being spent on systems that aren't being analyzed. 546 00:33:26,200 --> 00:33:28,800 Or if they're being analyzed, the problems are just being ignored. 547 00:33:29,060 --> 00:33:31,400 Some tech somewhere in San Francisco... 548 00:33:31,400 --> 00:33:33,700 Or actually, is there anyone from the city of San Francisco here? 549 00:33:35,140 --> 00:33:37,380 Not where you work for the city of San Francisco. 550 00:33:37,380 --> 00:33:38,600 I'm sure that there are people here. 551 00:33:38,740 --> 00:33:40,680 Do you work for the city? Do you work for the DPT? 552 00:33:41,080 --> 00:33:42,860 Anybody from the DPT here? 553 00:33:43,260 --> 00:33:43,840 You are. 554 00:33:44,200 --> 00:33:48,860 I used to be out of Berkeley's IT department and saw their DPT stuff. 555 00:33:49,680 --> 00:33:51,860 Yeah, so somebody here from the Bay Area. 556 00:33:52,180 --> 00:33:56,780 So as Jake mentioned, the meter that we're looking at, the McKay Guardian XLE, 557 00:33:57,300 --> 00:34:02,760 there's 23,000 of them in the city that replaced mechanical meters in 2002 as a pilot program. 558 00:34:02,980 --> 00:34:05,140 A 35 million dollar pilot program. 559 00:34:05,140 --> 00:34:08,380 And to me, a pilot is like a test. 560 00:34:08,480 --> 00:34:09,160 It's like an evaluation. 561 00:34:11,200 --> 00:34:14,640 It's 2009 and they're still evaluating a system. 562 00:34:16,320 --> 00:34:22,700 And 35 million dollars to do an attack like we did, which is very, very easy as you'll see. 563 00:34:23,640 --> 00:34:25,040 It shouldn't be possible. 564 00:34:25,440 --> 00:34:28,800 And it blows my mind how much money they spent on this. 565 00:34:29,000 --> 00:34:30,760 I'm a little conflicted about... 566 00:34:30,760 --> 00:34:34,900 So in general, I think that this kind of disclosure is good so we can influence social policy. 567 00:34:34,900 --> 00:34:37,080 We hope that we can get some of these things to change. 568 00:34:37,940 --> 00:34:44,000 San Francisco wants to install 320,000 of these meters in all of the residential areas of all of the city. 569 00:34:44,140 --> 00:34:48,120 They think that it will improve, for example, the environment because people won't have to double park. 570 00:34:49,180 --> 00:34:51,420 Which sounds like newspeak to me. 571 00:34:51,860 --> 00:34:58,800 But I think before they go and spend 320,000 dollars worth of parking meters worth of money, 572 00:34:58,920 --> 00:35:02,160 I think that maybe we should like question that that's a good idea in the first place. 573 00:35:02,240 --> 00:35:04,340 If they want revenue, they should be upfront about it. 574 00:35:04,340 --> 00:35:09,360 They should say this is the true cost of having a car in the city instead of actually inconveniencing everyone. 575 00:35:09,580 --> 00:35:13,340 Because what will happen is they'll become reliant on the smartcard infrastructure which is thoroughly broken. 576 00:35:13,980 --> 00:35:16,400 And I mean, what are you going to do when you're at home? 577 00:35:16,500 --> 00:35:17,940 You're going to go get a roll of quarters? 578 00:35:18,180 --> 00:35:20,240 I mean, that doesn't scale for an entire city, right? 579 00:35:22,080 --> 00:35:24,580 There are definitely some social problems. 580 00:35:24,840 --> 00:35:27,520 San Francisco uses the McKay Guardian XLE meter. 581 00:35:27,680 --> 00:35:32,240 So if you've got a web browser in front of you and you're on the internet here, you can look that up right now. 582 00:35:32,400 --> 00:35:34,320 Yeah, there's plenty of information out there about that. 583 00:35:34,340 --> 00:35:38,580 I don't know about meters because manufacturers want designers and implementers to use their stuff. 584 00:35:38,760 --> 00:35:39,900 So they make a lot of information available. 585 00:35:40,220 --> 00:35:45,940 So the way the system works is the smartcard interface, the city uses a stored value smartcard. 586 00:35:46,220 --> 00:35:48,080 They come in 20 and 50 dollar quantities. 587 00:35:48,300 --> 00:35:53,280 You buy them in cash at certain places around the city or you use a credit card online. 588 00:35:54,300 --> 00:35:57,760 Once you deduct credit, you put the card into the meter. 589 00:35:57,940 --> 00:36:00,780 The meter displays the value remaining on the card. 590 00:36:00,960 --> 00:36:04,280 And then after a few seconds, it starts deducting units. 591 00:36:04,340 --> 00:36:06,240 Like you're putting quarters into the meter. 592 00:36:06,920 --> 00:36:10,500 Once the value is depleted on the card, it's not reloadable. 593 00:36:10,640 --> 00:36:12,000 It's a one-time thing. You throw it away. 594 00:36:12,940 --> 00:36:18,920 And the research, as you'll see starting right now, is it's easy to replay the smartcard transaction. 595 00:36:19,200 --> 00:36:26,360 So even without knowing anything about how it works, you can replay the entire smartcard transaction to the parking meter and emulate a card. 596 00:36:26,960 --> 00:36:30,400 But then you can also modify certain data to do cooler things. 597 00:36:31,020 --> 00:36:36,180 And we did this solely by looking at captures of an oscilloscope screen, a digital oscilloscope screen, 598 00:36:36,860 --> 00:36:41,460 and then analyzing data on a piece of paper over the course of three days. 599 00:36:41,920 --> 00:36:47,100 Basically, a scope, a pencil, and paper are all you needed to break the San Francisco smartcard implementation. 600 00:36:47,620 --> 00:36:50,120 Yeah. And it was interesting because I'd never worked with smartcards before. 601 00:36:50,200 --> 00:36:53,000 I kind of dabbled with them but not really looked at them in detail. 602 00:36:53,080 --> 00:36:54,440 So it was a fun exercise to do that. 603 00:36:54,720 --> 00:36:57,440 And sort of we came out of it saying, wow, that was kind of easy. 604 00:36:57,560 --> 00:36:58,620 And it shouldn't be that easy. 605 00:36:58,620 --> 00:37:00,180 I worked a little bit with Moxie. 606 00:37:00,200 --> 00:37:02,840 You probably saw his SSL talk on some smartcard stuff. 607 00:37:03,100 --> 00:37:08,600 And so I had some, I was a little familiar with smartcards, but just in general, like I hadn't gone in this deep. 608 00:37:09,020 --> 00:37:17,640 And what actually prompted me to be interested in this is I saw this guy from the DPT who had opened up one of the Rhino multispace meters. 609 00:37:17,760 --> 00:37:19,180 And inside of it was like a circuit board. 610 00:37:19,260 --> 00:37:21,800 I didn't describe this as a black hat, but basically it's a small embedded computer. 611 00:37:22,140 --> 00:37:27,600 And it has like an SD card in it, which looks like it has several hundred megabytes of space. 612 00:37:27,600 --> 00:37:31,300 And I just asked him questions like, wow, you know, I've always wanted to work with computers. 613 00:37:31,440 --> 00:37:31,880 What's that like? 614 00:37:34,780 --> 00:37:37,120 And the guy was like, well, you know, it's a great job. 615 00:37:37,580 --> 00:37:39,520 You know, the city is really great. 616 00:37:39,780 --> 00:37:41,160 And, you know, they treat you well. 617 00:37:41,200 --> 00:37:42,140 We talked for a while. 618 00:37:42,220 --> 00:37:44,800 I asked him questions like, so can I like pay with my cell phone? 619 00:37:44,880 --> 00:37:48,600 I just got one of those wireless telephones so that I can talk to my girlfriend. 620 00:37:50,220 --> 00:37:51,620 And he's like, no, no, can't pay. 621 00:37:51,920 --> 00:37:52,880 Can't pay that way. 622 00:37:52,900 --> 00:37:53,800 No, these are all disconnected. 623 00:37:54,000 --> 00:37:57,580 So like just in the course of like a five minute conversation where I'm holding my backpack over my desk. 624 00:37:57,600 --> 00:37:58,380 I'm wearing my 2600 shirt. 625 00:38:01,320 --> 00:38:05,600 You know, the guy like explained to me everything I needed to know is an offline stored payment system. 626 00:38:05,720 --> 00:38:07,220 And it's not hooked up to the Internet. 627 00:38:07,360 --> 00:38:08,080 They don't do any verification. 628 00:38:08,380 --> 00:38:09,700 They probably don't do any fraud detection. 629 00:38:09,860 --> 00:38:12,180 If they do, they probably do it badly in a way where you can frame someone. 630 00:38:12,320 --> 00:38:16,780 They don't have any actual cryptographic solutions that you'd need to solve and probably replay it, etc. 631 00:38:17,080 --> 00:38:18,680 And the guy didn't realize he was telling me that. 632 00:38:18,760 --> 00:38:22,780 But he was also giving me a job offer at the same time, which is hilarious because they're trying to protect against insider attacks. 633 00:38:25,320 --> 00:38:27,580 So I'm just going to jump back for one second. 634 00:38:27,660 --> 00:38:28,420 We mentioned this already. 635 00:38:28,640 --> 00:38:33,080 You know, the goals of this work weren't to slam San Francisco and get free parking. 636 00:38:33,540 --> 00:38:35,540 We really want to share the process with everybody. 637 00:38:36,720 --> 00:38:43,640 We have released code, but the code is essentially a template for how our smart card emulator worked. 638 00:38:43,840 --> 00:38:48,400 I removed all of the bytes of data that you could use to get free parking in San Francisco. 639 00:38:48,500 --> 00:38:51,780 So anybody who's in the media who's writing about this. 640 00:38:53,040 --> 00:38:57,980 The code is essentially useless unless you're curious about how smart card emulators work. 641 00:38:58,160 --> 00:38:59,240 I changed all the bytes to FF. 642 00:38:59,600 --> 00:39:02,380 It's purely for educational purposes and that's why we're here. 643 00:39:03,040 --> 00:39:03,340 Right. 644 00:39:04,000 --> 00:39:06,080 So some other things with information gathering. 645 00:39:06,520 --> 00:39:07,900 The internet was sort of useful. 646 00:39:08,280 --> 00:39:09,480 Sometimes a useful tool. 647 00:39:09,760 --> 00:39:09,960 Yeah. 648 00:39:10,220 --> 00:39:14,140 I really recommend the airplane method of reconnaissance. 649 00:39:14,640 --> 00:39:18,900 Which is that you set WGET to run and then you get on an airplane. 650 00:39:19,600 --> 00:39:21,100 And then you just come back and read it later. 651 00:39:21,240 --> 00:39:22,060 That's all that matters. 652 00:39:22,060 --> 00:39:23,080 If you do that, you'll be good. 653 00:39:23,300 --> 00:39:24,240 You'll be totally good. 654 00:39:24,380 --> 00:39:24,780 Surprisingly. 655 00:39:28,340 --> 00:39:33,800 The one kind of fun thing here is you would obviously search for product specs and press releases. 656 00:39:34,240 --> 00:39:36,720 But you might also want to think about discussion forums. 657 00:39:37,060 --> 00:39:41,800 Maybe the company is having technical troubles with a certain portion of their design. 658 00:39:42,100 --> 00:39:43,460 Do you think they have technical troubles, Joe? 659 00:39:43,600 --> 00:39:44,500 I'm just not sure. 660 00:39:44,580 --> 00:39:45,220 I think they do. 661 00:39:45,340 --> 00:39:46,360 Or at least they did. 662 00:39:47,300 --> 00:39:51,100 And this was a post that we found on a SIGWIN mailing list. 663 00:39:51,660 --> 00:39:57,260 About some technical problems that one of the software designers were having with his implementation of CVS. 664 00:39:57,380 --> 00:39:58,260 You should definitely read that. 665 00:39:58,300 --> 00:39:59,240 It's a little small, maybe. 666 00:39:59,440 --> 00:39:59,680 Okay. 667 00:39:59,760 --> 00:40:00,600 Yeah, it's a little small. 668 00:40:00,680 --> 00:40:02,660 So it says, it's 2001. 669 00:40:02,820 --> 00:40:04,700 It says, I'm learning how to use CVS. 670 00:40:04,720 --> 00:40:08,020 And as part of this process, I set up a test repository. 671 00:40:08,400 --> 00:40:09,900 I almost said suppository. 672 00:40:10,040 --> 00:40:10,660 To play with. 673 00:40:10,720 --> 00:40:12,820 A test repository to play with. 674 00:40:13,120 --> 00:40:13,640 It's great. 675 00:40:13,820 --> 00:40:17,620 It's 2001 and he's learning CVS. 676 00:40:17,740 --> 00:40:18,020 Ouch. 677 00:40:18,400 --> 00:40:20,080 But there's some interesting clues here. 678 00:40:21,860 --> 00:40:25,240 If you maybe can't really see the paths, but there's some stuff in there. 679 00:40:25,320 --> 00:40:25,940 JJ McKay. 680 00:40:25,980 --> 00:40:28,160 So it's obviously a McKay designer. 681 00:40:28,920 --> 00:40:37,240 MetTalk is an interface that's used and described in some of McKay's documentation about some communications interface. 682 00:40:37,640 --> 00:40:39,720 There's the Gemplus lib path. 683 00:40:39,940 --> 00:40:42,460 So now we know they're using some Gemplus-based smart card. 684 00:40:43,000 --> 00:40:45,680 And we realize they're using GDB and GCC. 685 00:40:45,820 --> 00:40:50,540 So that gives us clues maybe if we need to reverse engineer firmware or try to disassemble stuff. 686 00:40:53,620 --> 00:40:57,340 So here's Chris Tarnofsky's few slides. 687 00:40:58,100 --> 00:40:59,320 Hi, my name is Chris Tarnofsky. 688 00:40:59,440 --> 00:41:01,720 I reverse engineer silicon dies. 689 00:41:01,940 --> 00:41:03,760 What we did is... 690 00:41:03,760 --> 00:41:04,340 I'm the other Chris. 691 00:41:05,120 --> 00:41:06,700 So no, what we did... 692 00:41:06,700 --> 00:41:07,720 We have to go really fast now. 693 00:41:07,880 --> 00:41:09,100 Yeah, we have to go really, really fast. 694 00:41:09,880 --> 00:41:15,860 I bought 20 or 10 stored value $20 smart cards. 695 00:41:17,320 --> 00:41:20,320 And went to send them to Chris to do some die analysis on. 696 00:41:21,100 --> 00:41:24,780 And when I went into the store, I go to the same place all the time when I go and buy my parking cards. 697 00:41:25,320 --> 00:41:28,260 So when I had to buy 10, I was like, I don't know, a little bit paranoid. 698 00:41:28,640 --> 00:41:29,580 Decided to go somewhere else. 699 00:41:29,600 --> 00:41:31,780 And I walk in with my $200 in cash. 700 00:41:32,900 --> 00:41:34,160 And I go up to the guy. 701 00:41:34,160 --> 00:41:36,720 I'm like, yeah, I want to buy 10 smart cards. 702 00:41:37,620 --> 00:41:39,480 And he looks at me, he's like, why do you need 10? 703 00:41:40,100 --> 00:41:41,460 And I said, oh, I'm a sales guy. 704 00:41:41,560 --> 00:41:42,720 I use the car a lot. 705 00:41:42,740 --> 00:41:43,420 I drive around a lot. 706 00:41:43,500 --> 00:41:44,100 He's like, oh, yeah. 707 00:41:44,520 --> 00:41:44,780 Okay. 708 00:41:45,020 --> 00:41:46,120 And then he gives me the smart card. 709 00:41:46,440 --> 00:41:50,200 And of course, one of the things to note is sequential serial numbers on the back of the car. 710 00:41:50,200 --> 00:41:52,920 Yeah, they were all sequential serial numbers, which is useful for analysis. 711 00:41:53,160 --> 00:41:56,840 But I felt pretty good about myself for that quick little like social engineering thing. 712 00:41:56,920 --> 00:41:57,980 You're a regular Kevin Mitnick. 713 00:41:58,040 --> 00:42:00,380 Because as you probably noticed, I smile a lot. 714 00:42:00,620 --> 00:42:03,380 So I don't know if he was like, I don't know. 715 00:42:03,460 --> 00:42:04,320 He believed me, though. 716 00:42:04,360 --> 00:42:04,820 It was kind of cool. 717 00:42:05,620 --> 00:42:06,660 I'm no Kevin Mitnick. 718 00:42:06,860 --> 00:42:09,960 So Chris is totally badass at hardware hacking. 719 00:42:10,100 --> 00:42:15,380 And he, you know, just, you know, decapped all of the chips and then imaged them for us basically. 720 00:42:15,840 --> 00:42:16,120 Oh, yeah. 721 00:42:16,140 --> 00:42:17,380 I just realized we have like 10 minutes. 722 00:42:17,500 --> 00:42:18,120 So, okay. 723 00:42:18,160 --> 00:42:20,020 So he decapped the cards with this process. 724 00:42:20,200 --> 00:42:21,300 That he would discuss if he was here. 725 00:42:21,940 --> 00:42:27,440 It turns out that there's two different types of smart cards that's indistinguishable to the end user. 726 00:42:27,840 --> 00:42:32,320 But one of them is the basic Gem Club memo card. 727 00:42:32,480 --> 00:42:35,200 So it's a fixed ASIC ROM that can't be changed. 728 00:42:35,400 --> 00:42:42,380 And then future versions of the card were or are an 8051 microcontroller emulating the Gem Club memo stuff. 729 00:42:43,040 --> 00:42:45,740 Which is cool because now those cards could be reprogrammed. 730 00:42:46,120 --> 00:42:47,240 We didn't do that. 731 00:42:47,360 --> 00:42:49,140 But they're more general purpose. 732 00:42:49,140 --> 00:42:52,920 So they could be changed and not have to create an entirely new die. 733 00:42:53,260 --> 00:42:57,060 So general purpose one, of course, is nice because that means it has some firmware. 734 00:42:57,220 --> 00:42:58,600 And you could potentially dump the firmware. 735 00:42:58,720 --> 00:43:04,800 So in theory, even if they outlawed the rest of the smart card industry, their own system itself can probably be used against itself. 736 00:43:04,960 --> 00:43:05,600 And these are the die. 737 00:43:05,940 --> 00:43:07,540 So on the left is the ASIC. 738 00:43:07,540 --> 00:43:08,700 On the right is the general purpose one. 739 00:43:08,820 --> 00:43:09,100 Yeah. 740 00:43:11,260 --> 00:43:12,680 So I'm going to skip some of this. 741 00:43:12,740 --> 00:43:15,340 The card is based on the ISO 7816 standard. 742 00:43:15,400 --> 00:43:18,460 Which means a lot of the electrical interfaces are known. 743 00:43:19,460 --> 00:43:22,080 There's two different types of transmission protocols for 7816. 744 00:43:22,320 --> 00:43:22,980 One is asynchronous. 745 00:43:23,180 --> 00:43:23,660 One is synchronous. 746 00:43:24,040 --> 00:43:25,680 The card we're looking at is asynchronous. 747 00:43:25,920 --> 00:43:27,160 There's no external clock needed. 748 00:43:28,100 --> 00:43:30,720 So the data transfer is on one line. 749 00:43:31,340 --> 00:43:32,900 And we can capture that. 750 00:43:33,520 --> 00:43:34,240 And we did. 751 00:43:34,400 --> 00:43:36,600 And the way we did it is we used a smart card shim. 752 00:43:36,740 --> 00:43:43,940 So we had a circuit board that we purchased from one of the many kind of satellite TV smart card hacking sites that are out there. 753 00:43:44,540 --> 00:43:46,580 That we plugged the smart card in on one side. 754 00:43:46,580 --> 00:43:49,420 Have a bunch of test points that we could connect to our oscilloscope. 755 00:43:49,600 --> 00:43:55,540 And then there is a smart card pad on the other side of the shim that plugs into the meter. 756 00:43:55,640 --> 00:43:58,920 So now we can monitor the communications while the communications are actually happening. 757 00:43:59,100 --> 00:44:00,260 And there's a kind of funny story here. 758 00:44:00,460 --> 00:44:01,840 So you'll note that that's a shim. 759 00:44:01,880 --> 00:44:02,980 That's an SFMTA card. 760 00:44:03,760 --> 00:44:06,620 If you're ever going to break a law or do anything kind of weird. 761 00:44:06,720 --> 00:44:08,620 Or even something kind of sketchy in San Francisco. 762 00:44:08,700 --> 00:44:11,760 There's one excuse that you can always use that will get you away with everything. 763 00:44:12,100 --> 00:44:13,360 Which is this for your art project. 764 00:44:14,320 --> 00:44:14,600 Yeah. 765 00:44:14,640 --> 00:44:16,260 So this is our art project. 766 00:44:16,680 --> 00:44:18,460 We just wanted to show you our art project. 767 00:44:18,720 --> 00:44:20,220 You can walk up to a parking meter. 768 00:44:20,440 --> 00:44:22,520 I mean you can do anything in San Francisco pretty much anyway. 769 00:44:22,660 --> 00:44:26,020 But you can walk up to a parking meter with whatever tools you need and no one's going to care at all. 770 00:44:26,160 --> 00:44:29,200 So you know it's a parking meter also so you can park in front of your target. 771 00:44:29,600 --> 00:44:33,840 And run a wire like with your say AC inverter from your car to your oscilloscope. 772 00:44:33,960 --> 00:44:36,680 And then just go on up with your art project and you're just making art. 773 00:44:37,340 --> 00:44:40,480 And I can document the whole process with my camera because it's art. 774 00:44:40,680 --> 00:44:41,000 Right. 775 00:44:41,720 --> 00:44:43,060 Which I did not do. 776 00:44:43,120 --> 00:44:45,420 I don't have pictures for anybody who's considering rating us. 777 00:44:47,380 --> 00:44:48,440 Please don't rate us. 778 00:44:48,620 --> 00:44:49,700 We don't have anything interesting. 779 00:44:49,780 --> 00:44:50,700 We're telling you everything we've got. 780 00:44:51,640 --> 00:44:53,680 Except the actual details which we're going to tell the city. 781 00:44:54,160 --> 00:44:57,020 So this is a screenshot of the digital oscilloscope. 782 00:44:57,280 --> 00:44:59,280 The first thing we did is just see if we could monitor communications. 783 00:45:00,100 --> 00:45:04,020 And we know that smart cards always respond after reset with an ATR. 784 00:45:04,100 --> 00:45:05,020 A 4 byte ATR. 785 00:45:05,080 --> 00:45:06,340 So that's how we could figure out. 786 00:45:06,380 --> 00:45:10,560 We could just guess on the baud rate and on the various configuration settings. 787 00:45:10,660 --> 00:45:13,580 Until we got a clean serial data that was decoded by the oscilloscope. 788 00:45:15,420 --> 00:45:15,980 We got to roll. 789 00:45:16,240 --> 00:45:16,720 Yeah, I know. 790 00:45:16,720 --> 00:45:17,960 We got to get to the money shot. 791 00:45:18,240 --> 00:45:22,980 So once we could monitor the communications, 792 00:45:23,180 --> 00:45:25,400 what we did is we captured a bunch of different transactions. 793 00:45:25,580 --> 00:45:29,920 We had a lot of different cards with different values to capture a bunch of data. 794 00:45:30,520 --> 00:45:35,360 And then we brought all that data back to my house and sat there offline 795 00:45:35,360 --> 00:45:38,860 and just analyzed all the different data, figured out what changed based on different values, 796 00:45:38,980 --> 00:45:41,860 figured out the initialization and how everything worked. 797 00:45:41,960 --> 00:45:42,900 And it was all done by hand. 798 00:45:43,000 --> 00:45:43,740 No computer needed. 799 00:45:43,920 --> 00:45:44,640 So here's the deal. 800 00:45:44,640 --> 00:45:45,620 Watch this. 801 00:45:45,940 --> 00:45:46,880 Watch this set up. 802 00:45:47,180 --> 00:45:48,740 What's wrong with this right here? 803 00:45:48,880 --> 00:45:49,200 Right. 804 00:45:49,280 --> 00:45:53,280 You spot the protocol bug where it might be a bad thing. 805 00:45:55,180 --> 00:45:55,580 Password. 806 00:45:55,620 --> 00:45:55,820 Okay. 807 00:45:56,540 --> 00:45:56,940 Maybe. 808 00:45:57,220 --> 00:45:58,800 And then what? 809 00:45:58,880 --> 00:45:59,340 What's that? 810 00:45:59,480 --> 00:46:00,660 You read the balance. 811 00:46:00,740 --> 00:46:02,320 Yeah, well, here we'll go quick here. 812 00:46:02,400 --> 00:46:05,100 So there's some initialization stuff that always happens when you put the card in. 813 00:46:05,180 --> 00:46:07,140 It sends some stuff serial number, which could be useful. 814 00:46:07,260 --> 00:46:12,980 Some unknown value sent by the card to the meter that the meter then processes in some way and sends back and says, 815 00:46:13,660 --> 00:46:16,020 here's the password to you, smart card. 816 00:46:16,160 --> 00:46:18,100 And the smart card says, yes, that's my password. 817 00:46:18,320 --> 00:46:19,560 You can work with me now. 818 00:46:22,240 --> 00:46:23,720 Does that sound like a good idea? 819 00:46:25,480 --> 00:46:29,400 It kind of sounds like a good idea to me if I'm not the one building these things. 820 00:46:29,400 --> 00:46:31,800 We capture one set and we have it and we're fine. 821 00:46:32,540 --> 00:46:38,560 But the way that the meter figures out the balance is it reads this value that I call balance 2 from the smart card. 822 00:46:38,700 --> 00:46:41,160 And that's a fixed value based on the value of the card. 823 00:46:41,200 --> 00:46:42,960 So a $20 card is F0. 824 00:46:42,980 --> 00:46:45,120 And F127 for a $50 card. 825 00:46:46,540 --> 00:46:51,880 When you deduct a single unit, what happens is there's just this transaction that happens. 826 00:46:52,100 --> 00:46:55,620 It doesn't affect the actual balance 2, which stays the same. 827 00:46:55,820 --> 00:47:00,760 It just does sort of a null transaction, which increments this thing called a transaction counter. 828 00:47:00,960 --> 00:47:05,840 And the transaction counter is the only thing that changes on the smart card during the entire process. 829 00:47:06,120 --> 00:47:09,260 And that's what's used to count how many units have been deducted. 830 00:47:09,320 --> 00:47:10,520 It's how many units have been used. 831 00:47:11,260 --> 00:47:16,480 So that value of the maximum balance 2 minus 95 decimal is the maximum card value. 832 00:47:16,620 --> 00:47:20,740 And then you would subtract the transaction counter to figure out how much money you have left. 833 00:47:21,000 --> 00:47:21,440 Survey. 834 00:47:21,640 --> 00:47:23,440 Who thinks this is a good idea? 835 00:47:24,940 --> 00:47:28,280 Not just the OK part, but the stored value where it's... 836 00:47:28,280 --> 00:47:31,140 What would happen if you were to change those values, though? 837 00:47:31,500 --> 00:47:35,560 Yeah. Let's try to change the balance 2 to say it has more money than it does. 838 00:47:37,200 --> 00:47:39,620 So once we capture all the data, the first thing we did was, 839 00:47:39,620 --> 00:47:41,220 OK, let's just do a standard replay attack. 840 00:47:41,840 --> 00:47:44,840 We'll use a legitimate card that we bought. Let's use that. 841 00:47:45,020 --> 00:47:47,840 So we did that. I built up some circuitry with a microchip pick. 842 00:47:48,000 --> 00:47:50,160 And we'll show you some pictures of the progress in a few slides. 843 00:47:50,320 --> 00:47:52,280 But I used a microchip pick, wrote the stuff in C. 844 00:47:53,200 --> 00:47:55,820 And there's a little bit of code on there, but you go to the website and get the rest of it. 845 00:47:56,440 --> 00:47:59,860 So once we knew the replay attack worked, we said, OK, let's change the values. 846 00:47:59,960 --> 00:48:01,900 Let's change the balance. Let's see what happens. 847 00:48:01,980 --> 00:48:03,880 Could it really have 4,000 units? 848 00:48:04,980 --> 00:48:07,820 Sure. Why not? Not that they sell a 4,000-unit card. 849 00:48:07,900 --> 00:48:08,500 Yeah, but let's try. 850 00:48:08,680 --> 00:48:09,060 Yeah, sure. 851 00:48:09,620 --> 00:48:13,000 We also modified the code so the transaction counter would never increment. 852 00:48:13,240 --> 00:48:15,900 So your value would always stay at the maximum. 853 00:48:16,120 --> 00:48:20,580 So this is automatically refilling itself every time you take it out of the meter. 854 00:48:20,680 --> 00:48:21,240 Right, because it resets. 855 00:48:21,420 --> 00:48:22,460 Because it resets itself, right. 856 00:48:22,500 --> 00:48:26,720 And then, unbeknownst to me, until when I was close to being done, 857 00:48:26,840 --> 00:48:32,060 is that satellite TV hackers who have existed for a long time, decades, 858 00:48:32,600 --> 00:48:36,280 or at least over 10 years, like using microchip pick devices. 859 00:48:36,380 --> 00:48:38,480 So it just happened that the microchip pick device I used 860 00:48:38,480 --> 00:48:41,020 existed in a smart card form already. 861 00:48:41,200 --> 00:48:45,880 So I could get blank smart cards, program them with my code, and it would work. 862 00:48:46,100 --> 00:48:48,740 So the first one, you see the shim, you see the evolution. 863 00:48:49,020 --> 00:48:53,440 OK, first one, on the sketch, if you think about like a threshold, a sketch hold, right? 864 00:48:54,200 --> 00:49:00,560 You've got a sketch hold of really sketch where you have Joe's actual last name logo for the board. 865 00:49:00,700 --> 00:49:03,600 And then you go all the way to the right where you just have a normal smart card. 866 00:49:03,660 --> 00:49:04,440 It looks like everything else. 867 00:49:04,700 --> 00:49:06,140 Yeah, so here's what happens. 868 00:49:06,320 --> 00:49:06,800 Here's the results. 869 00:49:09,380 --> 00:49:11,040 And for those that can't see, 870 00:49:15,600 --> 00:49:22,060 for those that can't see, the meter has just read the value of the smart card and thinks it has $999.99. 871 00:49:22,620 --> 00:49:27,820 We removed the card before it started deducting value, the city of San Francisco. 872 00:49:28,600 --> 00:49:29,000 Yes. 873 00:49:29,540 --> 00:49:32,600 If you're interested in projects like this and you live in San Francisco, 874 00:49:32,740 --> 00:49:35,420 you should come down to the Hack Lab, Noisebridge, noisebridge.net, 875 00:49:35,560 --> 00:49:36,920 and we work on some stuff like this. 876 00:49:36,920 --> 00:49:40,960 And we do need to mention that we intentionally did not contact the city before this research. 877 00:49:41,200 --> 00:49:45,680 First of all, because we didn't want to encounter the same problem that the MBTA guys did last year. 878 00:49:45,780 --> 00:49:49,520 But also because we intentionally didn't release the information that could cause them harm. 879 00:49:49,680 --> 00:49:52,920 But we're reaching out to them now and we're trying to give them all the information. 880 00:49:53,260 --> 00:49:55,460 So here's some fixes that you could have. 881 00:49:57,440 --> 00:49:58,800 Really, good luck with that. 882 00:49:59,180 --> 00:50:01,800 It's very hard on stand-alone systems. 883 00:50:01,860 --> 00:50:04,280 It's very hard to do any proper cryptographic communications. 884 00:50:04,440 --> 00:50:05,800 But you can look through these. 885 00:50:06,920 --> 00:50:10,260 The slides are on the DEF CON CD, so you can browse through them. 886 00:50:10,340 --> 00:50:11,960 But it's a very hard problem to solve. 887 00:50:12,180 --> 00:50:15,360 Yeah, I mean, just to be real quick, because we have basically one minute. 888 00:50:16,420 --> 00:50:21,320 These meter companies have basically created an e-cash system, but they didn't do it right. 889 00:50:21,520 --> 00:50:26,060 They didn't take into account the privacy implications and they didn't take into account the fraud issues. 890 00:50:26,440 --> 00:50:32,180 Dr. David Chom actually solved basically all of these problems over a decade ago working on anonymous e-cash. 891 00:50:32,320 --> 00:50:36,760 So really, they should be thinking about Chom's work and they should be re-implementing. 892 00:50:38,520 --> 00:50:39,440 So that's it. 893 00:50:39,480 --> 00:50:40,300 These are our final thoughts. 894 00:50:40,380 --> 00:50:43,440 You can really ride a bicycle, I guess, to avoid this. 895 00:50:44,220 --> 00:50:49,600 Also, before you go, we'd really like to emphasize that people should join the EFF. 896 00:50:49,900 --> 00:50:54,380 Jennifer Granik really helped us out and gave us advice that made us feel safe about giving this talk. 897 00:50:55,100 --> 00:50:57,320 And if you're not a member, you should join. 898 00:50:57,460 --> 00:51:00,600 Yes, and we're going to be dragged off to some extra room if you have questions. 899 00:51:00,800 --> 00:51:01,680 Thanks, guys.