Hallo Du!
Bevor du loslegst den Talk zu transkribieren, sieh dir bitte noch einmal unseren Style Guide an: https://wiki.c3subtitles.de/de:styleguide. Solltest du Fragen haben, dann kannst du uns gerne direkt fragen oder unter https://webirc.hackint.org/#irc://hackint.org/#subtitles oder https://rocket.events.ccc.de/channel/subtitles erreichen.
Bitte vergiss nicht deinen Fortschritt im Fortschrittsbalken auf der Seite des Talks einzutragen.
Vielen Dank für dein Engagement!

Hey you!
Prior to transcribing, please look at your style guide: https://wiki.c3subtitles.de/en:styleguide. If you have some questions you can either ask us personally or write us at https://webirc.hackint.org/#irc://hackint.org/#subtitles or https://rocket.events.ccc.de/channel/subtitles .
Please don't forget to mark your progress in the progress bar at the talk's website.
Thank you very much for your commitment!




======================================================================





Welcome to the talk. Hardware attacks, advanced on exploitation and Android hacking delivered today by the author by one of the coauthors of the book Android Hack Handbooks and author, a regular speaker and trainer to DEFCON and Black Hat, give a warm hand of applause to Mr. Stephen, really? What's up, guys? How you doing? Right? Can you hear me OK and everyone hear me? This is this is very impersonal for such a personal community. It's awfully distant. So I'm going to try to make this as personable as possible. So it's kind of thrown together. Just kidding. Well, what I'll do here is I'll try to basically, there's been a lot of stuff going on, so I'm going to give you a lot of material and a short amount of time and kind of just tell you what we've been working on and some of the research we've been presenting about recently and specifically some of the trainings we've been doing. So the talk, as he said, is a hardware attacks, arm exploitation Android. And then I'll talk about a few other little side projects speckled here. And there is a lot of photos because with hardware stuff, it's tangible. And I can't like show you a PCB up here on the podium, so I'm going to show you on slides and stuff. But first, I'd like to like to note that I don't see a single is there? Are there any black people in here? Are there any black people not other than on the stage right now? Can you please raise your hand? Not nobody raised their hand. Wow. So maybe we need to start another community initiative like to reach out to, you know, minorities and yeah. I appreciate your pandering applause. It was quite nice of you. All right, so let's get down to business. I'm Stephen Ridley at Steven is me. So normally what I would do in smaller circumstances, we run a blog called Don't Stop Beans Up Your Nose. Me and a former colleague, Stephen Lawler, and we would throw these condoms into the audience. And this place is too big to throw a bunch of condoms into the audience. But on the condoms,
 you can see this they prevent more white hats where this black hat in the condom is, of course, a black hat. If you want a couple of them, come see me. Describe me. I'm the black guy at this conference. You'll be able to find me. All right. So all race issues aside, let's have a little fun with hardware and stuff. So first a bit about me. I run a blog with Stephen Lawler, as I mentioned, don't stuff beans up your nose dot com. If you want to know the story behind that, I won't bore you. But it's a pretty neat story. We used to work together. There's a little bit about me. This screen is huge. It's huge, it's ridiculous. And everything a screen this big. That's funny. What's that? It's right in front of me. Holy crap. Right there. Look at that on my laptop. You've got a lot right there, too. There's a TV there, and there's one there, too. Thank you. Whoever you are, you are a genius. All right. So who we are? I'm not crazy. I'm actually representing my buddy, Stephen Lawler, who is right there. That's us drinking. And yes, that's a gift. That's how Steven does Tokyo. That's at the Gundam cafe. So nerd points there, I'll have, you know. Anyway, so here we are. I run a small information security consultancy called Exhibitor. Prior to that, it was this chief information security officer at Semple. I worked at McAfee. I founded the Security Architecture Group there. I was a founding member of Con. We run about we won a bunch of seats. Then we started running at a DEFCON. I've spoken to a bunch of places DEFCON, Black Hat, now CCC, which is quite the honor on my my dad. And so I guess I should places. And so we have a book coming out to Android Hackers Handbook. It's already available on Amazon. Preorder a bunch of people smarter than I am. Collin Mulliner, Joshua Drake and stuff like that were gracious enough to have me help them out with the book. So check that out. It's really going to be good. And some of the stuff that we'll talk about in the book, there's really co
ol hardware section, which I which I helped out with. I'll talk about some of those techniques in this talk. So Stephen Lawler is a buddy of mine. We used to work together just paying homage to him. We do the Black Hat trainings together. So in this talk, what I'll do is I'll talk a little bit about how I discovered hardware hacking. I'm traditionally a software guy. I did a talk at Recon in 2011 called Hardware Hacking for Software People. And that that talks seem to really strike a chord with people in our community who are traditionally software people and need kind of a foothold into discovering hardware. And I know there's a lot of really smart hardware folks here. But for those of you who are like me, it's a really good introduction to some of these concepts. Then I'll talk a little bit about practical arm exploitation, which is the course we've been teaching. And then I'll talk about how we built our development environments for ARM, which is also a barrier to entry for people who are trying to do mobile exploitation and transition their skills to the mobile mobile environment. I'll talk a little bit about some interesting stuff from the core, specifically a wrap on the arm platform, some some of the neat stuff like stack flipping we might have to skip through. And then there's some really interesting side projects that that I mentioned earlier. So this is kind of how how did this all get started? I was a software guy who specializes in exploitation and reverse engineering software, but I was always really interested in hardware. I would see cool projects like this. I would read Hack a day, and I just really didn't have a way to get into it. So one of the first things I did was, and this is a little bit of stuff from the hardware hacking for software, people talk. I was really interested or really fascinated to learn that a lot of PCBs and a lot of chips speak standard serial protocols like I do CSPI, and that's kind of like how I got introduced to it because
 I'd use like RSA 02:32 and stuff like that, you know, connecting your win modems and stuff to your old PC to dial BVB's and issuing commands. So that was accessible to me, but I was really surprised to find out how many embedded systems made use of a lot of these serial protocols. So, so once I learned that I started finding these, these serial enabled enabled, I see a lot of consumer hardware. So I found them in analog to digital converters bus controllers. You probably. I'm sure you've heard about Charlie Miller and Chris Farley. Six car hacking stuff. Really, really great body of research there. Even though it is done hacking, it was a really cool. They did some really cool work there that wasn't necessarily serial. That was can. But again, we're just talking wireline protocols that you can intercept and look at the data and really have interesting results. So I focused on some of these like I2C and Spy, and I started finding these this stuff in routers. One interesting bit to some of you may already know, but VGA and HDMI cables have its pen, so there's actual serial pins inside of your VGA cable. So when you plug your monitor into your computer, there's a communication that happens over two designated pens and that's all on it, you see. And that's stuff like, I was like, Whoa, now this is stuff I can handle. You know, like this is this is serial data. And I found some debugging tools and stuff like that. There's a serial data that we can use to do kind of high level reverse engineering or wow. Who shook this up? What are you? Why don't you strip us up? Nice. That's right. Here we go. Q Flight of the Bumblebee. All right. This was going to explode to look at. Uh-Huh. It's because I'm black and then. All right. I'll see how you all do in Germany. All right, that's all right, thank you. It's good, it's only a MacBook Pro, sir. All right. If I don't slip and fall, it'll be good. Thank you, sir. All right. Big hand for that guy. Thank you for also shaking up the bo
ttle in the first place. All right. So I found these some interesting serial protocols down on these PCBs, and I started finding them in routers and stuff. And again, this is from harbor hacking for software people, which is a talk you can still get the video of online. But first thing I did was bust, open my cable modem at home and on my cable modem, and I set up this kind of little crappy rig, which I'll explain in a second. This is a Broadcom chipset, and all this little Broadcom I found for exposed cables, like for exposed pens. So I used a bunch of techniques which I go into detail on the other talk an oscilloscope to identify the pins and some basic pen reverse engineering techniques, which is basically just combinatorics and trial and error, and basically figured out that there was a you are waiting on those pins or a serial console. And from that, I could watch the thing booth. So it's an E costs real time operating system. And then so once we thought we got a little logs of it booting, we did a little fuzzing and then we got a crash. So we there's a built in HDTV server running embedded on the Broadcom for doing landing pages and things like that, or like internal redirections that the service provider would do on your modem. Like configure it this way, blah blah blah. So it was running this really crappy modem, and we made a get request with a really ridiculously long request string and it crashed. And so this isn't arm per se, it's MIPS, but this was my first foray into hardware hacking or software hacking enabled by hardware techniques. And so this was now this is familiar territory, right? I have a debug console, presumably a debug console. I got a crash. Now what do I do next? So this is kind of the impetus for all of this the last few years of research. So what we did was now that we know that this is possible, we can do things like fuzz hardware devices. We can find crashes. Now we need to start really learning about how embedded systems work. So we 
looked around a little bit. We didn't focus on MIPS. We chose ARM. And so we wanted to first set up our lab environment. So we mess around a little bit and we set up a kumu arm environment and kumu is is great to get started. It's really good because you can get comfortable with GDB and some of your your new tool chains and things like that. You can start doing some assembly coding. You can write some basic shell code and test harnesses and, you know, Test C programs. You can suck these binaries into IDA. You can start getting comfortable with arm assembly and stuff like that. And what we started to do was exactly that. So we we compiled the gene API tool chain. We ran it on Kumu. We started basically writing our own. If you guys are old school like me, you remember Gary as insecure programing examples. We basically did that for ARM. So we did StackOverflow as we did some basic stuff where we'd have to do return to live C. We learned it. We learned a lot about the protection mechanisms like Exxon and all that kind of stuff. So we did this all in keeping you all well and good, and then we wanted to move to like real hardware. So we looked around for a little while for developer systems that would kind of do this. And at the time, the Raspberry Pi. Woops, I think I'm just going to quote you guys want to just like grab a beer or something for the next 45 minutes. All right, there we go. So there's a lot of systems out there now. The Raspberry Pi, the Beagle board, Raspberry Pi, I think was like a Kickstarter project or something at the time it hadn't released yet. It was still kind of in its early stages, so we didn't use that. There's a few others out there, but eventually we looked around and we settled on the gum sticks platform. And it's used a lot. And like, you have systems like temperature control systems and it's basically just a small PC the size of a gum stick, hence the name gum sticks and it runs on a micro SD card. And there's a bunch of free comp. Linux d
istributions and stuff for it. So we just started off using one of the suggested ones using the landro chain tool chain, but eventually we kind of spun up our own and we got Linux running on these things. So here's how they look. The thumbsticks board is pretty small, and in it it seats via mezzanine connectors into an expansion board. You can get different types of expansion boards for it to get Ethernet and all that kind of stuff. But the core board is really small, as you can see compared to the rest of the stuff. So then we bought a bunch of these and we called this the lackluster hack cluster. So now what we've done is we've gone from a purely software emulated environment like qemu to hardware, and we can start doing some of these exercises on hardware. Right? So what we did is we had by this time we had like a whole bunch of notes on arm and all this other stuff. And so we decided, wait a minute, why don't we just give this to the community when we figure out how we can just bundle this stuff up and get people ramped up on arm exploitation and potentially owning mobiles? So we are we've kind of built this into a steady progression like Guerra's and secure programing examples. And so we started distributing some of these exercises to people kind of handing them out as crack meets or or own maze and stuff like that. And the word got out and then people started saying, Why don't you just roll this into a training? Do it at Black Hat? So I said, Well, we'd probably do that, but we don't really have a lot of Real-World exploitation experience. So we started doing a few contracts, so I did some stuff with some smart meters. We did embedded systems like point of sale systems and specifically mobile devices. Android, some Windows seven and some embedded Linux systems as well. So then now with that exploitation experience, what we did is all right now, we have real world exploitation experience. Let's roll this into a real course and that's what we did. So we built th
e practical arm exploitation course. It's basically three to five days, 900 slides, blah blah blah blah. And we teach you everything you need to know. So a bunch of people have taken it, and we did it, it can sack it, sold out in a week, we did it Black Hat, two years in a row, it's sold out in a couple of weeks. We've done private trainings. We did one in Tokyo, we did one at Switzerland. We did a workshop at Insomniac last year. But what does this all teach us? It teaches us that we're in the post-PC exploitation environment. Mobile devices, embedded systems are way more popular than the computer that you leave on your desk or on your couch. Right? It's always with you, with your pocket. So we're in the post-PC threatened environment. So these are just things to think about. If we're just as users are consumers of the technology. This is really there's an interest in this stuff. People want to know how to own mobiles. It's just something for you to think about. So the world is changing, as I mentioned, and I'll tell you a few interesting bits from our Rob course, from our ALM course, we did quite a bit of research on this stuff. And obviously, the big thing that you're going to want to know how to do for exploitation is return oriented programing. And for those of you unfamiliar, you need to do return oriented programing to evade modern protection or exploitation protection mechanisms such as Exxon or on operating systems like iOS code signing. You can't load binaries or execute binaries from another system. You have to use native code that already exists, so you need to figure out how to use bits of code that are already inside of the executable. For those of you are unfamiliar with ROP and the concept of Rob inadvisable, we had a really great analogy that that you came up with. I was living in New York at the time. We all used to hang out and we were having beers. And one of the girlfriends said, I think Brandon Dr. Reid, as he's known, was explaining rap to the
 girls, to the girlfriends. And one of the girls said, Oh, it's kind of like those old ransom letters you remember, like on the old motor she road days like, you know, the bad guy didn't want his handwriting to be recognized, so he would snip small pieces of newspaper clippings and magazines together to create a ransom note. That's essentially what Rob is using small bits of pieces of code to form a larger message or a larger functional executable that that does something that you want. So those small snippets of code are called gadgets. They're small bits of executable assembly code that exists somewhere in the process space of an executable, in this case on ARM. And the idea is that if you can do clever things with these small bits of code, you can string them together to do something malicious or something useful to use an attacker. So what we did is we we built a Linux distribution for our course and we settle on a specific version of Lipsy. And then we went gadget hunting inside of Lipsy. And I'll talk to you briefly about how we did some of that gadget hunting, but it's extremely boring and I can see some of your already glazing over. But I'll go into a bit of how that's done, but if you want to learn more about it, there's plenty of stuff on the web. So essentially what we do is we search through Lipsy. We found a bunch of gadgets and then we built a library for you to quickly build your payloads from. So there's a bunch of different bunch of different gadgets that we found, but this is an example of interesting rock gadget. This one that lives down in Lipsy and this is on our Linux distribution at nine one eight DC. And essentially this gadget, all it does is pop out zero hour, one hour or two hour, three hour, 12 and LR. So it removes those values off the stack and then it branches to R12. And so for those of you unfamiliar with Rob, essentially all of this instruction does is it removes things from the stack and loads them into registers and then begins ex
ecuting at one of the registered that it loads off the stack. So essentially what we're doing is we're just putting a bunch of values onto the stack through a Stack Overflow or something like that and then using gadgets like this to call functions. And we call this gadget the function called gadget, and it's kind of the one that the entire course hinges around. So this is the this is the kind of stuff that we teach and of course, how to go hunt for gadgets we use it to to call interesting functions like protect change, the phrase permissions to circumvent certain exploitation protection mechanisms. We also use its call functions like IMAP and copy, and I would go into a lot more detail about this, but I have a bunch more slides to go into and I don't want to bore you all. And again, this is just more stuff on on Rob. If you if you want to check out these slides we have them on, don't stuff things up your nose that come. The huge take away from Rob is that basically because you're piecing together small bits of usable code or small small bits of executable code to to do a larger function, it becomes really convoluted. And so this is an example of us simply trying to move one value our six or the value inside of a register are six to one without changing another register. And so this just the act of moving one value between two registers from one register to another without changing another register took 14 steps and through methods of interaction, we had the right values into memory. We had to use techniques called staggered memory, where we write these values into memory and then load these bottom three values out of memory. It becomes really convoluted, and this is the challenge of Rob. And this is where the bar is for exploitation, specifically on arm and mobile devices. That's the huge take away. So this is, again, some more rough stuff, this is how we build rob gadgets. And this is essentially a representation of the stack. If you start up on the top left, we ha
ve the address of a wrap gadget, which is that function called gadget pop r zero hour, three hour, 12 hour LRB, XL, LR and roethke. These raw payloads are essentially just addresses on the stack. That's all we're doing is we're just putting addresses onto the stack and then somehow kicking off our up rob chain, depending on what the vulnerability of the nature of the vulnerability is. So it's hard, it's error prone. It's very difficult. So what we did for the course is we built a Python script, which has the address annotations about the Rob gadgets and we built it on to a builder. So you just like drop into the Seelye and you can build your payloads with a few simple commands. And and we think this is very useful because it allows you to access the the concepts without really digging into the details of how ROP works and stuff. And if you want to, you can. So a little bit about ARM. ARM has a few different instruction modes, and this is one of the key things that we also want people to take away from our talks and our research. ARM arm processors have to most of our mode, which is a 32 bit instruction mode, and they have some mode, which is a 16 bit instruction mode and they actually have a few other instruction modes. There's this old one called Thumb IEEE, which has special instructions to enter small bits of code. But this mode of execution is specifically for processors to execute jetted code code that's generated by Git. There's also a deprecated instruction mode called Jaisal, and that was arm processors could actually execute Native Java code, which is really scary, right? But they could do it for a little while. I think this was deprecated and ARM V7 or something like that, but these processors could do it, and it was a feature originally designed for old feature phones. If you remember, like prior to smartphones, there was a lot of Java J2, HMI and stuff like that running on phones, so it was built into the processor that it could do this stuff. But the ke
y takeaway, though we want people to know, is that even though ROP is hard right or rough, it's not hard. It's indirect and it takes a lot more work. We have these different instruction modes. We have our mode, we have some mode, you have these weird, these really bizarre instruction modes. And one of the interesting things about that. And remember Rob, the idea with Rob is that we're using bits of code that already are in the process. We're trying to exploit what we can use, the fact that these processors have different instruction modes. To actually find more Rob gadgets, so this is one of the examples that of the course, so one of the gadgets we use is a pop R zero R two PC. And what this does is it removes a value from the stack and puts it in R zero for most value from the stack puts in in order to remove the value from the stack and puts it in PC pieces like IP on x86. It's the it's the instruction pointer. It points to the next thing the process is going to execute. So using that, we can actually redirect execution. We can pop a value out of our zero or two. And the key thing about R zero on R2 is that there used as parameters to a function. So this is a really great gadget for calling a function. You pop out zero R two and then tell it where to go by popping PC. So we really we've been using pop r zero r to PC, but we don't see it anywhere in there in the disassembly, right? And the reason is because we're just assembling and 32 bit arm mode. If we disassemble small, if we take the same region of memory and we disassemble it, starting at three eight five zero C, we get ftf seven zero five b d. I don't know if you can see that between the two lines. And if we reinterpret that as thumb mode, we get a pop out 0r two PC. So what happens is is that where pieces of code are supposed to run is 32 bit code. We can, using a few tricks, tell the processor, execute this as a different instruction mode, use the same instructions, but execute as a different instruction m
ode and you can find extra gadgets. So this is a key thing about arm. So on your mobile platforms, on your mobile devices, even though ROP is difficult, it's actually a little bit easier because these processors have different instruction modes. So we teach them other tricks also, we just basic stuff like when you're doing exploitation places to write stuff like really extra scratch space. This is a really cool technique is using the deltas between sections and the executable. You can write there because nothing in the program will be addressed to places outside the inside the delta between the pages. These are really specific techniques, but we go into them in great detail and you can also learn about them by downloading the slide deck or checking out or talk. We also go into stack overflows and how to bypass the Zen. Basically, at the beginning of our course, you can know absolutely nothing about exploitation with a little bit of experience using Linux and Python and some assembly code. And by the end of the course, you'll be bypassing all the modern protection mechanisms on Linux. So we we talk about stack pivots. This is again George, which who, who's also an author of the Android Hacker's Handbook, explained, We call them pivots and he's German, and he had an accent. He called them pirates. So we pay homage to him with this by calling this technique pirates. And this is a really interesting technique, and it's really simple and people do it on x86 all the time. If you're familiar with with x86 exploitation, that idea essentially to if you have a raw payload that you've built and you want to and it's exists on Maheep, how do you get the stack to point into the heap? And the idea is that you find an instruction that basically tells the stack pointer to point somewhere into the heap and we call that pivoting. So that's just a technique to again evade some sun protection mechanisms. Going to flip through some of this stuff. Ignore the book Haki. That's what we call
 heap spray for those exploiters in the audience. Appreciate that. I want to talk about some of the other stuff, too the hardware specific stuff skipping through the arm exploitation stuff, which you can you can find out later. This is my company exhibitor, and this is really kind of more of a slide show. This is more of a memoir of some of the stuff I've been doing in the last year or so. And so one of the first things that I wanted to do was learn how to interface the buggers with hardware. I showed you the example where we're using uart to get stuff that was sent by the application. Maybe like that you are was tied to the air or something like that, and they were printing debug messages. But maybe we want a way to actually debug the processor. So, of course, JTG, everyone says Jack, Jack, just jack that. And I was thinking as this coming from the software world. Oh, Jack might just be a way to get the way to debug hardware. It's just going to be let me plug GDB into a chip and watch the chips going. I can read registers and do stuff like that. It's not a silver bullet. Every manufacturer, every chip, they do it a little bit different. And there's many different geotag adapters and each geotag adapter needs to have understand the wireline protocol and the serial protocol that's spoken over Jay Tag, which is another common misconception. People think Jay Tag is the debug mechanism. It's actually not. There's actually a small piece of the JTG specification for debugging, but one of the first things that I realize is that there was this huge misconception about Jay Tag. So my first foray into this, I got something called the Jay Link, which is a debugger, and I used it on this Dolores arm development kit, which you can get for about 90 bucks. It comes with a preloaded bare metal image, which means that there's no operating system. There's just a single executable running on the chip and then you get these headers and you can just literally plug the link adapter into 
the into the hardware. And then it plugs in the jailing plugs in over USB to your computer, and then you can you can use GDB or they're debugging interface to to talk to the software. Again, this is another shot of the J Link. This is another cool thing. Ralph Philip Wyman has a really awesome paper. It's actually one of my favorite papers right now on the on the baseband exploitation I'm sure you guys have heard about. If you haven't, definitely look up Ralph Philip Weinman anyway. In his paper at the very beginning, he talks about how to use an Android One, and he was able to tag debug the baseband processor. Cell phones have two processors, application processor and baseband processor. So I found a Polish company called Multicam GCPL, and they made the special adapter that fit the Android G1, and it gave me geotag access to the Android G1. You also will run into cases where you have this is again, this is kind of like slideshow memoir stuff here. You'll get cases where you'll see a connector that you suspect is probably has. You are or J tag or something like that on it, but you won't know how to get access to it. And this is an example. This is something called. This is from a specific project I worked on where I had no idea how to interface with this thing. I knew for a fact that had J Tag. I knew for a fact. There's probably going to be uart on it based on the way it was positioned next to the board, but I didn't know what kind of connector that was. And so this is the kind of stuff you do, you know, spending hours, trolling manufacturers, parts of lists and Googling serial numbers, and eventually I found this customized Rolex part. It turns out these things are called mezzanine connectors, but this mezzanine connector is something called SSD if you're not. Does anyone know what else AMD is? Yeah. It's called surface mount, so surface mount format is basically something that sticks onto a PCB and it has a like very small pins is basically meant to be machine a
ssembled by something called a pick and place machine. It's a little robot that uses a file called a centroid that knows the coordinates of where things belong on a PCB. So the robot puts it down, applies a very miniscule amount of solder and applies here to it. And that's how circuits get bonded to PCBs. So this study here is a surface mount. It's not meant for, you know, guys with big, clumsy hands like myself to interface with. So how was I going to get this Model X connector connected to that thing? So these are just some of the tricks you come up with. This is a this is a smart board, and it's just the PCB made by some, some guy. And like the Wahoo, Nebraska or something, he just makes these little boards that are they're basically breakout boards for many different types of SMG components. And what you can do is attach your small component to the inner part of the board. And then you see there's these horizontal lines there. You can just attach this that the slightest bit of the tip of a of a soldering iron, and it'll liquefy everything in the same horizontal line so you can place the chip that you want. Touch your soldering iron over on the side and it'll liquefy and it'll bind the parts to the board. But then the nice thing is is that those leads also connect out to jumpers, where you can then plug your pins in and start to do stuff. So in this one particular case, I had that unknown connector. I found the meeting part, ordered it from Rolex, bonded it to this smart board and got something like that and took lots of notes and eventually had this huge monstrosity where I was able to connect underneath. That is the maiden connector. And on the other side, I soldered headers, and from this I can go back into my DJ link. And in the end of the day, I had debug connection to this point of sale system. So these are just the kind of tricks you come up with. Hardware hacking is a lot of arts and crafts. It's a lot of stuff that you don't think is going to be applicab
le. But then at the end of the day, you get debugger access, command line, debugger access, which is really awesome. So so we can get debugger access to stuff we see we we see we can access yards and stuff like that. Now what? So maybe one of the things we want to do is pull the firmware out of a thing, and this was illuminating for me. I was working with electrical engineer. I'd never pulled firmware from a device before, and he really kind of showed me the ropes. So you'll see some photos of him in here. So this guy, Chris, we looked at the schematics for the board. The manufacturer was nice enough to give us schematics. And so we narrowed these pins down to, you know, to the chips that we wanted to target. We found the traces we want. Sometimes you get these schematics on hardware, reverse engineering products, sometimes you don't. And when you don't, you've got to pull the firmware. So how do you do it? So in this particular case, and this is a bit of information here about how this is done. Remember, I said some key components are bonded to the board with small bits of Sadr, right? And Sadr is just liquid metal. Basically, once you heat it up, it liquefies. So how do you get pieces like that off the board? Well, they have something called chip quick and chip quick is basically an alloy also, but it has a higher melting temperature. And so what we did here is we melted this chip quick stuff onto the pins that attached the the component to the board. And so what we can do is we can liquefy the hotter alloy or the stronger alloy. It transfers heat to the solder underneath. And because it has a higher liquefying temperature, it keeps the solder hotter longer, keeps it liquified and gives you enough time to pull the components away from the board. So, so we did that for this small nand chip here. Excuse me? And so now you see it, now, you don't it, you pull the chip off the board and it looks like this. You got to clean off the the chip quick and the and the alloy. 
And this is Chris meticulously doing that with a soldering iron and a heat gun and something to straighten out the pins. And eventually you'll get something like that. So now we got the chip free. So what do we do? So I called Travis Goodspeed. I asked him, How do you know? How can I read something? Is there a universal reader or flash program or something? And he recommended a device called the XL Tech the XL Tech 5000. It's a pretty high ticket, high priced item, but if you have a contract or something, you can justify the expense. And so what Chris did and I did was we got the right adapter cable for the adapter set for it slotted the chip in. And looks like so we plugged it into the Zetec cell tech immediately identified the chip as an STM 32 arm core. And now we're seeing the tie in, right? We can do arm exploitation. We're attacking an arm core. Now we're getting convergence right. We're using these hardware techniques to attack embedded devices, so we're able to pull the firmware. And once we pull the firmware, we can suck this thing into IDA. Sometimes you'll get a bare metal image like a single executable that's doing direct. I own the pins. Sometimes you'll get many file system images like a cramp fest or something like that. Then you'll have to use something like Ben Walk to slice up the binary file and figure out what part is the file system, what parts the bootable image of the kernel. You're going to have to fight with it a lot, and there's a lot of how how tos out there for how to carve up certain executable types and we're actually going to be releasing in 2014. This is kind of pre information, a hardware hacking course where you will pull firmware images, learn how to load them into IDA and do some basic arm exploitation on them. We're hoping to release that this year at Black Hat. If not, a Black Hat will definitely do it. One of the smaller community events doing that with a guy named Joe Fitzpatrick, he's a really awesome hardware hacker that spe
nt about a decade at Intel. So, you know, keep keep your eye out for that. It's real world hardware hacking. We're going to introduce that, of course, later this year. So what's some other stuff we might want to do? Let's build some hardware interfaces. So we had a device that spoke to 30 pin cable and EOS cable. And this is another one. So we found this device called a pod gizmo. You might have seen stuff on USSR's tweets about building these debug cables and things for iPhones and stuff. You use the iPod gizmo. And it's basically just a 30 pin cable that gives you these headers. You get these breakout headers. All you can do is take these pod gizmos if you have a receptacle or plug side. And then this one particular case we just wanted to build a tab, so we connected the receptacle one side. We connected the plug on the other side and then we made a receptacle in between. And the idea is that we're going to be intercepting data on the bus. So we're going to be intercepting serial data across a 30 pin dock connector. You take meticulous notes when you're doing all this kinds of stuff. I'm pretty ghetto. I just use a continuity connector for a lot of this beeps. If you connect two pins together, you can figure out if you have a direct connection. I'll come back to this a minute because we're going to Segway into talking about the face dancer in just a moment, which is Travis Goolsbee's awesome USB debugging tool, but some of the other stuff you might want to do is build custom power interfaces. What I do for this is just hacking together, basically splice cables. And then I use this lab power supply. The B.K. precision, which is a really nice, low cost lab. Power supply lets you vary the average and the voltage to specifically power devices. Sometimes you might be pulling components away. You want to individually power a small chip or something. The B.K. precision is perfect for that. So I mentioned before that we're going to be sniffing stuff on the USB port. So Tr
avis good speeds device is awesome for just some sniffy type things, but it's really good for simulating traffic like creating traffic. And that way it's a unique tool. But the The Beagle 5000, which is created by a company named Total Phase, which also created the sniffers that Charlie Miller and Dino dies over use for the car hacking stuff. They create some really great debugging interfaces, and this is their full speed. This is two of their devices, actually a full speed USB device, USB sniffer, and essentially what it does is you plug a device into the front, you plug the thing the device was supposed to plug into. Also into the front there is the host and then out the back end, it gives you a cable that plugs into your computer and then you use like they're really custom Wireshark style interface to intercept traffic. Are we are we good on time? Yeah, OK. All right. So I feel like I might be born a little bit here, so let's let's quickly jump forward and talk about how we can spy on these communications. So I mentioned before I built this custom device to tap into this specific piece of hardware. And in the hardware hacking for software, people talk. I go into a little bit how you can use Oscilloscope and things like that to to to view some data. But I want to specifically talk about this USB sniffer so we can get on to talking about Travis is really cool to 15 minutes. All right. So this this total phase device, it looks kind of like this. You remember we built the the dock connector way back here. Right there. Right, so we built this really cool tab. We know there's going to be USB stuff across that cable. How do we listen to it? So we're going to use this device called the total phase. And we'll plug the total phase into our really hacked cable, and the great thing about the total phase devices that they have a breakout cable that comes with it. So you just plug it into their interface and it breaks out into these little header pins and you can. And when you
 plug it all in, you get a really, really great representation of what's happening on the USB bus. So we have ways to sniff, right? We have tools like the total phase. We have tools like the face dancer. So we have ways to sniff and intercept the data. How do we attack the data? We also have the firmware image right. We can debug the processor. Now, let's start putting stuff into the device. So we've got like our Jaelan connected there. We can use GDB through another two, our rule called PFI, which is the port for it, so you can push it forward and have GB running and attacking and debugging the device so we can build custom Python interfaces to to generate traffic. But what device can we use to to actually attack these things? So one of the great devices that we can use its slide is a little out of water. I apologize. We can use the face to answer, and I'll go into that in a second. But one of the key things that you get from attacking low level devices is you get crashes, right? Like before I told you, I was the built in HP server and we got a crash on the You are. Well, if we can fudge stuff like on the USB bus, we'll also get crashes. We'll be able to observe them through our debugging interfaces. And lots and lots of devices will implement their own USB stacks and their own USB-C protocol extensions and things like that in bare hardware. And you can find a lot of really juicy bugs if you can just tool up enough with the hardware to begin investigating that attack surface. One specific everything's iOS compatible now. Everyone wants to talk to an iPhone, so you get a lot of devices that will have their own implementation of the iOS stack. That stem 32 chip that I showed you earlier when I got the Jay Leno interface and it said, Hey, this is an STM 30 to the one, we ripped the firmware out of these devices to these OEMs that to create them. And in fact, the create the devices will also build libraries to implement some of this stuff, so they implement their own U
SB stack. Sometimes they'll implement the EOS stack for you and give you libraries to use to do that. And this one manufacturer, in fact, does they call it the IAP libraries? So this is the EOS see implementation that they recommend for the STM 32 devices. So when you start phasing via USB, you're going to find crashes inside of their EOS inside of their IAP libraries and stuff. So skipping forward. So how do we inject a lot of this stuff? How do we start beginning investigating USB devices? The de facto tool is Travis good speeds face to. It was the face dancer 10. The Face Dancer 11. A bunch of community people contributed and made some modifications and we got the face dancer. Twenty one for the longest time. This required assembly, and if you're like me and you're new to hardware, assembly is basically a barrier to entry that's extremely hard to overcome, right? You just want to sit down. You're used to Python. You're used to the buggers. You want to just start using a tool. So to address this for the community, we got the idea to start something called in three dot cc. If you go to the website three Dot CC, you can. It's basically a community driven web store for information security related tools, and the one we want it to start with was the face dancer. And the basic idea is that I, my company, acceptor and people who are working with me front the cost of manufacturing, assembly, shipping and fulfillment. So if you come to me with a cool project and you need help getting it to the masses or getting it to conferences like CCC, we'll basically pay for manufacturing. And so what we did this with was the face dancer. Twenty. You can buy them now. We'll have them shipped to you within and within a few days. And since we opened the store in July, we've sold hundreds of these things, mostly international from the US. Thank you. Thank you. So this is an example of slightly modified face dancer. This is an accepted or modified face dancer 21. You can see Travis name s
till there, but it's basically the same device. This is the web store and three dot CC. And where we launched, we've launched a few other simple products. This was one called the USB condom, and essentially it's a USB connection that has the data pins chopped off. So if you want to charge your cell phone without, you know, the fear of data sinking, you can use a USB condom. I made it mostly as a joke has to do free giveaways at conferences and talks and stuff. And there was a media frenzy around it. WNBC picked it up wired. Everyone picked the story up and it was for sale on in three points. We got 1.2 million hits in the first weekend, The Verge. It was on Slashdot news and a bunch of places. And so there's another project which is also in the talk description that we're running out of time for. But it's a hardware device that we're also selling on in three. And we also hope to have the community backs will maybe launch a Kickstarter project for it later this year, and it's a device called the Osprey. And the idea is that Osprey is going to be a hardware device. It's basically Metasploit for hardware. So if you want to do bust pirate stuff, if you want to do glitching, you basically download a firmware image, flash it over USB and buy the appropriate modules and you can do whatever it is you're trying to do. So the Osprey is actually for researchers. This is a tool that I want to get in the hands of researchers within the next year or so. And the idea is that if you know enough about the firmware, I know enough about the device to help me develop firmware images for it. Great, if not. And you just want to use a different firmware images, kind of like Metasploit, you can be just a user also. But the problem is, is that manufacturing costs are really high. And so the idea behind this and we don't know if it's going to be successful yet is to launch it as a consumer product. So the idea is that I want to create this product that's called Tarly. And essentially, the de
vice is used to monitor your your home. And so built into these these boards is a small chip that's capable of speaking Zigbee in these low power RF, which people like us can use to attack low power RF networks. But functionally, to most consumers, what this device is is a way to monitor the world around them. So you can take a tally device, you can hang it on your door, you can take a tablet device, you can put it in your dog, can own it or monitor the temperature. And all devices will communicate via Zigbee or simplicity as it's being prototyped now. They'll speak RF to each other, monitor the world around them and if any events occur, like if you want to know if someone came into your hotel room while you're out of the conference, you can hang a tally sensor on the door and in a log that information's internally to an MSI card, which will then be either transmitted via Bluetooth or USB to your cell phone. And there's an app running on your cell phone that I've written for Android that receives all the log data from your talay device. And the idea is that this will be really low cost 20 bucks a sensor. You can expand your RF network and then if you're a researcher, you can be using the different firmware images to do things like glitching or attacking low power RF networks and stuff. But to consumers, they think they're getting a consumer product. And for us, we have the consumers subsidize the research tool, right? So that's that's the dream. And hopefully later this year, if you follow, you can sign up on the website and help support the idea. And if you are interested in helping develop for it, that would be great too. But right now you can just sign up on the mailing list and we'll probably launch the Kickstarter later this year or something. Or we'll figure out a way to do it as a community. But right now, I just want to use this as an opportunity to open a dialog with folks like yourself. So, Project Ospreay, so what are some of the things we want to do? It'
s got on board from and micro SD for storage. We can use it for attacking RF networks, or we can use it for RF capability. So low power, low cost, low power we can do serial interfaces, go to FTD eyes on it to speak a cereal to to your computer. It's got an expandable mezzanine, which are those connectors along the side, and I manufacture a small breadboard so you can do. Prototyping on the bread board slotted into the bore into the board and then update the firmware image and boom. You've got a whole new device. There's the device there, some closer pictures of it. You can see the mezzanine along the top. And these are the devices communicating with each other. It's also powered on consumer batteries to Triple-A batteries, which is cool. There's a plug into an Android device, and so that's the idea. That's the dream. Ospreys Osprey is Ospreay for us, the researchers and its tally to the consumer market, and hopefully we can have them pay for really awesome research tools for us. Some other really cool side features, we can use this thing for kind of bus pirate functionality or a good fit style functionality not to replace Travis's awesome tool, but we can use it for that kind of thing. We can do it for simple glitching attacks, attacking low power RF networks and some other neat interfaces. That's got a Tag Connect programing interface so we can plug our computers into it and debug it using a really cool debugging interface. Those are the mezzanine connectors I mentioned. Those are the two antennas right there. Those are the two antennas. So there's one smart connector and there's one built in what's called a ceramic antenna. So if you want to attach a stronger antenna, you can screw it into the board. If not, you can use the the permanent ceramic that's on board. Those are two USB connectors. We've got an FTI. The newer version has two extra eyes on it, and that's basically it. And like I said, in terms of milestones, basically you want to figure out how to get th
is to the consumer market, maybe do a Kickstarter or something and start doing first production runs and getting these two people in our community to do kind of community driven development. Figure out ways that people want to use it to all of the features around it and then have the consumer subsidize it for us. So conclusions and takeaways I know is a lot of stuff, there's a lot of hardware, embedded hacking tools and techniques, arm exploitation. Basically, what I want you to know is if I can figure out how to do this stuff without having known anything or gotten any degree, it's very assessable to you. If you know, if you're smart enough to write software, you're smart enough to learn about hardware because hardware is simpler than software. And what's really great is that through community endeavors like CCC and things like that, we can all band together and start to really build some awesome tools. Die and crack is an also example. The face dancer is a great example. And we're really stepping into a new world of really awesome embedded security and really custom embedded devices made by us, the community. And that's basically it. That's all I have. And these are some URLs you may want and thank you very much for listening and hopefully can make it happen. Steven, thanks for the talk. We have some time for questions. Please try to not so much up but line up behind the microphones. And while we while you do that, we have a question from our signal angel. Yeah, maybe it's just a short one. So the chip will use the chip quick on why didn't you access the G8X interface directly? Why did you sold off? Oh, in that case, you can hear me. Yeah, I don't know. Where are you? Whereas who's speaking? He made me up here. There you go. All right. Yeah. In that particular case, there was no. Usually they have things like test points on the PCB where you can like sort of a header or something. They had nothing. There was this small PCB real estate. So there's nothing we could 
really connect to. We could have probably gone in through the top and like soldered pins individually, but it's the same game basically, or manually sorting pens is just easy to pull it off, and you can sacrifice one board, weaponize an attack and then use it on other things like if it's, you know, a mass, a mass consumer product, you just sacrifice one and use it to attack multiple. So, OK, thank you. OK. Could you be a little bit more quiet while leaving and entering? It's hard to do a Q&A session with so much people talking, and there's a question on microphone two, please. Yeah. Hello. OK, so let's have a question with just a couple of suggestions from my own experience the in regards to what the gentleman was just saying about, like why is this harder? And I just use a JPEG. Know you're talking about with JPEG. There's a at a kind. A couple of weeks ago and the guy gave a presentation, I think called the tabulator. Yeah, that's awesome. Which is like a bus pirate. No, it's for J Tag. Yeah, so definitely check that out. I've got one. It's awesome. Also, the XL Tech 5000 is really expensive, and either fruit sells a carrier. They don't have the software, they don't have the programmer. So it's it's just the carrier, but it's like a carrier for for the for the for the chips. So and then it breaks it out and breaks it on until like point one pins. So and that's like 50 bucks instead of fifteen hundred. Yeah. So and that was basically it. Thanks. Cool. Yeah. Now the J Tabulate is great in the Android Hacker's handbook. We have a little bit about the G tabulator. For those who are unfamiliar, J tabulator is basically a way to brute force debugging pens. So if you have a tag interface, it isn't identified with a silk screen like you don't know what pens do. What you may have five or six or seven or eight pens sticking out of the board with a g tabulator does is. It lets you attach to all those pens and then it does all the math, the combinatorics and tests each pen an
d tells you, OK, that one is to go that one's tie, that one's power, that one's plus five volts. So yes, that j tabulator is awesome. And it's Joe Grand's tool. It's a great, it's a great tool. It's pink, but it's great. It's really cool. OK, for all those leaving the room right now, I would like to ask you to not only convert all the chairs that have been used as a table, now back to a chair, and please also take your trust with you. Are there any more questions? All right. No. So thanks a lot. Please take your trust with you when you are leaving.