There we go. So my name is Josh Brashears. I am also known as Savant. I am part of one of, I think, the baddest hacker collectives in the whole fucking world, DC949. My boys. Boo! Boo! That's right. Okay. So this talk is called Exploit Archaeology, and this is Raiders of the Lost Payphone. And goddamn, I hope it can get technical. Still need the payphone. If not, I need some black bag operatives who make somebody disappear. All right. So moving on. You're probably thinking payphones. How the fuck is this relevant? It will get technical, okay? But there's first a couple things you need to know. I professionally am a penetration tester by, that's how I get my paycheck, I'm a geek dad of a one-year-old and a five-year-old, it's the greatest thing in my life. I like to consider myself a phone freak. I'm probably one of the worst phone freaks to ever walk the earth. I'm certain that there are a lot of people out there who are like that. There are a lot of people in here that are way better at it than me. And if so, I will buy you a drink. Let's talk about shit. Because really, I'm not the best at the world, but I still think it's a super cool technology that people assume is dead, that it's not coming back, that it is no longer relevant anymore. And I disagree with you. So let's fight over drinks. If you want to follow me on Twitter, Sivan42, I'm sure I'm going to feel my phone ringing right now as people are really disappointed. Anyway. But now that you know who I am. Who I am not. I'm not that gangster. I'm not H.D. Moore or any of the other people that I seriously look up to. And I am a shit programmer. So you'll see why this becomes relevant. Because the fact that I was able to do anything at all is I'm pretty happy, actually. I'm not a reverse engineer, first of all. And I can't spell for a damn. So the reason that I'm giving this talk now in 2012 about pay phones that have ostensibly been dead for 20 years is. Somebody tell 303 to cancel the body bag. Okay. Thank you. So the reason. The reason we're doing this talk is that a couple buddies of mine, one of them is here, was going to be a former buddy of mine. I'm just kidding. I'm just kidding, Rick. I got a pay phone as a gift. And I've always wanted one, right? Except I didn't have anything else for it. It's fucking too expensive. It's 25 years old. So basically it was ostensibly an anvil. It was a 50-pound paperweight. And my whole goal in life was to get this piece of shit working again. But not only that. I wanted to see how can I make this relevant to what I do professionally as a penetration tester. And I know you're thinking, nothing. But that's not true. And we'll get there. In this case, I truly believe that this is about the methodology. It's basically what I'm saying is if you take a complex enough problem that seems to be unaccountable, you know, just break it down into small pieces. If I can do it, I have no doubt that every one of you can do it. So hopefully you take at least that much away. The other thing you're going to have to take away is that voice over IP over the DEF CON network is probably one of the stupidest decisions you can make if you want your demos to work. Moving on. And like I said, this is more about the journey and not the destination. And basically to see if I could do it. But you might notice a theme in exploit archaeology. No Shia LaBeouf, though. We don't talk about that. So as I'm sure you are aware right fucking now, traveling with a pay phone to Vegas or anywhere else in the world, especially without receipts, is a huge fucking pain in the ass. I've done this before. I went with FedEx. And basically this ended up happening. And so I was like, this guy. That's pretty much how I was in the speaker room. I now ask any of the proctors. These guys are amazing. Wait. Give it a half. Fucking the goons and the proctors. Seriously. Okay. So now that's done. So a little bit of back history. Has anybody never used a pay phone? Yeah? A couple people, right? Has anybody ever even seen a pay phone? Because they are there. They're everywhere, right? But they're kind of like homeless people. You don't know them. They're so quiet that you kind of just step over them and look right past them. And they beg for your change. So pay phones kind of be used like this picture, Grand Central Station, et cetera, et cetera. Like this was before cell phones, pagers started to become a thing, and if you wanted to call somebody on the road, you used a pay phone, right? Nowadays, they're a little more like this, and I don't know if the chain link fence shows up in this picture, but it is immediately in front of the pay phone. They didn't bother tearing it down. They're like, fuck it, chain link fence. And they're like this. And that guy. And this is really useful. So nowadays, if you see a pay phone in your life, you're like, hey, you remember pay phones? Wasn't that shit cute? Hello? And now if you see somebody using a pay phone in a neighborhood you're driving through, you lock your fucking doors, you roll up the windows, and you drive as fast as possible. Even Indiana Jones is fucking done with it. So basically, ever since I was a kid, and I kind of alluded to this before, I have always wanted my very own pay phone. It didn't happen until later in life. And some of you people born after the early 80s might not recognize this. This is from the young Indiana Jones Chronicles. So anyway, again, going with that theme. Okay. So basically, having wanted this all my life and having been a huge nerd, I've been looking for this rare and precious artifact. One day I got one. Thanks in large part to this guy. This is generic. Say hello. Hello. Thank you. And a very good friend of mine, Tiffany. Rick was actually holding on to this pay phone for a while while I needed some help doing things. So a little background about where you see them anymore. I'm sure you've noticed that there's a few in the casino, and they're not really relevant to this talk, or I would have ripped one straight out of the fucking wall and brought it up on stage, because those are typically pro-tels and nor-tels. They're a completely different beast, but we'll get into that. But where pay phones are still really relevant and popular right now is in correctional facilities, is in prisons. It's still kind of a big deal to them. And yeah, this one, or at least that one, is actually from a prison. And yeah. I clean the ever-loving shit out of that. I really don't want herpagonosipylase or any of that business. So hopefully being in Vegas for a week didn't set me back any. But let's talk a brief bit about the different types of pay phones, right? So if you think about phone-freaking lore traditionally, you're probably thinking of what is known as a Bocot, colloquially. That is a bell-owned, coin-operated telephone. Those are the ones that more often than not you see people phone-freaking or trying. The difference being these guys right here are Cocots, customer-owned, coin-operated telephone. This is an example. Pacific Bell representing California. So basically the Bocots could be Redbox because all of the shit, all of the coin management was basically done by tones back to the central office that had a special line classification that said this is a pay phone. If I'm not hearing this tone, and I believe it's 1700 megahertz plus 2200 megahertz and 15 millisecond burst, feel free to correct me or throw shit at me if I'm wrong. It's from memory. Probably still possible. I know it was possible at least in 2006 in TourCon San Diego. It's probably still possible somewhere in the U.S., but I haven't seen them in a while. If you know of any recently, I'd love to hear about it. I'll buy you a drink. But most of the regional bell operating companies have basically outsourced all of that to private companies. So it's not really a lot of things you can do right now. Now, co-cop pay phones like this one cannot be Redboxed, and the reason is they don't rely on the central office to handle all the call management shit. They basically have computers inside, albeit computers from the early 80s, but computers nonetheless because they do not use ACTS. And I'm too tired to remember what ACTS stands for, but that's Redbox tones. So with smart pay phones such as these, all the shit that happens actually happens right on the pay phone. So all the good stuff, right? Whereas telco pay phones happen at the central office. So there's a couple of ways to tell the difference. The most obvious one is the style of housing. Most, although not all, bell-operated coin-owned telephones use a Western electric-style housing, whereas in this case, and again, this is not a rule. This is just kind of a guideline. You'll notice that the armored cable goes into the front and the coin returns on the left. That's not to say that co-cots aren't like this. In fact, many, many, many, many, many, many, many, many, many, many, many, many, many, many, many, many of them are, even the Alcatel ones. But off the top of your head, if you see these, you're starting to build a profile in your mind. Conversely, the co-cots use the GTE-style housing, which I believe these both are. They are. The difference being right away that the armored cable is on the side and the coin slot is on the left. You're going to notice that all the pay phones, like both of them, at the Rio, are using GTE-style housing. And if you do try to hack them, I will disavow telling you about any of this. But I don't even think it will work. So, yeah. So anyway, Generic brought his own, which I believe is relatively the same. This pay phone is an Alcatel Series 5 line-powered pay phone. And what's cool about this is Alcatel had a patent, giant six-volt lead acid battery that basically trickle charged off the late electricity in most analog phone systems. And because it's a smart phone, all of the rate management shit, the long distance handling and all the special features, that all happens inside the pay phone. It's kind of cool stuff. So Alcatel is the company that made this. They are long since gone. They are gone like the fucking dinosaurs, okay? So trying to accomplish my mission ended up being far more of a pain in the ass than I thought. But I got the pay phone, so now I, too, could dial the 1-900-295-cents-a-minute Indiana Jones text tone adventure that used to be in the back of comic books. Anyway. So we have a couple problems. Number one. At the time. I didn't have keys. I didn't have a working battery. I had fuck all for documentation. Not only that, but the phone was from a different area code, which meant if I wanted to call my wife, like, hey, how you doing, it was like $8.25. So then you have to go to the laundromat. Okay. That's not a good solution. So there's a couple things we need to do. The methodology, right? First, get the phone open. Second, replace the battery. And third, reprogram for free calls. And then afterwards. Then we can start to do some interesting shit with it. So the first goal that I had was I wanted to open the pay phone. But I didn't want to drill it. I didn't want to use a crowbar. And I mean, I wanted to blow something up, but not my pay phone. So that was out. So the goal here was nondestructive entry and keep the phone as intact as possible. So we had to come up with some cool solutions. I had to pick these locks. Now, at the time, I was really lousy at it. But I've since gotten better. Then there's three types of keys that you need. So there's the upper housing lock. This is a bit lower security, which is weird, but we'll get into that later. Because really, the important shit's in here. What you're going to find in here in the coin vault, which uses a completely separate higher security pin, is the money. And on average, they hold about $120 and quarters. If you're a penetration tester, you're probably going to make that money back before you'll get the pay phone open. So it's not necessarily worth your time. But we'll get into that in a second. Finally, there's a T-Wrench. And I believe I have it in my pocket. Dear God, I hope so. If not, not terribly relevant. But basically, this is a torque wrench. I don't know if you can see this right away, but underneath, on top of the coin vault, there is this little weird looking ratchet thing. And there's usually another one on the side right here. And find me later and we can actually take a difference. You need all three. If you want to open the phone and get it to do what you want, you need all three. You need all of them. And I had shit. I had nothing. So interestingly enough, the upper housing lock only had three pins. They weren't security pins. They weren't mushroom or spool or anything ninja like that. Because they really didn't think when they designed pay phones that this would be where people would want to go. They figured everybody would want to go here. One interesting fact about these is that they did have anti-impressioning divots, which I didn't even understand until Scorch from 949 helped explain that to me. Scorch, are you here? Fucking lazy. I'm just kidding. So that was neat. And I was able to pick that pretty quickly. And if you find yourself with a pay phone, especially one of these in the GTE style housings, the first thing you want to do is pick this lock. The lesson I learned is it's only going to rotate about 45 degrees. If you got it to do that, you've probably already opened it. So cool tip. It took me about 20 minutes to figure that out after I actually already picked the lock. So pro tip. Coin vault lock, not so much. For some reason, they decided that this should actually be a slightly higher lock. Go figure. So there were four pins in this. There were a couple security pins. These are created by Medeco. You can still buy them today, although it's not the ultra high security Medeco biaxial locks. But at that time, I hadn't practiced enough, and I was personally not able to pick it. So I brought it to a hacker con because fuck yeah, someone there is going to have the skill set. I took it to a really awesome hacker con in Mountain View called Baythread. And I highly recommend it. But I digress. So I brought it. Everybody's like, whoa, I haven't seen one of those in like decades. Where did you get it? And I'm like, I don't want to talk about it. So it was cool. There was a long line of people that were trying to pick this. Because everyone's like, nah, I got this shit. Four pins. Let's do this. 30 people tried and failed. And then a guy came up to me and he's like, did you try raking it? And I'm like, fuck yeah, I tried raking it. I've been trying to pick this thing for several days. He's like, do you mind if I give it a try? And I'm like, please, why not? Fucking open in 10 seconds. So I'm going to be honest with you here. I didn't even field strip that lock because I didn't want to know what was inside. I handed it to him right then and there. And I said, this is for you. I took it out of the payphone and he kept it. And I never want to see the damn thing again. So we've got the vault lock open. We've got the upper housing lock open. We still need a torque wrench, which at the time, I've since received one, I did not have. So we had to do a little harder hacking. Virus, are you here? You still sleeping? Fucking virus. 949, you'd think that we're alcoholics. So we took one of the old DEFCON badges and we're actually able to kind of hack something together with a badge clip, a nice wrench, and some faith. And what we came up with was a little bit something like this. You get the general idea. It looks a bit like a legitimate payphone torque wrench, but it worked. Now we got the damn thing open. Yes! Okay. Step 2. Dead battery. So because these are line powered and all the computer shit on the inside needs enough juice to sort of make the calls once you take the phone off the hook, you need to have a battery that actually retains a charge. And these are a lot harder to get, or at least I thought at the time. So I went to payphone.com, which did have the battery for a great price, $5. Oh, and it's only $35 to ship it. Or more if you want it expedited. So I paid it. What are you going to do? And yeah, I was a mad bro. Okay. So now that the phone is sort of alive, we can get a dial tone theoretically. Okay. So we can move on from that to the next step, okay? So the problem we're still dealing with is the payphone is from, I don't know, some Nigerian or some such PSTN extension. So actually using it was kind of out of the question at this point. So basically we needed a means to reprogram it. So we got a zero at the rates table, which basically determines how much money they're going to charge per call. Then I wanted to find some vulnerabilities in the software, which would have been awesome, except we'll get into that later. And somehow maybe turn a profit. Step four. So the first hack I was able to do before I was able to actually get any sort of software was by law all telephones that actually have a dial tone are required to make 911 a free call. So with an analog telephone adapter and a little asterisk Linux PBX magic, you dial 911 on my phone and it gives you a secondary dial tone. Sweet, right? Cool. It's funny. People come over to my house like, oh, no way. A payphone. How do I call? And I'm like, dial 911. And they're like, fuck you, buddy. And I'm like, no, seriously. Dial 911. It's from my house. If the cops show up, I'll fucking deal with it. So they did. And they're like, oh, okay. So that was cool. And it worked. But it was super sloppy. And it was not really what I wanted. I wanted a working payphone that worked for free. So the documentation was basically nonexistent. And for several months I put in the phrase Alcatel and eBay with a hope and a pray and eventually I started to get some hits. And it was cool to some extent. It didn't talk about how to actually install the payphone. It was part two of a three‑part manual. So kind of helpful. In the long run, not so much. Okay. So maybe I could contact Alcatel, right? Maybe some of the engineers are around. Nope. Long gone. So I went to eBay and paid way too much money. For a photocopy from a guy, and I'm probably the only one who's ever bought one, but you know what? The very next week he had another one listed because they're fucking photocopies. So if anybody wants a copy, contact me after the talk. For free. So basically I had part two of a three‑part manual. And it's ostensibly like looking at the rose at a stone because only having one piece of it didn't mean a whole hell of a lot to me. But it was something, right? Okay. We're getting there. This is Hackajarth. I'm sure he's not here because we're hackers and we sleep in and 11 is early for us. Okay. So it was useful, but only to some extent because I didn't actually have the software to reprogram it. So I found out from the manual that there are actually three ways to reprogram Alcatel payphones. One, software, which I don't have because it's fucking old and they're gone. Two, local telemetry. We'll get into that in a second. And three, remote telemetry. So software is gangster. If you manage to find a copy, though, this is not freeware software. You have to then have a serial number from a company that has been dead in the ground for 20 years. So local telemetry is another option. And if you've got the keys or some lockpick skills and you own the phone, I have to emphasize that or EFF will probably not take my cause, then you can open this up and you can do it from the field. And I'm sorry I'm losing this guy. I'm going to try and make this a little more interesting for you. So basically you push the button, you flash the hook, there's voice prompts, whatever. You can reprogram it. And remote telemetry is where it gets badass and that's where I teach all of you guys how to own all the payphones. So software-based programming is cool. And the cool thing about most phone freaks is that they keep everything. I believe that there's a closet somewhere that they all share space in that just has every type of hard disk from the beginning of time. So we got it, right? So it's time to crack the software. Because that was pretty much our only option. But cracking 10‑year‑old software, especially if you're not an RE, is actually pretty damn hard. I had a lot of help, especially from the 949 guys, but as it turns out, 16‑bit NE binaries, new executables, not PE files, which you may be familiar now if you do any sort of RE. Even IdaPro was like, WTF, mate? No idea. At least not within the time frame that we needed. So I had a lot of help. And by help, I mean people way smarter than me did this for me. Thank you, guys. You know who you are. The Virus001, N80 and Frank 2. Eventually we're able to run the installer program, hook into it, jump the actual serial number check, then uncompress the installer archives, and now we're talking. Now I don't expect you guys to be able to have this software. Talk to me later. But now it's starting to make some sense, right? So now we're getting somewhere. Even with only part two of the manual, we're able to do some shit. So built in to these pay phones is really interesting fact, is they have a modem. modem. So if you call the pay phone, it will eventually answer with a modem on the El Quetel series. Sometimes they're configured to pick up after one ring, sometimes they're configured to pick up after eight rings. So that way if local ordinance requires that phone calls are able to have inbound calls, then they're legit, right? So basically it is a requirement on El Quetel pay phones. I got a confession. I didn't even have a landline at the time. Worst phone freak ever. So I had a solution. It's this guy right here. It's an unlocked Linksys analog telephone adapter and a little USB modem which, yeah, you can still buy at Fry's for too much money. But basically voice over IP for doing anything other than making cheap calls to grandma is a giant fucking pain in the ass. If you're trying to do any sort of actual data connection type stuff, there's a lot of things you're going to have to know. And the Telefreak boys, I hope some of you are here because you saved my ass. I have some things. First of all, disallow all codecs except for ULAW and ALAW. Disable noise cancellation or you're going to have a bad time. Echo suppression, you want to get rid of that. And 9600 baud is about the fastest you can reasonably expect. And I'm sure there's at least a handful of you who don't even know what 9600 baud means. Realistically, though, I was getting 1200. But that's all that I needed. Okay? So a huge thanks to the Telefreak guys. Hi B. I know you're not here but maybe you'll see this someday. Oldschoolfreak.com guys, a lot of people along the way over the years have really helped me understand this. So real quick, let's briefly discuss defaulting the phone. When you open it up, in the upper right hand corner, there's going to be a button. If you can push the button, you can default to all the known values. If this is your pay phone that you own, it's a reasonably acceptable option, okay, if you just want to work from known values, which I had to because I knew nothing else about it because it came from prison. So that's called localization. I'm going to show you a little bit of local telemetry. Push the button, flash the hook, enter the code, and it will actually speak to you in text to speech. Kind of cool. All right, boss, is that a little better? Is that a little better? No, is that worse? Okay. Give them what? Oh. I just wanted to show some skin. Okay. No, no, no. If you got it, we're good, right? So basically, local telemetry is the way to go if you know what the options are once you're in there. And if you have physical access to it, not that I would ever condone hooking into a pay phone that you don't actually own, but it's kind of shady to be opening up pay phones in a casino or an airport or someplace. They might get a little dodgy about that. So this is kind of dubious and you don't really want to do that. Okay. For the purpose of this example, in order to reverse engineer the protocol, I did at that point actually need to have a pay phone with me. But, actually, need to have a pay phone with me. Okay. So, you don't want to have a pay phone with me. the software. So we were able to get it. And what's cool is often times telephone sysadmins like many other sysadmins, no disrespect to the sysadmins here, tend to be lazy. And everything in this entire world is on default for the most part. So Elkatel's the default phone ID, think of that as the username, is four nines. Cool. Okay. The actual password is typically eight nines. And then there's a secondary password if you want to do remote telemetry, which again we'll talk about later. It's eight eights. So this is all in the CD. Once you're able to connect, the rest is actually pretty damn easy. But I don't think you guys are here this morning to hear me talk about how to use 15‑year‑old software. It's kind of irrelevant. So what I needed to do at this point was some hacks, right? So the Elkatel engineers, as it turns around, were actually not complete idiots. There were a lot of really cool anti‑fraud mechanisms. Secondary dial tone detection, where if you call an 800 number and you wait for them to hang up, the polarity of the line doesn't reverse. So what happens is you get dropped into an actual secondary dial tone without ever having to put any coins in there. That was a really popular trick for a while. So they figured that out and they stopped that. And then they decided, what the fuck, red box detection. Even though you can't red box these phones, if you try, it's going to send an alarm to the central office. And if they were feeling not lazy, then maybe they'd send a guy over there. Probably not. But what is relevant is that there actually are chassis alarms. There's little contact closures inside the phone. So if you open it, it's going to send an alarm. So if there's some, like, grizzled old guy somewhere in a cave that's actually still running these things, and I assume that they're probably somewhere, he's going to get an alarm. And if he feels like it, he's probably going to check it out. And there is a modicum of brute force protection for the credentials, right? So how do we do this? We need a harness to fuzz the phone. And in order to do that, in order to analyze the protocol, right? So I'm like, all right, well, I've got a SIP adapter. Every tool has the ability, even Wireshark has the ability to capture SIP packets, merge them together, and you have call audio. Cool. I'm sure I could turn the call audio into ones or zeros, right? So it turns out frequency shift key demodulation is actually pretty fucking hard. At least for mere mortals like me. If you can do that, I'd love to hear about it. Obviously, the law enforcement guys were able to do it. They were able to do it. They were able to do it. They were back in the 90s because a lot of people went down over this stuff. But I digress. Anyway, I couldn't pull that off. So I decided I needed it another way. And I was still going to have to black box reverse engineer the protocol. So somehow, if I was able to analyze the actual protocol itself, then I could do it myself. But how the fuck do you hook a USB modem? I mean, like, you might have been able to do it monitoring the PCI drivers, but this is a little bit different. So my employer at the time, AppSec Consulting, were awesome. They bought me a tool that I needed called Advanced Serial Port Monitor Pro. And basically, it treats USB modems like actual serial devices and lets you hook into them with spy mode or even think of it like Burp Intruder for RS232, other serial port based ideas. It's very cool. So in pass-through proxy mode, it's called spy mode. You can see some cool shit. So now we know a couple values, right? We know the default password. We know the telemetry password based on the manuals. So using the actual software that I got, I was able to perform a number of things. I was able to find a known set of functions and then compare the hexadecimal output of that to what it was correlating to with PNM, which for me was actually kind of sweet. But anyway, I was able to figure out how some of it worked. A lot of it is still black magic, even to me to this day. But the fact of the matter is I know the important shit, at least for now, which is authentication. Don't expect to be doing any sort of crazy cool buffer overflows and injecting your own shell code because these things, I think they have like 64K, which might be big enough for an interpreter, but what are you going to run it on? It's not an operating system. So typically speaking, if you're hacking these in the field, the ‑‑ this little guy right here under the hook flash, that's usually where the phone number is and usually though that doesn't work, that's for the guy that services these to understand what the phone code is and it's often the last four digits of the phone number. And the passwords, again, are almost never changed from the default if they even bother to change the user name. So basically here's PNM Plus running in the background and you can see behind that is advanced serial port monitor system. All of the yellow is shit that we're sending. All of the red is the hardware and all of the white stuff is actually what the phone is sending back and you can see that I got awesome speeds at 1200 bits per second. 1200 baud. Okay. You can probably yell characters faster than that now. So I was going to do a demo, but given our shortage on time, basically the demo was me dialing into this shit and you seeing what the protocol looked like. So I'm just going to spare you some time. And basically this is kind of what it looks like. So I'm just going to spare you some time. And basically this is kind of what it looks like. So the ATDT is the haze command dial string. In this case I had it set up for seven ones. And then beyond that it sends a start and then a quick user ID. In this case it's 09090909, which also for some reason correlates to hexadecimal tab and then an in transmission. And the phone goes, bangerang, acknowledgment, you're there. What do you want to do now? And then you say, well, actually I'd kind of like to send you my password since that's what usually comes after user names. Kind of crazy, I know. So it sends this other code, 029003. We don't want to send you my password. We want to send you my password. We don't really care necessarily exactly why they implemented it at this point. What we care about is this next block of code. And I'm sorry, I'm sure it's too hard to read. The important line is at the very end of that is what it looks like when you actually send a valid password. There's a header. It's cancel, null, start eight times. It doesn't really matter necessarily. If they're using it for some proprietary means, we don't care. Then after that there's a time stamp. There's the minute. I wish I had a laser pointer. There's minute, hour, and acknowledgment checksum. Then day, month, and day after. And then after that there's the month, year, and another checksum. And then after that there comes the actual pin that we care about. And finally a last checksum. So as it turns out, other than the header, the pin is the only thing that matters. As long as you send those two and something for those values, you can actually start to interact with the phone. So it's not a direct hexadecimal to ASCII translation, which kind of threw me for a loop. This phone uses the extended hex table and it's using some sort of XOR that I'm way too tired to deal with right now. But what matters is basically I changed one character, I flipped one bit at the end, and what I found out was that the hexadecimal representation stayed the same. So it's a simple XOR. It's not any sort of like rotation or crazy crypto bullshit that I don't understand, thank God. So when you do it correctly, it sends an acknowledgment or hex 06. But when you fail, it sends a hex 15. Okay. True or false? Starting to sound like SQL injection. This is shit that I can relate to. Okay. Cool. The problem is, I'm not going to be able to do this. I'm going to be able to do this. I'm going to be able to do this. After three invalid log in attempts, it kicks your ass off. So brute forcing is kind of difficult if you have to keep dealing with this over and over again. Problem. Elkatel decided that the three attempts would be handled all in software. And they never thought that anybody would ever be able to look at the actual authentication handshake and protocol. So if we were able to write our own code, we were going to keep trying until we get the actual right pin code. Yes! Okay. Finally some hacks. We're going to do a little bit of a test. We're going to do a little more technical. You guys still with me? Not too tired? So basically, pseudo code. Nullify the pin. Send it. If it doesn't work, if it's not a 06, increment, send it again, repeat until you're awesome. Python's got a bad ass serial library for this. But I mentioned before that I'm not a programmer, kind of an idiot. So I had some help. And that's where my buddy generic comes in. And having smart friends is awesome. And God willing, the code will be up here. It might get me a lot of credit. So here's a little bit of a demo. So I think you guys will be able to see the GitHub site after the DEF CON hangover clears over. So if you guys can hang tight, this slide is on the CD. You should be able to get it later. Generic, you want to jump in and talk about the code real fast, or at least how it would work if, you know, it wasn't Vegas and we were trying way too hard to get this done on time? No? You want to skip it? All right. Case in point, check out the GitHub site. Shit will work. It's a very basic Python library that allows you to log in, write the code and then you're going to be able to get that all in the into these things, assuming you can find one, and because this library is pretty simple, it doesn't care about Windows, it doesn't care about Linux, what it cares about is Comports. So cool stuff. We have the user ID. Check. We have the PIN. Let's talk about profits. So here's where remote telemetry comes in. This is why you guys should care, even without the software, even without any of it, the manuals, et cetera. It's cool. So you'll know that this is a PNM specific type of pay phone. If you get the number, you call it and a modem picks up. The first thing that's going to happen is it's going to scream at you in modem sound for about 30 seconds. The key here is after that, after exactly 30 seconds, the handshake stops and then you have 10 seconds to enter in the password. Pound, 8888, 8888. And then it says, thank you, and we'll drop you into a voice menu. But it's kind of cryptic because all it's going to do is wait for you to enter in a three-digit password. And then it's going to type in a three-digit code and then it's either a yes or a no or it will read back whatever the string value that you're trying to input into this. So you can use DTMF and in this instance registers are springs basically in programming and options are binary bits that you flip. So the first ones you might actually care about are 421 through 434. These are the anti-fraud. Set those to no. We don't need that. And then these other registers, which I talked about below, 333 through 326 and 414, 412. Remember those types of registers? They're the ones that are in the code. So if you want to disable those chassis alarms I talked about earlier, yeah, not that I would ever encourage that. But if you did want to disable those chassis alarms, this is how you would do it. You change these to zero. So some more cool shit. Phone number, you can change what the phone thinks the phone number is, although that doesn't really make a whole hell of a lot of difference unless you're trying to actually make money running and managing pay phones. The phone ID number, which we talked about earlier, that's the four-digit code. In this case it's 9999 by default. That's important. The phone ID number, which we talked about earlier, that's the actual password once you've logged in and you don't need the actual PNM plus password at this point. You need the bypass code, which is slightly different. Real quick, I forgot to put the slide in. We talked about how to brute force the actual user ID and password. Getting the telemetry password is a little bit different, but with some asterisk dial plan magic, you can actually brute force this PIN eventually. But if you think about it, that's two attempts a minute because you have to wait for the modem to stop screaming. You have to use the voice modem. Tell it not to use the voice modem. Tell it not to use the voice modem. Tell it not to respond to the modem. And then with asterisk, you've got to then start brute forcing. If you do it fast enough, you could probably do it in a couple weeks. That's the telemetry password. You can change that. You can disable the battery remotely. Why? But essentially what happens is you turn off the battery, phone no worky. I'm not sure that there's like an Ocean's 11 style use case for that, but it's interesting, right? And then there's the service desk number. So service desk is bad ass. It's a little bit of a mess. It's kind of like sudo or operator mode for the pay phone, right? Any time you've sworn, kicked and screamed because some asshole put gum in the coin return and you can't get your money back, usually you call them. It's like 611 or whatever. You can divert this. You can overwrite it. You can send it to your cell phone. So if you automate this and you own every pay phone in the Sarasota, Florida area or wherever and they're all running Elk Hotel, you can do some cool shit. You can give yourself free calls by applying credits without actually having to manipulate the rate tables. You can do some cool shit. You can give yourself free calls by applying credits without actually having to manipulate the rate tables. You can issue refunds. You can force numbers, force it to dial numbers for free. What's also interesting is when you put coins in a pay phone, it won't drop straight into the vault. What's going to happen is it's going to go down the hopper and it's going to chill out there in escrow for a little while. Escrow is a pre-configurable amount, up to $5. So if you want to get super rich, $5 at a time, this is the way, right? Okay. So. Whatever. $5. That's less than a fucking McDonald's meal. But anyway. So that's the idea. You put the coins in the hopper. You can call your cell phone, press a DTMF button on your phone and you get $5. You would make more money collecting aluminum cans, I'm pretty sure. But it's kind of neat, right? And that demo is not going to work because it's DEF CON, it's VOIP and that shit crashed and burned. But I will try to do some other cool shit using a soft phone. I promise you it does work on the phone. So bear with me. Okay. So. Cool. We've owned the phone, right? We've zeroed out the rate tables. We've got the software. We wrote some sweet tools to harness it. Well, fucking now what, right? Okay. Well, if you're feeling like getting retro, there's Project MF. Fiber optic. You in here, buddy? Yeah, he's probably sleeping enough, too. Anyway. Fiber optic is here. If you track him down, shake his hand. The dude is legendary in the 90s and still to this day. Very cool. He, at Hope 5, I believe it was, released a mod for Asterisk, the open source mod for Asterisk. It was a mod for voice PBX to actually fucking shovel in Blue Box capabilities back into an Asterisk voice PBX. So if you want to be old school, you can Blue Box your own pay phone even though that was never something that you could do with this. That was operator side. But that's out of scope for this. So, yeah. Project MF.org. It's still there. So check it out. And then there's red boxing. And this is more code that we couldn't fucking figure out because we were at the spider lab's party a little too late last night to get it to work. But basically, Asterisk has a concept of an EAGI. It's a spider lab. It's a spider lab. It's a spider lab. It's a spider lab. It's a scriptable language. You can use any sort of programming language to programmatically interact with Asterisk and various style plan functions, bash, Python, Ruby, whatever the hell you like to program it. And you can actually use it to interact with call audio. So this code will be up again after the hangover clears on the same website. But basically the idea is it records the audio using AGI. My 949 buddies know a couple things about socks. I don't know if you heard about that whole shattering Google recapture thing. Over and over and over and over and over and over again. There's some socks magic involved in that. So basically the idea is you record the wave. Here. Good thing I have this guy. You guys remember these? A lot of people won't. And since I mentioned blue boxes. Thank you. So the basic idea is you record the audio, you send it to the script. The script says, okay, low band pass filter. You're going to have a filter. There are or are not, there is or is not the presence of this frequency. And if it's above a certain threshold, bangerang, you've put in some money. And if it's beneath that, no, fuck you, try again. So the coin value is greater than or equal to 25 cents if you preprogram that. Awesome. You can now red box through Asterisk. So this code will be there soon. So that's cool. Novel, right? Whatever. But, you know, we're hackers. We're pen testers. At this point it's still just a novelty. How can we use this in super evil ways? I came up with a couple things with some help. So basically you take an unlocked Pap 2 ATA like this guy and a poem plug or something similar and an alpha wireless USB and you get what I call the pay pwn. Okay. So Asterisk, and I highly recommend if you're into phones at all, and I think you might be because you're in this room right now, check out Asterisk. It's got a lot of cool functionality, especially the system options. Because every time you go to the Asterisk, you'll see everything needs a way to pass shit to the operating system. But anyway, we're kind of going to use that. So the idea is to make macros, simple wrappers for the most common penetration testing tools. And using text to speak engines, there's Kepstra which is for pay in Linux. There's Festival which is free. Also pretty decent. You can use and make responses. And a very good friend of mine helped me write code. In his mirror. Are you in here? God damn. You think 11 a.m. would have been late and I wouldn't have been able to do that. I'm sorry. I'm sorry. I'm not good enough. But I guess everybody had a good time. So again, the pay phones themselves are having some issues right now. So what I want to do is send this shit over. Don't read my e-mail. So dear God, please work. All right. Please. I'm sorry. I'm sorry. I'm sorry. I'm sorry. I did not drink enough booze for the demo gods apparently. I swear to God I really did practice this. Oh, I don't have internets. Awesome. That's not going to work. Distrusting. You're in my laptop hacking my stuff. Ten minutes. I'm going to haul a you guys. You can find me after this and I will show you Nmap by 4. Alright guys. Thank you. phone, it is actually quite bad ass. But the idea is you actually enter in an IP address using touch tone, 1, 2, 7, star, 0, star, 0, star, 1, pound, and it says please stand by, owning shit. And then it will actually use NMAP parser, parse the XML output and then read it back to you. Okay, cool. I can run fucking NMAP from the phone. That's baller by itself. So that's Inasmir's code and it's really sweet. But the idea is you can really apply this logic to anything right now. It's limited by your own imagination and skill. So what's really cool is PwnPlug actually has built in support for a slimmed down version of Asterisk. It's not made specifically for the PwnPlug but it uses the same arm prepackaged that exists on other things like OpenWRT, DDWRT, et cetera. So using an alpha to hook into a wireless network, initiate DTMF scans. You could hypothetically roll a pay phone up on a dolly to some place like, I don't know, a casino, something like that. And then you could use it to run your IP address. Something like that. Not that I'm recommending that. And you can actually use the touch tones to initiate scans and stuff. So that rig might look a little bit something like this. Duct tape it behind the actual pay phone and then roll that fucker in there. If you walk around after this talk, I hope you'll start looking for them because basically now they're just empty wooden shelves, which is cool. And basically, yeah, there are a lot easier ways to do this. You know, I get it. But what the hell? This is fun, right? And be honest with me, if you saw a pay phone, would you really expect it to be owning your network? I don't think so. Okay. So call interception. Dear God, please work. I swear to God it worked in the demo in the other room, right? I think that always goes away. All right, you guys. This is what's going to happen right now. And if any of you fuckers DDoS my demo right now, because I'm going to go off the fucking radar here, the reservoir, and I'm going to try and do this over this, okay? So first, before the knot kills me, I'm going to disconnect to the private speaker network. And anybody got a rogue access point they can turn on for me? Yeah, you can steal my shit. Just make sure it goes to the Internet. That's all I'm asking for. There's SIP credentials. And if you've never looked at SIP, it's basically HTTP. Seriously. Check it out sometimes. What up? I'm attempting the demo, guys, as it is right now. I'd really like to see it. I really do appreciate the option to tether, but that shouldn't happen. Come on. Whoever is running the rogue AP, could you just turn the power up just a little bit? You're not routing. That was the only thing I asked for. Hey, Corey, can I use your iPad? Why don't you call? It's your iPad? Oh. I don't remember that password, dude. It's been a while. It's been a while. I appreciate that. That's Corey and Monica, by the way. They're awesome. Game over, you lose. Sounds legit. All right. I know that feeling right now. Let me try the knock one more time. Basically the idea is this. Now that you own the pay phone, and if you're clever enough to be able to get an analog telephone adapter into the pay phone, now you can start to do some really cool shit. Call interception. So if you're a computer and you're looking for a way to do that, you're basically phone tapping. It's a cool idea if you can get it to work. I swear to God it works in the speaker room. Let's try this one more time. Okay. I think it's working. I'm going to call my cell phone. You can call me on this, but come on, do it at a reasonable hour. Right, really? Already? Fuck you, I'm not answering an unknown number. I don't care which one of you it is. The irony, of course, is that when I call myself, it's going to be an unknown number. Let's try it one more time. Pro tip. If you're going to do stuff messing around with asterisk and various voice over IP protocols, I highly recommend IAX2 over SIP. It's much lighter, it plays much nicer with NAT, and there's only one port you have to actually open as opposed to 10. So, yeah, I'm almost done. Thanks, boss. One last time. If not, find me afterwards and I'll make it work for you. Okay. So the idea is roll the pay phone into the casino and wait for people magic? I wish. In summary, so using this information, we can actually use remote telemetry to own a local pay phone. Did I miss that slide? That's kind of important. Okay, real fast. So the idea, you can call any Alcatel pay phone in the world, you wait for the motor to stop screaming at you, put it in the code, and it doesn't matter where you are. If you have a dial-up phone, you have a cell phone, you have a way to do this. You have the registry and the code, you know it. That's manual I pay too much goddamn money for, I'll send it to you later, then you can actually theoretically own any of these pay phones. So what's the use case for this, right? Okay. So number one, we learned methodology about how to reverse black box shit. If I can do it, so can you. And that should be a takeaway from that. Number two, we learned that these things are still really possible and popular in prisons. So that's kind of cool, right? If you're a shot caller in prison, number one, being able to make free phone calls is worth at least a couple cartons of cigarettes as long as you don't think about how they actually got into the prison one at a time. Okay? The other thing is, if you're running a gang inside prison, you know, you've got the race wars or whatever else. The ability to intercept the calls and divert the calls of your enemies in prison is actually a pretty interesting use case. I made this relevant. It took me a while to figure that out, but seriously, okay? But the other thing to take away from this is that even though pay phones are 20 years old and they're sort of low to technology, there's a lot of old shit out there. I was a pen tester, I still see IBM, I still see the iPhone, I still see the iPhone is the new hotness right now. So if you want to do that shit, there you go. And with the pay phone and the asterisk system command dial through possibility, you can basically do whatever you want with these things. Not to get a little sentimental and cheesy, but I don't want these things to go away because they were so important, especially if you're like me and you like the wire because they use pay phones all the time and I wanted to be that guy. So here's some more information. Hack Canada did a zine a really long time ago that talked about these in brief. The pay phones dot 50 megs dot com actually has some pretty cool documentation. You can get the end map script from Ben Jackson off of his site. This is again on the CD. The GitHub site will have the code and if you really want to, you can give those thieving bastards at pay phone dot com some money or you can just go to Fry's and hack together a 6 volt lead acid battery. Okay. Questions? I think we're running pretty low on time. All right. Well, if you have any questions, feel free to put them in the chat box. If you think of something later and you want to buy me a drink, that works. So a bunch of people I want to thank. Def Con, thank you. Tiffany, generic here, who gave me the damn pay phone. Doc Hoof with the fucking awesome title image. My boys at DC949. Innis Meir, Black Ratchet, rest in peace. DeBeef who couldn't make it. Strom Carlson, rest in peace. The Benrev.com boys, I love you guys. Old Tool Freak and most importantly you. Thank you so much for your time. Thank you. Find me later and we'll make the demos work, I promise.