I am Joe Grand. I'm Jay Kappelbaum. And we are talking about smart parking meters. Just to give you a little bit of background, I'm an electrical engineer, hardware hacker. I live and breathe electronics. I love this stuff. And the reason I got into looking at parking meters is there's a lot of them in San Francisco where I live. And I use them all the time. And I said, hey, these things are electronic. They look fun. Let's, you know, maybe do something security related. I don't know. I guess that's about it for me. I designed the DEF CON badge this year. I'm interested in photography and BDSM. Chris isn't here today. He was here with us at Black Hat. But for various reasons, he's gone. But he's an amazing hardware hacker. He's one of the best, right? You want to decap a chip or dump something from it. You talk to him. Yeah. Chris talked last year about silicon dye analysis. And he's like one of the best smart card hackers in the world for sure. So we'll make up stuff on his slides. We'll hand wave. Yeah. So why parking meters? I mentioned why I was into it. But why in general? Parking meters are these, you know, they're just everywhere. They're in every city. They're in every city in the world. These things on stage. They're in every city in the world. Every few feet away. And we just totally take them for granted. We go. We park our car. Put some money in. Walk away. We don't think about it at all. But it's one system that we thought needed a little kick in the ass. Because a lot of these meters now are electronic. They're essentially individual computer systems that can now be analyzed. Think globally. Hack locally. Yes. Clearly I'm the son of a hippy. And there's also big money. So anywhere there's money there's going to be fraud. There's going to be people, you know, taking advantage of the system. So the parking industry is a $28 billion industry annually. I think just in the U.S. alone. And there's a bunch of stuff that can go on. So not only like the financial fraud of getting free parking. But there's social issues and legal issues. And we're going to get into all of that. So generally the thing we wanted to do was understand the current state of the unfair collection systems. Or fair collection systems. And we wanted to be able to demonstrate some attacks. We wanted to be able to come here and show that something had been done. It's not just enough to say how some things work. 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. Anyway. We also wanted to show the whole process from start to finish. Because, you know, for me this is my first real hardware hacking project where like we took some like foreign things and we basically like understood them. As best as we could. And then using that we were able to go all the way to a full break. And so this should hopefully take you from start to finish if you've never done it before. Which I think it's important to sort of, you know, bring people to the next level. And Joe really thinks that. So he brought us together to work on this. So it's pretty epic to be able to work with him and Chris. And of course we took on the SFMTA. But of course it's also important to say that this is not really specific to San Francisco. Other than our particular case study. The meters that we examined all had pretty much the same problems. And we just happened to live in San Francisco. So it was just kind of a no-brainer to kill that one. Yeah. So going through the process is the most important part that you should take out of this. You know, because you can apply this to other parking meter systems in your area. Or you can apply it to other products. Anything you're looking at sort of goes through this general process of analysis and gathering information and stuff like that. So you'll see it. And then we'll hit the case study towards the end. We're going to talk about more general parking meter stuff. And general process stuff. And then go into specifics of San Francisco. So there's some different things that are kind of interesting about the parking meters in San Francisco. And of course generally everywhere. You've got these single space meters that are everywhere lining the streets. In some cities like Oakland, they've cut them down and put in multi-space meters, which have really confused a lot of people. But the idea with the single space is you put in some change or you use a smart card or some like cell phone token. And the multi-space, you usually get like a printed paper token. In some cities you tape it to your window. In other ones you put it on your dash. And the meters generally are sold with this idea that they'll stop people from lifting money, like the meter maids from lifting money. And so they have audit logs. So they should know about how much the meters are used and also about how much money should be in the meters. And maybe they also have role separation. So the audit logs are pulled by someone other than the person that collects the money. And then of course they have different ways to like repair the meter. So the person that repairs the meter might not pull the audit logs. They also might not pull the change. And this is, I think this is generally a pretty important thing to do in a security system. 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. 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. I can, in, I think it was San Francisco actually, someone was arrested with 7,000 coins. Yeah. In 2000, 2007 or 1997 or something. It was a news article we found online. Oh, yeah. Actually, no, that was a different thing. I think they landed on the moon, right? Yeah, yeah. I'm not sure. I think so. Anyway, so the idea though that the insider is the threat means that they probably designed this wrong because we're not insiders either. But, I mean, it seems like there's some pretty bad design flaws. So the way parking meter technology sort of started was obviously mechanical. In the early 90s, these hybrid meters started coming up. So it was mechanical based where you put your money in and you turn the knob in some way to feed the money through. But then there was an electronic system, very minimal, to keep track of the timing. Possibly for sending out some startup messages or some administrative messages. But now, as I mentioned, everything is just a pure electronic system. You know, going from the coin detection, which is some inductive method using music. Coils and some electronics and processing to figure out the coin type. To a microprocessor with memory. And now we treat these systems as actual embedded systems. And we would go about analyzing them and breaking them the same way we would any other type of hardware product. So, you know, we've gone from mechanical to essentially solid state. So here you can see some reconnaissance. Just kind of like accidental reconnaissance. Yeah, I just happened to walk up right to her. Yeah. So basically it looks like this person has like a small electronic device. Stuck into the key slot. And if you look at the crash cart that you have there. That's kind of crazy. Your meter system has a crash cart. But it looks like she has a small handheld device. Which if you read some of the documentation for this particular meter. 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. Or in the key lock. But it doesn't look like the lock is open. So it's as if they made the actual lock into a serial port. Which seems like kind of crazy. Right. So we think that this person. This was in San Francisco. And we think that this person was going around and grabbing audit logs. Or updating the meter in some way. So she wasn't there to pull the money out. So even though the coin. The serial interface for this PDA was through the coin lock. She couldn't get access to it. So that's the exact point of the role separation. Most parking meters have some sort of user interface. You can pay it. Whether it's coin, smart card, credit card. Some now accept text messages in some form. And then there's administrator interfaces. Some of them are the same. So the coin slot. The smart card interface. Could be used for depending on the system. For administrator access through some piece of hardware. Usually it's some serial interface. The coin slot. Because it has inductive. It has coils. So you could do some really short range wireless. Then you have infrared capabilities. And other wireless capabilities. And then other stuff that might be completely meter specific. Like the serial via the coin lock. So a lot of interfaces out there. And the more interfaces that are out there per meter. We can target each of those. It's like every single interface is an attack vector. The attack service for some of these meters is just ridiculous. I don't know how the designers of these systems. Thought they could get away with putting something like this. In front of every single person all the time. Especially something that often makes people mad. So. Yeah. It seems like a lot of the design work that had gone on for security. Is just for vandalism. And they never. The designers didn't think about this next generation of attacks. Basically if you read some of the documentation. They say stuff like the smart card slot is modular. So that it can serve as the sacrificial part. So they're like AUG is going to attack our meter. AUG has tin foil. AUG has shorted out smart card reader. Well we can totally protect against AUG. No problem. Fuck. All right. So we took a few pictures of some parking meters. Just from various cities. This one has a smart card interface from Austin. This is a Chicago multi-space meter. Which we'll mention in a few slides. When we talk about some previous work and problems. For those of you that know me. You know that I love Canada. And this meter is great. It's also by the same company that designed the San Francisco meters. JJ McKay. And this one's interesting. I didn't actually use it. I didn't have a car when I was in Vancouver. And apparently you call this number. Or you text message this number. And you basically don't actually change the value on the meter. But the meter may have like a log that shows which ones have paid by that way. 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. So you have a completely separate system that overrides the mechanical meter. So you could in theory give everyone free parking or something like that. By doing that. Like attacking this other system. So it's like who designed those systems? Did they know they would work together? That's a really interesting idea. And if they haven't done some due diligence with that. It could be very, very bad. That one also seems sort of labor intensive. Because if normally a meter maid will drive by the meters. And they'll look at the back size to see if time's expired. 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. Yeah. It's pretty rough. Here's a parking meter from Jerusalem. That was near the old city. And it's just. There's a few different major brands of parking meter manufacturers. And we'll talk about those. But this was. I believe this was POM. 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. But there's been people messing with these things. As long as they've been around. New York City in 2001. When some of the early electronics. And electronic parking meters came out. They had infrared capability for their administrator. Interface. And somebody figured out that they could take a universal remote control. And hit some. One of the buttons. To reset the value of money on the meter. Which is one of the exact social attacks that we had. That we had kind of come up with. Is Hikari here in the audience? Are you here? David? No. Okay. But he wrote a pretty awesome paper. In the Uninformed Journal. Which if you don't read. Does anybody here read Uninformed? Raise your hand. Wow. Okay. You should all read Uninformed. It's the most hardcore technical journal. Basically since Frack. So if you're not reading it. You're probably uninformed. So you should read Uninformed. And be informed. 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. Yeah. It's an interesting. It's a different. Completely different smart card implementation. But it's almost a different type of smart card. So it's worth seeing. So you can kind of get a view of how various smart cards are used. And then Chicago recently deployed a bunch of multi-space parking meters all over the city in June. How many people here are from Chicago? Have you seen these parking meters? Yes. Do you love them? Yeah. Nobody in Chicago seems to like parking. Think globally, not locally. Right. So I mean Chicago has been notorious for disliking the parking situation there. Meters are always being vandalized. They're always being damaged. And I don't know. 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. I just deleted their email. But I called them back and had to give them my view which was, sorry, it's not hackers. It's probably a firmware problem. Because the multi-space meters that failed, and I don't exactly know how they failed. I think they just didn't work. Were 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. And I don't think they tested that rate. So there might have been some firmware problem or some overflow or something. So it was in the news. It was all over the place. And then it quietly disappeared. So I don't know if anybody from Chicago knows the real result of that. No. Are you suggesting that greed might have caused a firmware bug? Possibly. Whoops. Yeah. They're like, let's jack up the rate as much as we can. That's pretty bad if you hit like an overflow condition from raising your prices. Right. And Chicago, too, also has some sort of wireless communication back up to the cell phone network. And then back to some mothership. So they were connected. And that opens up a whole new range of attacks. Who here thinks that just because you're using a cell phone, the file layer is secure? I mean, how many people have you seen that? I've seen around here just using cell modems. It seems like if there's some sort of cell modem back into these things, you should all start hacking on CDMA and GSM stuff. I mean, it's not hard, right? I'm sure someone is. Right. Well, definitely. Use a new radio. So this is just the general process of how we approach the problem and how we approach sort of any hardware problem. Kind of think about some attacks. We postulate some various attacks about what we could do. You know, from the most lofty goals to kind of the most maybe obvious or low-hanging fruit. Then we gather information. We will analyze hardware. We analyze firmware if necessary. And then we look at any external interfaces. In our case, there's a smart card interface. So we looked at that. 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. Like imagine you know someone's serial number for their smart card. Or you know how they pay via cell phone. You could potentially set up the LCD so that it sends, you know, a message like, oh, hello, Joe. The crow flies at midnight. Modifying the firmware. Right. And I think it was Jeff Moss. 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? I mean, if they're a mesh, then, you know, mesh it. Yeah. And then denial of service are sort of these destructive attacks. But depending on the attacker's goals might still be valid. So setting a meter to out of order, just preventing people from parking there. Because a lot of cities, if the meter is out of order, you're not allowed to park there. Or you're only allowed to park there for an hour. And then you'll get a ticket. And that could also be useful if you're like, well, you know, I got to leave. I'll set the meter to out of order and then I'll come back. Right. Yeah. 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. Some of the meters are designed to be electrically isolated. But, you know, I think that if you have a taser or a stun gun, you could find out how well they did that. 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. But they forget about maybe like the external serial bus or something. Yeah. And then, you know, possibly even, you know, if you know how the system operates causing a legitimate user to be added to some fraud list, if there is a fraud list implemented in the city, say, based on serial number. 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. So it's also possible that you could do some sort of immediate detection. You could do a reduction of credit. So if someone walks up and they put in three hours and then they leave. We mentioned this at Black Hat when we were talking about this. And some guy from Montreal is like, oh, yes, we love to do that in Montreal. We hate those fucking parking meters. And so apparently the deal is that you park the car, you put in the change, and you are not allowed to refill it. So if you put in more change, the incentive system, yes, it was that fine gentleman there, it resets to zero. So apparently there's like a social fad about going and doing that. And you're dropping in coins across the whole block in order to raise doubts about the meter system. And basically anyone can contest a ticket because it's so easy to break that system. So in a way, I mean, that's great. They showed that the machine was not, you know, perfect, which is important. And this is exactly what people in New York were doing with the infrared remote controls as well. So it's, you know, one of the favorite things would be, hey, you know, there's some guy that you don't like, he just parked his car, go remove all his credit. Call a tow truck, call the parking officials, give them a ticket. There's also, of course, the possibility that you could change the audit log, right? So it doesn't look like any of the meters are actually using any sort of computational infeasibility, right? So it's not like there's a cryptographic problem you have to solve. It's generally just do you know something, like do you know how it works? So that sounds a lot like security through obscurity to me, which means that it's what? Is that secure? Probably not. And, of course, if you wanted to, well, you're better at this part of the slide than I am. I don't know about that. So changing the time and date could always be fun, right? If you, you know, everybody gets free parking on Sunday, so what could you do? You know, change the date, and it's like every day is Sunday, Sunday, Sunday. Free parking in the city. They're already here. We don't have to get their money. I don't understand why you're saying that. For those of you that ever watched The Simpsons while growing up, thanks for the two that got the reference. Is that the monorail episode? I don't even know. I think it's the one where What's-His-Face goes and works at the racetrack and they're bilking everybody. Anyway, so the least lofty goal just so happens to be the one that probably everybody wants, which is unlimited payment via smart card. And that one is kind of incredible because you think, you know, you look at a smart card, you're like, oh, that's got to be secure. You know, it's smart. It's a smart car, right? So that's got to be secure. I mean, even as smart in the name. And it's really tiny. Yeah. But, you know, smart. It has to be high tech. So that's actually what we're looking at for the case study in San Francisco is the unlimited payment via smart card. Not so smart card. Yeah. So here's the process just on information gathering. Of course, you do stuff like Google and browse the Internet. But... Yeah. You know, there's... I'll talk about it a little bit in the San Francisco case study. But, I mean, social engineering can get you really far. I mean, just, you know, if you ask, technically incorrect, but really specific questions that are maybe really eager to someone who cares about their job, they'll tell you the most amazing information about their system. And generally speaking, if they only tell you a little piece and someone else tells you another piece, you now have enough to put, you know, something together that is really useful. And combining that with, say, press releases where everyone's always tooting their own horn about all of the details of their system 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. Like, for example, it's secure? Probably not. Yeah. And, yeah, part of the hard-racking process or any sort of analysis process is just gathering clues. So you do your social engineering and you might get one bit of information. You find something on Google. You find something in the trash. All these things, you might not know how they all fit together until you start your work and then you're like, oh, I can use that piece. So another thing is we said, you know, globalism. What does globalism have to do with, you know, parking meters in a city? Well, I mean, if you roll your own stuff, you can control your own stuff. You can make sure no one ever sells it on eBay. 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 and then that city buys a new implementation because they didn't like it, they're going to possibly sell that meter infrastructure online. And now you can buy that and legitimately own something that's very similar to the meter that's in your city. And then you can attack that. And you don't need to take a meter or do something illegal. You can do it totally legally, which is exactly what we did for our case study. Thank you, eBay. Yeah. It is a magical place. And when we started looking at hardware, you know, in general, we just wanted to get an idea about parking meters because it's not often that you can, you know, walk up to one on the street and take it away. So we wanted to buy some. And, you know, we did some searches on parking meters on eBay over a span of like two months. And we bought every type that we could. And there were three that was available. The Dunkin' EMM 7700 is the oldest one. The Palm APM. And then the McKay Guardian, which is the early revision of the McKay Guardian XLE, which is used in San Francisco. So we were hoping that we could get some clues about the system. And being a designer, I know this for a fact that revisions of products typically are based on previous revisions of the design. So we can learn a lot about current systems by looking at older systems and getting an idea about how, you know, even from a system level, how the design is. And maybe even from an electrical level about, you know, what microprocessor is being used. What memory do they like using? What's the interfaces? You know, what things can we look at? So it gives us clues. And there's also actually details and similarities between competing products, which is sort of interesting. Like most of these are low power, for example. And some of the things are kind of elegant. And then you think like for some of the problems that they want to solve, they might do something kind of, I don't know, like it's almost like a Rube Goldberg machine in some of these meters. Yeah. This Duncan meter is kind of cool in that it actually is sort of like a hybrid mechanical electronic meter where they have like you can see on this slide here. There's some little screws in there. Those are actually buttons. And you put a coin in and then it weighs just a precise area out of the turning implement. And it turns like so. And when it turns, it scrapes across the heads of the screws and pushes an electronic button underneath. 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. It might hit one of the buttons, like button number one, button number three, and then button number four. But if it's a dime, it might hit button number two, button number three, and button number four. So there's a sequence to program the time corresponding to that value onto the screen. There's also some. So this is the circuitry. This is the oldest one, as I mentioned, from 1991. There's a bunch of the buttons that are used for the coin stuff. But there's also some administrator reset buttons, which are cool. There's infrared. So people have been using infrared for a really long time. And 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. Anybody see the microprocessor on this board? Anyone know where it is? It has to be there somewhere. Right. There's something. Anyone? Take a shot at it? Win my shirt. Win my shirt. Wow. That's pretty generous. Do you have another one to wear afterwards? No, I don't. So the microprocessor is actually hidden under the LCD, which might not be an intentional thing. 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. 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. The Palm APM, this is a meter from Israel. It takes shekels. But it's made by Palm in the U.S. So there is this cross-pollination of various countries sharing their devices, which could be ripe for international espionage, I guess. Yeah, I don't know. 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 the system. They maybe never need to set foot in that country, and they could sell cards or something and mail them abroad and make money from it. Like, oh, broke the system. So an insider, understanding how this works, if it isn't something that's actually secured by some infeasibility problem, it's just like a disaster waiting to happen, I think. Yeah, and some of you guys might be thinking, oh, well, there's no way someone's ever going to get access to a parking meter. There's big locks on the meters. That's just physical protection. And if you're at DEF CON, you might realize that. Physical protection and locks don't really stop everybody. Maybe Barry's here, and he could tell us how good locks are, mechanical locks, right? I mean, there's no real mechanical lock that is unbreakable, right? So, I mean, you might need to be buried to break some of them. 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. Right. Key diversity is something that could be really useful to you here. Probably both in the actual physical keying of the meter. Yeah. And also in the engineering infrastructure, but also in software. Yeah. So there's a few more. I'm just going to breeze through these. There's some debug ports that I thought were interesting on the POM. The POM is also modular, so you can replace the various parts if they break. Easy access to the ROM. Here's another view. Easy access to the microprocessor as well. There's a reset button. McKay Guardian. So this is one that was decommissioned from Tallahassee, Florida, that we bought on eBay. Oh, I should mention, too, the prices. Price range was from 99 cents for a meter on eBay to $500. So, you know, well within a budget of most curious people. Here's the McKay. Again, easy access to the microprocessor, easy access to the ROM. The microprocessor in this case is a CLT840231G, which is a custom ASIC with a Z80 core. So if you were to pull off the ROM, which is an Atmel WEPROM, you could decompile that or disassemble it and it's Z80. Toss it into IDA Pro and start looking around. Yeah. Another interesting thing about the Guardian is there's this cool RJ45 connector on the lower right. And reading through some of the data sheets available on their website, it had made mention of some test connector, some interface. So we're like, oh, okay. Maybe, you know, it says something about having a serial port and having some I2C, which is an interchip communication port. So we said, oh, maybe we should look at that. You know, we have the meter. It's open. It works. We might as well look at it. So we hooked it up to my little lab setup with my digital oscilloscope and some level shifter circuitry. And we're probing all the different pins trying to figure out what's what. Because if there's an interchip communication, maybe that's something useful to drive the display. But more importantly, I wanted to see the serial interface. If that was the debug port for sucking audit lines. If that was the log information. And they had infrared on this particular version. And what we figured out is that on reset, on power up, the infrared port would spew out a bunch of stuff that also correlated to some data we were seeing over the wire. So sort of infrared and serial information being set out. And we tried to probe that for a while. And we're just kind of playing around. We didn't exactly figure out how it worked. But given time, we definitely would have. Yeah. It was only mildly interesting. 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, then that does not bode well for San Francisco's purchasing decision. Right. And then firmware analysis, which we did not do in our case. But just in general, if you do end up getting access to memory devices or to microprocessors, the first thing you would do is suck all of the data out of them. Suck all the program code out of them. And then reverse engineer them. Decompile them. Do whatever you need to do. Right. So, I mean, if you know the company that's building the system and you understand what compiler they're using, for example, and you toss that into IDA Pro, you can help, like, guide IDA Pro, for example. That would be pretty useful if you want to use and grep, I guess. You could also do it that way. So it would be really useful. Because maybe there's, like, some particular portion of a problem you want to solve, but you can't figure out the generalized algorithm or you can't figure out, like, exactly what they're doing. Maybe they have some sort of, like, shift feedback register thing going on. It would be useful to see the structure of the firmware so that you could better understand what's actually happening without just, you know, doing an intercept. Yeah. And you can also target specific areas if you don't want to reverse engineer the whole thing because you just want to get clues or maybe figure out an access point to get to, like, an administrator menu. But what I like to do, since I'm not the greatest reverse engineer for binaries and for firmware and stuff for source code, I usually run stuff through strings first to see if there's anything wrong. If there's any, you know, information, any cool constants and texts that are there. And usually there are. Because engineers like to leave stuff in that's going to help them, debug messages, stuff like that. And usually those are left in production products. And then smart card analysis. Again, I mentioned in this case if you have an external interface that is a smart card, you would do this. If you have an external interface for other things, you would analyze those. This is the process that we went through. Monitoring communications. You might want to try to decode the protocols, emulate the protocols. So one thing that's really good about this is that it's really easy. One of the things about this is that looking at press releases can be really helpful for this. Especially when they're from the company. They'll say something like, it's secure and we use this standard. So then you go and read that standard and you think to yourself, this isn't secure at all. And that's really useful. Especially when you start to do the decoding and you want to do the emulation. Because you can implement part of the standard. And then when you've done that, you, of course, know that that is not true, that it is secure. My coffee is almost working. Almost. A few more minutes. All right. So now we're going to jump into the case study of the San Francisco MTA. And the city of San Francisco for a long time has sort of been grasping at straws of what parking infrastructure should we use. You know, should we use electronic meters, single space meters, should we use multi-space meters. That's made by a company called Rhino. The smart card that you see in the single space meter also works in the Rhino. So there is some modularity there. This system was essentially a pilot program in 2003. And it cost $35 million, which we'll get to. But we should make a disclaimer first about this. Yeah. Well, yeah, go ahead. So first of all, contrary to Wired totally fucking us with the title of their story saying free parking for all, which we expressly told them not to say because we didn't want to end up like the MBTA kids. We are not trying to get people to defraud the San Francisco parking meters. The point here is more to undermine its authority. I think that's much more important. And we should all do our job to undermine authority wherever we can, especially when it isn't, you know, necessarily duly received. I mean, San Francisco essentially wants to create revenue here. I think it's good to put doubt in the perfection of the machine. I think that when people get parking tickets, you should be able to contest them. I think that there isn't a God, I can't do it, but I'm going to quote Jean-Luc Picard. Oh, this is going to be good. There can be no justice when rules are absolute. Okay. It's true. Machines are not perfect. And there was a 19th century anarchist who said something along the lines of it is not that I fear that machines will begin to think like men. No, no. It is that I fear that men will begin to think like machines. And we have to fight against that, I think. So hopefully this is like, you know, chipping away at that. The one anarchist in the audience represent. And we are both San Francisco residents and we pay a lot of tax to the city. Yeah, seriously. And it's just that it's okay for a city to try to figure out what parking system they want. And that's fine. Here's two other parking meters that are available in the city. This one is a credit card based machine that says the smart cards don't work on them. It's just our tax dollars are at work and a lot of money is being spent on systems that aren't being analyzed. Or if they're being analyzed, the problems are just being ignored. Some tech somewhere in San Francisco, or actually, is there anyone from the city of San Francisco here? Not where you work for the city of San Francisco. I'm sure that there are people here. Do you work for the city? Do you work for the DPT? No. Anybody from the DPT here? You are. I used to be out of Berkeley's IT department and saw their DPT stuff. Yeah, so somebody here from the Bay Area. Cool. Yeah, so as Jake mentioned, this, the meter that we're looking at, the McKay Guardian XLE, there's 23,000 of them in the city that replaced mechanical meters in 2002 as a pilot program. A 35 million dollar pilot program. And to me, a pilot is like a test, right? It's like an evaluation. It's 2009 and they're still evaluating a system. And 35 million dollars to do an attack like we did, which is very, very easy as you'll see, it shouldn't be possible. And it blows my mind how much money they spent on this. So I'm a little conflicted about, I mean, so in general, I think that this kind of disclosure is good so we can influence social policy. We hope that we can get some of these things to change. San Francisco wants to install 320,000 of these meters in all of the residential areas of all of the city. They think that it will improve, for example, the environment because people won't have to double park. Which sounds like newspeak to me. But I think before they go and spend 320,000. Worth of parking meters, worth of money, I think that maybe we should like question that that's a good idea in the first place. If they want revenue, they should be up front about it. They should say this is the true cost of having a car in the city instead of actually inconveniencing everyone. Because what will happen is they'll become reliant on the smart card infrastructure, which is thoroughly broken. And, I mean, what are you going to do when you're at home? You're going to go get a roll of quarters? I mean, that doesn't scale for an entire city, right? So. There are definitely some social problems. San Francisco uses the McKay Guardian XLE meter. 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. Yeah, there's plenty of information out there about meters because manufacturers want designers and implementers to use their stuff. So they make a lot of information available. So the way the system works is the smart card interface, the city uses a stored value smart card. They come in $20 and $50 quantities. You buy them in cash at certain places around the city. Or you use a credit card online. Right. Once you deduct credit, you put the card into the meter. The meter displays the value remaining on the card. And then after a few seconds, it starts deducting units. Like you're putting quarters into the meter. Once the value is depleted on the card, it's not reloadable. It's a one-time thing. You throw it away. And the research, as you'll see starting right now, is it's easy to replay the smart card transaction. So even without knowing anything about how it works, you can replay the entire smart card transaction to the parking meter and emulate a card. But then you can also modify certain data to do cooler things. And we did this solely by looking at captures of an oscilloscope screen, a digital oscilloscope screen, and then analyzing data on a piece of paper over the course of three days. Basically, a scope, pencil, and paper are all you needed to break the San Francisco smart card implementation. Yeah. And it was interesting because I'd never worked with smart cards before. I kind of dabbled with them but not really looked at them in detail. So it was a fun exercise to do that. And sort of we came out of it saying, wow, that was kind of easy. And it shouldn't be that easy. I worked a little bit with Moxie. You probably saw his SSL talk on some smart card stuff. And so I had some. I was a little familiar with smart cards. But just in general, like I hadn't gone in this deep. 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. And inside of it was like a circuit board. I didn't describe this as a black hat. But basically, it's a small embedded computer. It has like an SD card in it, which looks like it has several hundred megabytes of space. And I just asked him questions like, wow, you know, I've always wanted to work with computers. What's that like? And the guy was like, well, you know, it's a great job. You know, the city is really great. And, you know, they treat you well. We talked for a while. I asked him questions like, so can I like pay with my cell phone? I just got one of those wireless telephones so that I can talk to my girlfriend. And he's like, no, no, can't pay. Can't pay that way. You know, these are all disconnected. So like just in the course of like a five-minute conversation where I'm holding my backpack over my 2600 shirt, you know, the guy like explained to me everything I needed to know. It's an offline stored payment system. And it's not hooked up to the Internet. They don't do any verification. They probably don't do any fraud detection. If they do, they probably do it badly in a way where you can frame someone. They don't have any actual cryptographic solutions that you'd need to solve. They'd probably replay it, et cetera. And the guy didn't realize he was telling me that. But he was also giving me a job offer at the same time, which was hilarious because they're trying to protect against insider attacks. So I'm just going to jump back for one second. We mentioned this already. You know, the goals of this work weren't to slam San Francisco and get free parking. We really want to share the process with everybody. We have released code. But the code is essentially a template for how our smart card emulator worked. I removed all of the bytes of data that you could use to get free parking in San Francisco. So anybody who's in the media who's writing about this. The code is essentially useless. Unless you're curious about how smart card emulators work. I changed all the bytes to FF. It's purely for educational purposes and that's why we're here. Right. So some other things with information gathering. The Internet was sort of useful. Sometimes a useful tool. Yeah. I really recommend the airplane method of reconnaissance. Which is that you set WGET to run and then you get on an airplane. And then you just come back and read it later. That's all that matters. If you do that, you'll be good. You'll be totally good. Surprisingly. So yeah. The one kind of fun thing here is, you know, you would obviously search for product specs and press releases. But you might also want to think about discussion forums. Maybe the company is having technical troubles with a certain portion of their design. Do you think they have technical troubles, Joe? I'm just not sure. I think they do. Or at least they did. And this was a post that we found on a SIGWIN mailing list. About some technical problems that one of the software designers were having with his implementation of CVS. You should definitely read that. It's a little small maybe. Okay. Yeah. It's a little small. So it says, it's 2001. It says, I'm learning how to use CVS. And as part of this process, I set up a test repository. I almost said suppository. To play with. A test repository to play with. It's great. It's 2001 and he's learning CVS. Ouch. So but there's some interesting clues here. If you maybe can't really see the paths, but there's some stuff in there. JJ McKay. So it's obviously a McKay designer. Met Talk is an interface that's used and described in some of McKay's documentation about some communications interface. There's the Gemplus lib path. So now we know they're using some Gemplus-based smart card. And we realize they're using GDB and GCC. So that gives us clues maybe if we need to reverse engineer firmware or try to disable it. Or try to disassemble stuff. So here's Chris Tarnofsky's few slides. Hi, my name is Chris Tarnofsky. I reverse engineer silicon dies. What we did is. I'm the other Chris. Yeah. So no. What we did. We have to go really fast now. Yeah. We have to go really, really fast. I bought 20 or 10 stored value $20 smart cards. And went to send them to Chris to do some dialysis on. And when I went into the store. I go to the same place all the time when I go and buy my parking cards. So when I had to buy 10, I was like, I don't know. A little bit paranoid. Decided to go somewhere else. And I walk in with my $200 in cash. And I go up to the guy. I'm like, yeah, I want to buy 10 smart cards. And he looks at me. He's like, why do you need 10? And I said, oh, I'm a sales guy. I use the car a lot. I drive around a lot. He's like, oh, yeah. OK. And then he gives me the smart card. And of course, one of the things to note is sequential serial numbers on the back of the car. Yeah. They were all sequential serial numbers, which is useful for analysis. But I felt pretty good about myself for that quick little social engineering thing. You're a regular Kevin Mitnick. Because as you probably noticed, I smile a lot. So I don't know if he was like, I don't know. He believed me, though. It was kind of cool. I'm no Kevin Mitnick. So Chris is totally badass at hardware hacking. And he just decapped all of the chips in there. And then imaged them for us, basically. Oh, yeah. I just realized. We have like 10 minutes. OK. So he decapped the cards with this process that he would discuss if he was here. It turns out that there's two different types of smart cards that's indistinguishable to the end user. But one of them is the basic Gem Club memo card. So it's a fixed ASIC ROM that can't be changed. And then future versions of the card are an 8051 microcontroller emulating the Gem Club memo stuff. Which is cool because now those cards can be reprogrammed. We didn't do that. But they're more general purpose. So they could be changed and not have to create an entirely new die. So general purpose one, of course, is nice because that means it has some firmware. And you could potentially dump the firmware. So in theory, even if they outlawed the rest of the smart card industry, their own system itself can probably be used against itself. And these are the die. So on the left is the ASIC. On the right is the general purpose one, I think. Yeah. So I'm going to skip some of this. The card is based on the ISO 7816 standard, which means a lot of the electrical interfaces are known. There's two different types of transmission protocols for 7816. One is asynchronous. One is synchronous. The card we're looking at is asynchronous. There's no external clock needed. So the data transfer is on one line. And we can capture that. And we did. And the way we did it is we used a smart card shim. So we had a circuit board that we purchased from one of the companies. One of the many kind of satellite TV smart card hacking sites that are out there that we'd plug the smart card in on one side, have a bunch of test points that we could connect to our oscilloscope. And then there is a smart card pad on the other side of the shim that plugs into the meter. So now we can monitor the communications while the communications are actually happening. And there's a kind of funny story here. So you'll note that that's a shim. That's an SFMTA card. If you're ever going to break a law or do anything kind of weird or even something kind of sketchy in San Francisco, there's one excuse that you can always use that will get you away with everything, which is that it's for your art project. Yeah. So this is our art project. We just wanted to show you our art project. You can walk up to a parking meter. I mean you can do anything in San Francisco pretty much anyway. But you can walk up to a parking meter with whatever tools you need and no one is going to care at all. So it's a parking meter also so you can park in front of your target and run a wire like with your, say, AC inverter from your car to your oscilloscope. And then just go on up with your art project and you're just making art. All right. So. I'm going to document the whole process with my camera because it's art. Right. Which I did not do. I don't have pictures for anybody who's considering rating us. Anyway, so here's. Please don't rate us. We don't have anything interesting. We're telling you everything we've got. Everything, yeah. Except the actual details which we're going to tell the city. So this is a screenshot of the digital oscilloscope. The first thing we did is just see if we could monitor communications. And we know that smart cards always respond after reset with an ATR, a 4-byte ATR. So that's how we could figure out. We could just guess on the baud rate. And on the various configuration settings until we got a clean serial data that was decoded by the oscilloscope. We got to roll. Yeah. I know. We got to get to the money shot. So once we could monitor the communications, what we did is we captured a bunch of different transactions. We had a lot of different cards with different values to capture a bunch of data. And then we brought all that data back to my house and sat there offline and just analyzed all the different data. Figured out what changed based on different values. Figured out the initialization and how everything worked. And it was all done by hand. No computer needed. So here's the deal. Watch this setup. What's wrong with this right here, right? Do you spot the protocol bug where it might be a bad thing? Password okay maybe. And then what? What's that? You read the balance? Yeah. We'll go quick here. So there's some initialization stuff that always happens when you put the card in. It sends some stuff. Serial number, which could be useful. Some unknown value sent by the card to the meter that the meter then processes in some way and sends back and says, Here's the password to you, smart card. And the smart card says, yes, that's my password. You can work with me now. Does that sound like a good idea? It kind of sounds like a good idea to me if I'm not the one building these things. We capture one set and we have it and we're fine. But the way that the meter figures out the balance is it reads, This value that I call balance 2 from the smart card. And that's a fixed value based on the value of the card. So a $20 card is F0AF and F127 for a $50 card. When you deduct a single unit, what happens is there's just this transaction that happens. It doesn't affect the actual balance 2, which stays the same. It just does sort of a null transaction, which increments this thing called a transaction counter. And the transaction counter is the only thing that changes on the smart card during the entire process. And that's what's used to count how many units have been deducted. It's how many units have been used. So that value of the maximum balance 2 minus 95 decimal is the maximum card value. And then you would subtract the transaction counter to figure out how much money you have left. Survey, who thinks this is a good idea? Not just the okay part, but the stored value where it's... What would happen if you were to change those values, though? Yeah, let's try to change the balance 2 to say it has more money than it does. So once we capture all the data, the first thing we did was, okay, let's just do a standard replay attack. You know, we'll use a legitimate card that we bought. Let's use that. So we did that. I built up some circuitry with a microchip pick. And we'll show you some pictures of the progress in a few slides. But I used a microchip pick, wrote the stuff in C. And there's a little bit of code on there, but you go to the website and get the rest of it. So once we knew the replay attack worked, we said, okay, let's change the values. Let's change the balance. Let's see what happens. Could it really have 4,000 units? Not that they sell a 4,000-unit card. Yeah, but let's try. And then we also modified the code so the transaction counter would never increment. So your value would always stay at the maximum. So this is automatically refilling itself every time you take it out of the meter. Right, because it resets. Because it resets itself, right. And then unbeknownst to me until when I was close to being done is that satellite TV hackers who have existed for a long time, decades, or at least over 10 years, like using microchips. So it just happened that the microchip pick device I used existed in a smart card form already. So I could get blank smart cards, program them with my code, and it would work. So the first one you see the shim. You see the evolution. Okay, first one on the sketch. If you think about like a threshold, a sketch hold, right? Okay. You've got a sketch hold of really sketch where you have Joe's actual last name logo for the board. There's a G on there. And then you go all the way to the right where you just have a normal smart card. It looks like everything else. Yeah. So here's what happens. Here's the results. And for those that can't see, for those that can't see, the meter has just read the value of the smart card and thinks it has $999.99. We removed the card before it started deducting value, the city of San Francisco. Yes. If you're interested in projects like this and you live in San Francisco, you should come down to the Hack Lab, Noisebridge, noisebridge.net. And we work on some stuff like this. And we do need to mention that we intentionally did not contact the city before this research. First of all, because we didn't want to encounter the same problem that the MBTA guys did last year. But also because we intentionally didn't release the information that could cause them harm. But we're reaching out to them now and we're trying to give them all the information. So here's some fixes that you could have. Really good luck with that. It's very hard on standalone systems. It's very hard to do any proper cryptographic communications. But you can look through these. The slides are on the DEF CON CD so you can browse through them. But it's a very hard problem to solve. Just to be real quick because we have basically one minute. These meter companies have basically created an e-cache system. But they didn't do it right. They didn't take into account the privacy implications. And they didn't take into account the fraud issues. Dr. David Chom actually solved basically all of these problems over a decade ago working on anonymous e-cache. So really they should be thinking about Chom's work and they should be reimplementing that. So that's it. These are our final thoughts. You can read. You can really ride a bicycle I guess to avoid this. Also before you go, we'd really like to emphasize that people should join the EFF. Jennifer Granik really helped us out and gave us advice that made us feel safe about giving this talk. And if you're not a member, you should join. Yes. And we're going to be dragged off to some extra room if you have questions. Thanks guys.