Hello, DEF CON 18, how are we doing? Well, hopefully y'all will be able to tolerate three hours of Arduino goodness since the last two presentations had some things to do with Arduino-based development environments as well. My particular talk is on what I like to call the programmable hid USB keyboard mouse dongle for pen testing. And if you want more information, all right, how about this? All right, guys, hopefully I'll remember to keep this this close so y'all can hear me waving in the back especially. If you want more information on this project, it's up on that very Google index friendly URL but very untyping friendly. The slides that are currently on your CD are rather old but I will have these slides posted on my website relatively shortly. First of all, a few special thanks. Thanks to Tenacity Solutions for helping finance the project and for helping get me here. Kentucky Anna ISSA for also helping to get me here. And of course PJRC for giving me some extra promotional materials and sending me some free hardware to start work on this project. If anybody wants any of their little flyers on how the 10C is built and what the pin out is, come see me afterwards. First of all, a little bit about me. My name is Adrian Crenshaw. I'm a senior at INFOSEC. I run a website called irongeek.com. . Thank you. Also a regular on the INFOSEC daily podcast, isdpodcast.com. I'm on there usually every Thursday. Slogan for my website is Lifting Dumbbells in the Gym, Supporting Them at Work. And I have an interest in Infosec Education. One of my main goals is basically become a Professor of sorts that goes around and teaches people about computer security. Now I don't know everything. I'm just a geek with extra time on my hands. While some people might be sitting around playing solitaire, I like to, well, sit around and play desktop tower defense and write security articles, make security videos, do research and so forth. Now there's many things which I'm a noob on. But I have this theory that it takes a noob to teach a noob sometimes. For instance, people who have been doing computer security or any technical subject for years and years and years might take for granted what the student would know. For instance, I found this most of all when I was teaching a C106 class, which is like intro to computing. And I saw someone grab a mouse like this and try to use it. And I never thought to explain to them how to use a mouse. I also saw this one lady, she learned how to actually use the mouse backwards. And she got proficient with it. So if it works for her, that's all fine and good. But, you know, for instance, explaining, you might take for granted if you're really familiar with C that people would automatically know they have to initialize whatever variables they create. You know, stuff like that. So sometimes it takes a noob to teach a noob, which is one of the things my website specialized in. First of all, before I really get on to the meat of this talk, I want to give you a little bit of a story about how I got started on this project. I was giving a fireside talk called, I think it's Skinny Baiting and Funny Pots, basically with how to screw with attackers, where I was at ShmooCon initiative. And I was giving a speakers gift and it was this little thing called a phantom keystroker. You plug it in, it does annoying stuff like type random characters, move the mouse around, jiggles it, turns caps lock on and off. Just things to annoy. It was meant to be a prank. But it started me thinking, what could I do if I could program this bad boy? So I started looking around for something to program. But the first thing I did was I was there and there was a couple other people roaming around ShmooCon with me. Well, I had known that a guy named Darren Kitchen from Hack Five. He had done a lot of work with U3 thumb drives, which you plug in and one part of the drive looks like a CD and you can use the auto run functionality to automatically fire off a payload. Well, a lot of people now are getting smart with that and they're turning off auto run. So I was thinking, well, what if I could do this little keyboard dongle that you plug in and it automatically starts sending keystrokes to do much of the same thing. So I brought the idea to Darren and he was kind of trying to figure out how to do it. He took me outside of Aden. We're kind of already working on that. But then they were going to send me some demo stuff to look at. But I got impatient. So I started looking around for how to build one myself. And actually, we came across the exact same chip, the 10C, which I'll talk more about in a second. Also, Robin Wood was involved in the project. I don't know if you all know Robin Wood, but he does a lot of really cool coding projects. Great guy. Definitely go out and check his work. And if you ever get a chance to see some of the work he's done on using social networks for botnet command and control, interesting stuff. There are little things called the rubber ducky. And they actually have a forum out there for extra information. If you want more information on using these kind of devices on Macintoshes, definitely a good place to go. Okay. Playing with the idea. For those that didn't want to wait for them to get a product out, I decided to, you know, for those that, as I like to say, go ugly early, I decided to put out some notes on how to basically build one of these devices and they will act as a keyboard and mouse that you can program. Free notes. I'm new to microcontrollers. I suck at soldering. Or at least I did a few months ago. I've gotten better. Or as I used to say, I used to, when I soldered, I was like an epileptic alcoholic with DTs soldering with an aluminum baseball bat. I'm not particularly, like I said, I'm still not great. There's a guy named Scott Malton. You may have seen some of his talks. I was in a Fry's with him. And I was like, I need to get better at soldering. I kind of suck. It doesn't look good. The joints are bad. And he was like showing me all this really expensive equipment. And I was like, I need to get better at soldering. I kind of suck. I need to buy. And if you're a guy like him who replaces, you know, hard drive controller boards and do surface mount soldering, you really need that stuff. But I'm dirt cheap. So, you know, I went with what I could find. Oh, I apparently suck at rotary tools as you'll see in some of my packaging pictures. Okay. Let's go into why you might want a programmable head USB keyboard dongle. First of all, it's likely going to be a type a lot faster than you can without errors. So, you know, instead of going up behind someone's machine and start typing, you can just like plug this in surreptitiously in the back of the machine and have it do the commands you want to like maybe add an account or whatnot. It works even if U3 auto run is turned off. Most everybody, I played with, if you plug in a HID device, that's human interface device, like a keyboard or mouse, it automatically installs and goes. It draws a lot less attention, like I was saying before, than sitting down in front of the terminal to type in your commands. It's a little bit complicated. Just plug it in and once it enumerates all the USB devices, installs it, it's good to go. Also, you can set it to go off on a timer. For instance, if I had a professor I knew, you know, and I could get access to the machine during the day, I could plug this in, I know eight hours it will be logged in, have it do something in eight hours. Just set it off to go on a timer. Or a better example would be if you know the admin is going to be in and you're on a physical test, with permission, and you know the admin is going to be logged into the box in eight hours, plug this thing in the back, have it set to go off in eight hours, do your thing, add your account and do what you need to do. Or a ton of other different payloads. I'm going to show you some payloads here in a bit. Just use your imagination on all the different ways you could use one of these sorts of devices. Okay. What sort of commands would you want to use? Well, I would suggest have it automatically add a user for you. That could be useful. Run any old program. For instance, you can't get Autorun to work, but you can use this along with some storage built into the device to fire off any old script or EXE that you have off of the storage. No problem. So basically you can get around the whole Autorun being disabled and still have very much like U3 thumb drive functionality. Copy files to your thumb drive for later retrieval. It's like I have a payload, you plug it in and it copies everything on the desktop to onboard storage so you can pause that stuff, look at it later. Possibly dump password hashes or whatnot. Look at the current U3 payloads that are out there for further ideas on what you can do with this tech. Upload local files. If you don't want to use onboard storage, you could script it to where it automatically opens up a web browser and goes out to your site and starts uploading certain files off the system. Download and install apps, fairly obvious. And something you can do is something that's kind of akin to cross-site request forgery, but you can do that with a lot of people, but not quite. Essentially how many people here when they hit a website say, yes, remember me, stay logged in? You lying bastards. Crap. I have no idea why that just closed on me. Hold on just a second, too. We got some small issues. Not that I recall. We have blue screen. . . Fly out. Well, most of my payloads for this are for Windows. And quite frankly, usually when I'm going to be targeting a system, it's going to be a Windows system. So. That's why it's all targeting Windows. So I guess in the meantime, I'll do my best karaoke while I'm up here waiting for my machine to restart. . . See, I've had problems with live demos before. But generally the slides work. But this has even happened to Bill Gates, so, you know. . Okay. Don't worry, I'll have this functional very shortly. Give it to me. By the way, they were talking a little bit ago about fuzzing USB drivers and so forth. I'm pretty sure that's part of what happened to me there. If you see a blue screen like that, you have to wonder if a USB device is causing that, if you can get that kind of memory corruption to cause it to crash, can you cause it to do something else? That's something we'll have to do a little more looking into later. Anyway, cross site request forgery. You might be familiar with that where you put some code on a website that automatically make a request on a different website that the person stayed logged in for because they just chose, yeah, save this cookie and I want to stay logged into this service. So this isn't quite cross site request forgery but essentially you leave the device in and if you know they stayed logged into Facebook or their bank account or what not, have it automatically make a transaction on that particular service to do whatever little evil task your heart desires. And my heart desires a whole lot of evil tasks. All right. A few other ideas I had. Embed a hub and storage for better packaging. And essentially this mouse I had plugged in a second ago, I think everybody saw it iterating through different colors, essentially I've embedded in one of my little 10C devices that's programmed to act as a keyboard and mouse, onboard storage and a hub. So it's all in one unit. You plug it in and now everything functions. And I can give this to someone as a gift and say hey, here's this really cool mouse that changes colors back and forth whenever you use it. And actually I'm going to show that real quick. And essentially it just sits there and iterates through the colors. But I'll show the payload it does here in a bit. I'll show it now in a few seconds. I'll show it now but I'm afraid of another blue screen. Okay. Leave it around and some people have mentioned this before. I believe they call it road apples. Leave it around as a thumb drive package hoping unsuspecting users will plug it in. Trojan hardware. Use a time or a sensor and embed it in a gift device. There's also these little USB QB toys. Maybe you all have seen something called a NASPAC. It's like a little bunny rabbit that glows different colors if you have e-mail or some message waiting for you. What is that? The humping dogs. Yes. The dogs that hump your USB port. They make your USB port literally. Yes. Those would be another good example of cubicle toys. But think of all the USB devices you have laying around that have extra space in them already. As you can see I jammed one in a mouse. I think my buddy Dave jammed one in a keyboard. So there's all sorts of possibilities there. You can can have it wake up, mount the onboard storage and have the program do whatever you want. If it happens to fake a blue screen of dev so it covers up what it's doing in the background, come on, most people are just going to figure it's one of those things. Actually now that I think about it, I could use that as an excuse for why I just blue screened. Damn, I should have thought about that earlier in the slides. All right. Also I've been thinking about doing a default BIOS password brute forcing. Basically you plug it in and it iterates for all the common BIOS passwords if someone happens to have a password on their BIOS on a boot up. Okay. I need a name for this project. First thing that came up was the idea of Minty Pwn. The very first packaging I did for this was an Altoids 10. No, I wasn't the guy who had the problem at the TSA and I'm hoping I don't when I go back home, either. But I was going to put in an Altoids 10 and Lady Ada had something called Minty Boost. I was going to call it Minty Pwn. But I was like, no, I don't like that name so much, not to mention I don't want to be like in the middle of the world. I was going to call it Minty Pwn on Lady Ada's territory. If you don't know who Lady Ada is, she does a whole lot of really cool electronics projects. Go check out her website. Then I thought, well, I'm using DIP switches usually to set what program I want to run off the system. So maybe I'll just call it the DIP stick. That name was what I used for a while. But then I really wanted something that was more descriptive. So I thought programmable head USB keyboard mouse dongle because that's exactly what this thing is. But that's a little bit long to say. That's a mouthful. So maybe we can abbreviate it. Okay. Let's go ahead and make an acronym. So I had to look around for something to actually build this with. And I had seen all sorts of stuff out there. I had seen the direct AVR code that was mentioned before. I had seen ways of doing it with a normal Arduino board. But it was extra circuitry, not to mention the Adrenos were not huge. The official hardware is a little bit bigger than I wanted. So I did some Googling around and I found the Tensy. Now, the Tensy is really, really small. And I'm trying to come up to me after this, after the question section, and I'll show you one. But the itty-bitty little tiny things. Basically everything you see above the wolf's head and below the USB adapter, that's all the Tensy. There's not much to one. So you can fit them in just about anything. Like 1.2 by .7 inches. It's got a little AVR so it runs at 16 megahertz. It's programmable in assembly, C, or the Adreno dev package. How many people here have ever used Adreno? All right. For those who haven't, Adreno's nifty. Essentially it's more or less, and someone who's a bigger Adreno developer might correct me on this, but it's kind of like a set of wrappers around C++ that get rid of some of the more complex things of the language and make it rather easy for hobbyist programmers and people like to mess around with electronics and digital art projects to deal with. There's also a version that's $27 that has more on-board storage and so forth. By on-board storage I mean program storage. There's ways you can use it as like a USB flash drive, but I'll go into why that has its problems in a bit. The best thing about the Tensy is it has built-in USB support. I don't need anything extra. So I was good to go. You can get those from pjrc.com. By the way, if anybody orders one from listening to this talk, tell them I'm geek sent you. Sometimes he sends me free demo hardware that I can play with. So I'm good to go. Here's the basic specs of both the Tensy and the Tensy++. Generally for most things you just go send keystrokes. The Tensy 2.0 by itself is enough. If you need a little bit more room for payload, look into the Tensy++ 2.0. But either one will work fine for you. It also depends on how many analog inputs you need and so forth. And maybe pulse width modulation you need. And I'll go a little bit into that. That glowing effect you saw earlier, that's caused by me using a PC. I'm not going to go into that. I'm going to go ahead and show you. PWM is pulse width modulation. Essentially what it's doing is it's turning on and off a particular connection on the chip really fast. And based on how fast you turn it on and off, you can basically make the LED dimmer or brighter. And I have like freedom going in there, one for red, one for green, one for blue, so I can simulate any color I want. And currently I just have it fading through different colors. I'll go a little bit more into analog in here shortly. Here is a simple schematic of some of the things that I'm going to show you. I'm going to show you some of the fucked devices I made. And all you basically see is a set of dip switches, one side going to ground. So I'm kind of using negative logic to where if it goes to ground, I'm considering it turned on. It just happens to be easier to wire that way. And depending on whether or not a dip switch is set or not, I can choose what I have the tendency to do. That way I can basically have multiple payloads all on one thing. I don't have to reprogram it every single time I plug into a different machine. But let's say you have an eight position dip switch. That gives you 256 possible different programs you can run. That's pretty nifty. Now the other thing you might see here is I have a symbol for a photo resistor and a 10 kilo ohm resistor. Now here's the way a photo resistor works. Essentially when light hits it, it gets lower in resistance. How many people here know Ohm's law, E over IR? This is the crowd for that. Essentially what happens, whenever that button goes off, it's going to go off. And that's going to make that voltage, or whenever the resistance drops on that photo resistor because more light hits it, its resistance lowers so more voltage is actually dropped across that 10 K resistor. Well you see that little line going off in the middle off to I believe pin number 10? That's when the analog ends. It can measure that voltage change and so by doing that I can tell how much light is in a room. And I'll show you how I use that here shortly. Basically this is a better description of how that analog pin bit works. Essentially it's measuring the amount of voltage by comparison to reference voltage. Let's say my reference voltage is 5 volts and it's getting 5 volts dropped across that resistor. Well it's going to read approximately 1023. However, if it's 0 volts, it's going to read 0 and anywhere in between. So I can use that basically as the basis for knowing how much light there is. But I don't have to use a photo resistor. I can also use a thermistor so I can do it by temperature and so forth. Part of the idea of doing all this is I can have my payload actually fire off whenever the light levels in the office reach a certain level. And we'll show some of that during the demo. Oh, tensi code. Everybody can read that, right? I've seen some hideous slideshows. I know I'm a bit on the verbose side with all the stuff I put in my slides. That's because I want to provide tons of links and more information for people who want to look at them later. We're going to break this down into smaller chunks. All right. Here's the header section. Now one of the things I've done is create — it's a little bit of a pain in the butt to use the direct USB keyboard functionality in Tensy, so I simplified it somewhat. Essentially here in my header section, I create a couple of variables, I initialize them, I make sure I set photo read to 0, and I set my DIP switches and say which DIP switch is which pin on the physical Tensy device. These DIP option, that's basically something that I use as a comment that I can make — dump out whenever need it to. Because on these tensies, if I have a nine position dip switch, I'll forget which dip setting does what. So essentially I use the little button as a diagnostic tool. I press it and it tells me which dip selection does what particular functionality. And I use dip options for that. Here's the setup routine. Basically it's just going, iterating through, telling each pin what it wants it to do. And that minimum wait thing is just me setting up the program to wait a certain number of minutes. In this case, I'm actually not using the dip switch to say what program to run, but to set the number of minutes to wait in binary. But if you're familiar with C or C++, this is essentially the same thing but a little bit easier because of the Arduino wrappers obfuscating some of the more complex issues involved in those languages. Training wheels. What was that? Training wheels. Hey, if they help. As long as they don't perform well. I feel like I would have been a much better programmer if I hadn't learned basic first. Kind of makes you lazy for all future coding. But then we eventually have the actual payload inside the loop. This is basically the thing that gets done over and over and over again. Think of it as your main function. In this particular one, it delays a little bit of time after the conditions are met. And what it ends up doing is it uses my library, which has something called command at run bar, and it runs this command. That's a really simple Windows command. Everybody knows that one, right? Let me break it down for you. Essentially, it opens up command exe, does a for loop, looking through the output of the WMIC command. The WMIC command, it's inside of all that junk, is looking for a disk that's a USB disk. What it does then is it gets that output, finds out which disk has a certain label, in this case, my thumb. Because basically when you plug in a thumb drive, you don't necessarily know for sure. You don't know for sure. You don't know for sure. On a victim system, what drive load it's going to get. That first part finds out that drive letter for you. Then it fires off a script off of that drive letter. Trust me, it all works. This part, I believe, is in the slides you have. Try it out. Trust me, it seems to work pretty well. And this way, you don't have to code in, go to a certain drive to run something or copy stuff to a certain drive because you're not going to know what drive it is until you actually plug it in. You can use this little bit of scripting to find it by its volume label. And it does its thing and it shrinks down the current window. That's right after the delay 10. The delay 10 basically means delay 1,000 milliseconds, so one second. In the fucked library, I've implemented a few different commands. One is command at run bar and then whatever operating system. I haven't done OS 10 yet. That's why the X is there. That could be either MS Windows or it could be Linux in GNOME. Same thing for shrink current window. Basically the idea is you can file something off the run and then you shrink the window so they don't necessarily see what you've got going on in the background. Press and release. Essentially this makes it a little bit easier to say take this one key, press it several times. If you want to get around in Windows and if you, like, open up a web browser and want to do something to someone's account someplace, generally it's best to get around with key presses rather than mouse events. So you can use this to, like, hit tab, tab, tab, tab, tab to get whatever field you actually need to get to. All right. Show dialogue. Essentially this function just sends diagnostic information out. I use this for debugging my programs. Essentially it reads through the pins, tells me what the current value is, also tells me what DIP settings I have for which particular premade payloads, all those sorts of things. And DIP options is that variable I mentioned before that actually gets printed out by show options. A few things I have implemented in there. Another thing is I have something called LED keys. This particular function basically just tells you which lock keys are down. For instance, scroll lock, caps lock, or num lock. And see, the next thing with this is there's not a whole lot of communication that comes back from the computer to the keyboard. But especially if I'm trying to start doing things on this one keyboard and this is a separate entity completely. However, whenever you use caps lock, scroll lock, or num lock, that message gets sent to everybody. So you can do what's I sometimes refer to as like a caps lock trap. Basically you turn on caps lock to be annoying using your Tensey and you know someone's at the station whenever they turn caps lock back off. And you can detect that with the Tensey. And you can use LED keys for that. Or I have a couple little Boolean functions that basically say is num lock on. Is caps lock on. Is scroll lock on. So basically all my stuff there is just to make it more convenient to create these fuck devices. If you want more information on this, tomorrow Dave Kennedy, also known as Relic, and Josh Kelly, also known as Winfang, are going to be giving a presentation on PowerShell. And they're going to go into some more advanced things you can do with a Tensey. So they're doing some more complex things than the one we're showing here. For example, I think they have some kind of like reverse shell they do out of PowerShell. So it should be pretty nifty. All right. Setting up the development environment. It is incredibly simple to set up. Let me go ahead and start this up. Hopefully this plays correctly. Essentially I've already downloaded the Arduino environment. Also, Paul, the guy who makes the Tenseys, has his own little special extra libraries and hardware specifications you have to put into the Arduino folder. So once you zip all those out together, you pretty much will have a working programming environment. The first thing I have to do right here is I have to install a driver for cereal. Sometimes people ask me if you need a driver install when they want it to work. No, you don't. However, to program it, sometimes you do. So I'm installing this so I can program it. This driver is not needed on the victim machine. Just for the sake of setting up my development environment. Also, I'm going to the device manager to find out what com port it is. That just makes it easier for me to do diagnostics and set things up. Eventually I'm going to find out the com port so I can set up my adrenal environment. For some reason I think I had to install that driver twice to actually make it function. And eventually it works. Okay. After I got all that done, I've already unzipped my adrenal environment. I'm going to go ahead and I think the next thing I did was I go into lib and I put in my ‑‑ I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. The latency loader, that's an extra EXE you can download from Paul's site. Essentially it's used for programming the latency. After you install it, essentially you can just press the button that's on the latency itself, that little black button you saw in some of the pictures, and it will automatically load code from the machine. Also, right here, I'm putting the adrenal extra hardware specifications and putting it towards my adrenal development folder so it knows what kind of board I have. With the adrenal environment you can program for a lot of different microcontrollers that are based around Adreno. The main Adrenos, there's like several different generations and a couple different types of Tensys and whatnot, which is why you have to install that so it knows about your hardware. At this point, I'm actually going to take my library, which is downloadable from my website, and copy it into the libraries folder. And it actually comes along with some examples so you can look at them and see how to do some of the stuff I'm going to be showing here shortly in the demo. At this point, whenever I want to actually program the Tensy, I just have the Tensy loader up and running, and I can load up Adreno. The code is fairly simple. I spent an inordinate amount of my life watching a blue line across the screen and I come to realize. All right, I'm going to open up one of the sample programs. And now all I'm sure have to do is tell it what kind of board I have, compile it and press the button on the Tensy And it will load that program and it should be good to go. Also, not only what board type you have to tell it but also what kind of USB device you want to emulate. Paul set it up so you can emulate the different USB devices. For instance, you can do a keyboard mouse, but you can also do like an SD card adapter. And you can also do a serial interface if you want to talk the thing over serial and don't want to use any keyboard mouse. functionality at all. That's not something to be used in this project. But for future projects I want to do, I think I might very well be using that functionality. I want to make my own ‑‑ who has seen aliens? You got a little sentry gun that shoots all the aliens? I want to make a zombie defense gun that does much the same thing. I want a heat sensor. I want it to detect motion. And then I want it to say, okay, is it hot or not? If it's cold and it's moving, it's a zombie. Fire. So I'm thinking about using the serial interface stuff for that. But once I have all those settings in, I tell it what com port I'm using, I compile it, and I go. And hopefully it gets more interesting from here, but I want people to know how simple it was to set up the environment. And the Arduino programming language, you saw my examples up there. Once you go through them a little bit, they're really not hard to follow at all. At least in my personal opinion. Now let's do a little bit of a device demo. I currently have a few devices that I'm going to show you. I'm going to show you some of the different devices set up. You saw, okay, you saw this one here a second ago. This is a mouse I have Trojan with some extra storage and a hub inside. Did some soldering, put the Tensy in there. And essentially it's made to be as a gag gift. I mean, it does all these pretty color things and so forth. But I can set it to go off via the caps lock trap. Instead of using caps lock for the sake of this video, what I've done is set it up to go off whenever it sees scroll lock hit. Because it's, you know, anymore, people don't use scroll lock, at least I don't, a whole lot. I'm going to have to put down the microphone to actually do this, though. But I could easily be caps lock or num lock. And essentially it will just sit there and wait for that to fire off. And when it sees that that value has changed, try that again. Hopefully it's supposed to be seeing that it's changed. It's possible I'm in live demo hell again. Anyway, it sits there and waits for the keyboard to have some change in value. And once it does, fires off its payload. I'll give this one more shot before I, there you go. It just fired it off in the background. And I'm going to give it another shot. I'm going to give it another shot. It started copying all the files on my desktop to the onboard storage. And it then shrank down the current active window. Which I screwed up by clicking on the wrong window right afterwards. But if I go back here and bring that window back up, what it basically did was fire off a script on the onboard thumb drive to start copying everything from my desktop, which might have interesting information, to the onboard storage. Then the person can come around later on and collect this device. And the scripts I've written for that are fairly easy. They're pretty easy. But essentially what it does is we're the current logged in user. It creates some extra folders on the drive. And for instance, I was logged into a different name, it would make a different folder. And that folder would contain all the stuff off the person's desktop. So that's one example of a payload. And that's one I use that I can trigger via scroll lock and whatnot. Let me back up a little bit. Now, a more interesting one, and one I have more advanced payloads for. I'm going to show is this little device. Now, this one I used a 10 C++ on just because I wanted, well, because Paul sent me one and I could attach more pins to it. So let me go ahead and bring this one up. I'm assuming this mic is live also. Groovy. All right. Now, for these demos, I've set things up to where I use this one button to trigger everything. Not because I have to. In real life, you'd want to have either it's fire off by timer, by lighting conditions, or as Mr. Elkin showed just a bit ago, feel like an RF trigger. But for the sake of demoing at DEF CON, I figured it would be easier for me to know exactly when my demo code was going to run by setting this button. I also have a 9-pin dip switch on this thing. I can set to 512 different possible programs using that. But I pretty much have each individual dip set to do one particular function. Just for convenience. Now, I mentioned that show diagnostics. That's what I have basically set on the first pin. The reason I have it that way is I can sit there and look and it makes it quick for me to figure out what might be going wrong with my program based on the current value of each pin and what the analog value is. This one has a little photo resistor that I mentioned before. And I'll show how we're using that here in a bit. But the most important thing is I keep forgetting what particular functionality I have on which pin. So I went ahead and added these comments in there. And pin one is show dialogue. But let's use some of the other ones. Pin two is go to my website. Let me hope that I actually have an Internet connection here. And let's also hope that Chris Paget hasn't figured out CDMA hacking yet. All right. Let's see if this is epic fail or not. It's acting like it's connecting to something. All right. In theory, that should open up a web browser. Oh, I'm sorry. That first one is not open up a web browser. The first one is open up notepad and say Aiden was here. That's a fairly simple thing to do. Essentially just use that command, open a command bar and run something, function that I mentioned before. Let's go ahead and try dip position three. Let's go ahead and try dip position three. That one opens up the web browser and goes to imgeek.com which may or may not fail depending on whether or not I have an active Internet connection right now. I appear to. Now you can use this for like if you notice a drive by zero day out there, you can have it set to automatically go out to some website. Also if you wanted to go out to some website and start uploading stuff on the person's machine, you would use that kind of functionality. But I'm going to shrink that down right now. And let's go to the next thing. Oh, set to zero. All right. Let's go to the next thing. Oh, set caps lock trap. I'm going to turn off that one, turn on number four. Essentially what this does is it starts annoying the user until they turn caps lock off. Then you know for sure someone is actually at the keyboard. So let me fire off the caps lock trap. All right. I'm just the average user typing along, hey, I'm shouting at everybody. What am I supposed to do? All right. So I turn off caps lock. And it fires off the script that I had set. All right. Now I'm going to go back to Facebook. And essentially it just tells you what it could have done. And I have word wrap turned off so you don't see it all. But just type something different into notepad. All right. Let's see if we have anything else more interesting than that. Ooh. It would be more interesting if it was a bank account. But, you know, Facebook will work also. All right. This one, essentially what it's going to do is it's going to open up the mobile version of Facebook. It was just so much easier to script the right number of tabs to get to the right spot in the forms if I use the mobile version because it's just a lot less complex to look at. Essentially you can have this paid off, go off by time or some other thing like the light functionality I'm going to show shortly. It goes out to Facebook, hits the right number of tabs, gets itself to the right position and makes a post. It could be some other kind of transaction as well. But I just happened to decide to do Facebook. Thank you. Let me see. What's the other one I had on there? This is just to get your brain working on what you could possibly use this for. Oh. Define my drive by its name, my thumb and start copying stuff to it. I pretty much always show that with the Trojan mouse. I think Dave and Josh tomorrow may have a Trojan keyboard they'll be bringing with them. I'm not sure. I haven't actually seen the presentation yet because I didn't go to Black Hat. And I got there a little bit late for B-Sides. All right. Brightness detection. Oh, yeah. That one's fun. We'll go ahead and do that one. 7, 7, 7, 7, 7. All right. For that, I'm going to need some freaking lasers. With no sharks necessarily attached. Though if anybody happens to have any sharks in the audience, bring them on up and we can try. All right. Essentially the light detection just detects the amount of light in the area. I was telling you you could trigger it by environmental conditions. This could also be like a thermistor and you could do it with a light detector. You could also do it via heat. But essentially I press the button and it says the lights seem to be on because I'm sitting here in a fairly brightly lit section of the room. I'm going to cover the photoresistor, do it again. Let's try this again. You know, it's distinctly possible that I destroyed something in here. It happens. That's why it's always good to bring backup. Hold on a second. Hopefully I have the exact same program loaded on this particular unit. Oh, another thing I've been doing is making those little Trojan devices. You can see the little things flashing. This is the unit that I recently was at a meeting with tenacity and I had this embedded in a wolf's head because the logo is a wolf. So I'm going to go ahead and do that. I'm going to put this in the eyes and make it flash and so forth. But hopefully I have all the right stuff set in it to act as a demo for this. Let's go ahead and one. All right. Brightness detection. Yes, that's number seven on this particular unit. Let's see if this one blows up in my face or not. All right. Brightness detection. Do it. Lights are on. That's expected. I'm scared of the dark because I got it covered. It's possible I even have an open and a short on that. It's causing that analog read to always read the same thing. I may have screwed that up and jostling it around on the plane here. And that was light to dark and let's get a little bit more creative. And that's why it's always good to bring back up. But I also have a payload on there. I think you may have saw that one in the listing when I did my diagnostic called motion sensor. And essentially all it's doing is using the photo resistor where it sees a change in the value of light. Because generally, you know, if someone moves, a shadow happens, something gets rearranged, light reflects differently. It's a great way to detect motion. So when it detects some kind of change, it should ‑‑ oh, actually, I have the wrong one there. I'm not using all the nine pins on this one. Motion detected. You can have it fire off some other payload. The payload I have just types out into notepad. But you can just as easily have it add an account, make one of those transactions I mentioned before. Just a ton of different things. All right. I'm going to unplug that bad boy. And now we can go back to the slide part. Assuming I can find it amongst all the windows that I now have open. There we go. All right. Demo units. The first time I made a demo unit, and anybody that wants to see these after the main part of the talk, come on up and I'll show them to you. First one I made was an Altoids 10. And I've also tried directly soldering the dip switches onto the 10C. But that makes it hard to repurpose. And I like to use my 10C for other things like ‑‑ ten minutes. Thank you. I like to use it for other purposes like controlling servos and whatnot. So I decided to start doing these things like shields. Essentially I make it so I can just solder on sockets. Not to mention sockets are much cheaper. I'd much rather burn out a $30 ‑‑ sorry, $30 component than like an $18 component. So I solder those on and I can actually start making shields that can pop on and off for different functionality. Like you see right here. Oh, by the way, that adapter I got, I think it's the same adapter that Mr. Elkins was using. It's the same adapter that Mr. Elkins was using. Got it from Dill Extreme for dirt cheap. It's about the smallest one I can find. If you break it apart, you can actually make it a little bit smaller by getting rid of that plastic casing. Also, I have versions that ‑‑ there is an SD card adapter so you can make it read a micro SD card and use that instead of any kind of flash drive. The problem is the 10C operates at 1.1 USB speeds, which is perfectly fine for a mouse and keyboard. It's not going to be going any faster than that anyways. But it is kind of a limitation for micro SD. Don't be afraid to use it. It's going to be great. I'm hoping that Paul is going to implement some more stuff with the lower level of the 10C so you can start using it for, like, pulling up password lists and whatnot. Beyond the dipstick, I've been talking about Trojan USB devices. I've always showed you the mouse. I've been working on ‑‑ okay, Tenacity's logo is this howling wolf. And while I was at a recent meeting, they gave me this cool little plush stress toy. But it was hard to fit all my electronics in it. So I've been trying to get better at sculpting. I've been trying to get better at sculpting. So let me see if I can put this guy back together with a function. So I have a 50‑50 chance of hooking this thing up right. All right. Someone come up to me later on. I think I got it with me. Who has ever seen Army of Darkness or Evil Dead 2 or one of those movies? I have a Necromonicon-styled iPod touch cover. Unfortunately, I haven't got the finger biting part done yet. That's going to have to require a few servos and some extra electronics. But we'll talk about it later. All right. Here's my little Tenacity wolf I tried to sculpt. And I've essentially used RGB LED lights. And I can actually change those programmatically. So if I want to make a more advanced version of this, I could make it like the Navs tag. That's that little rabbit you see right there that gives you extra information about what's going on in the computer, like is there new e‑mails or whatnot. Well, I can make the eyes change different colors based on what's going on in the computer system. But to do that, I need extra software installed. So when you're socially engineering someone to install these things, you can say, yeah, I've got this cool desktop toy for you. It does extra things for your computer. But you've got to install this extra software. Along with it. I'm not much of a social engineering. I mean, I leave that to people like Dave Kennedy and Chris Nicholson and the guys on the social engineering podcast. It's been said before that I use my personality as birth control. Not to mention my accent kind of gives me away if I'm talking on the phone to somebody. But social engineering with Trojan devices or beware of geeks bearing gifts is another option. I'm going to start speeding up through this. This is that mouse I was showing off earlier. If I can get this to play. Essentially I've just soldered in the 10 C, a little hub so I can still get USB 2 speeds on onboard storage. And the thumb drive I have in here isn't exactly a thumb drive. It's essentially a micro SD card adapter. And you'll see it behind everything else. There's that little RGB LED which I basically just have set to iterate through colors to make it pretty. But I could program it to do something more advanced if I really, really want to. But that's essentially how this one's built. And if anybody wants to see it in the Q&A room, feel free to come on up. Oh, another thing I made. I'm not much of a sculptor. I'm getting better at it. For some reason I can sculpt skulls. I don't know why. So this is another little Trojan device that you can give to someone as a cube toy. Basically it's a little skull that the eyeballs flash different colors. Eventually. There we go. And it looks nifty. That one I made out of something called shape lock which I'll talk a little bit more in a second. All right. Is it more likely than you think? All right. There's also the cool things out there for making these kind of Trojan toys. Shape lock is the first thing I want to mention. Shape lock is five minutes. Thank you. Shape lock is this cool stuff. I believe the guy before me mentioned it as well. Essentially you put it in boiling water. It melts down. It becomes very flexible. You can mold it into whatever you like. But then when it gets hard it becomes like hard plastic nylon. It's very, very tough stuff. And that's what that skull you saw a second ago is made of. Also, LEDs don't always look the best if it's a raw LED because you can see the individual elements in it. But if you diffuse them, if you basically put the light through something, it actually looks better. And shape lock is really good as a diffusing substance. Two-part silicone putty. Some of the stuff I've sculpted myself. Some other stuff like my little penguin here. I basically found someone else's penguin toy, cast it with this silicone putty, and then I could keep casting more and more of the same toy to use as packaging for my devices. If you're really lazy, go to like a hobby store. Cake, soap, and candy molds also work very well. So, for instance, if you know your target is very religious, you can go out there and find like a soap mold that is made like a crucifix or a cross or a Star of David, which brings up the subject, why would someone want to use a cross as a soap mold? I mean, I've seen it. It was in the store. I'm not sure why. But, I mean, that's an option for making toys to hand to people. Silicone caulk also will work as a casting agent, but you don't get very good definition and it's kind of messy and you've got to use water with it to get it to set within a reasonable amount of time. Polymer clay, which is what I sculpted the wolf head over here out of, was very easy stuff to work. Kind of looks like the opposite of shape lock. You basically bake it and it becomes hard and tough. And then you can use that to cast other items, which is some of the things I've done. Hot glue also works as a casting agent and it's really good at diffusing light. And fishing lures. A lot of these rubbery substances I've been messing around with are actually made out of melted down fishing lure. It gives this really cool, funny texture and it's really easy to cast and once it comes out, it's awesome. And it's fairly heat tolerant. You've got to get it fairly hot to actually melt it. Unlike shape lock, shape lock, I made the mistake of leaving something I made on the dashboard of my car. And a hot glue, it's really easy to cast and it's not summer day, black Honda fit. It wasn't a pretty sight. But here's a bunch of stuff I've been casting. I'm going to start speeding this up because I don't want to run out of time. Now, there's various things you can do to protect against these kind of fuck devices. For instance, Windows 7 Vista has a ton of things in group policy that you can go in and set. And there's more information in that particular URL and that part is in the slides that are on your CD and I'm going to have it out on my website before long. Also, basically it manipulates data with these particular registry keys. So you can basically go in there and say, don't automatically install any USB device. And that's the safest bet. You can also go in and say, don't install this particular vendor ID and product ID, which is how you can kind of like a or all these USB devices have vendor IDs and product IDs and you can black list those. But you can also on the 10Z set them to whatever you like. You can tell it's an Apple keyboard if you want. So that doesn't do you any good. I usually set mine, I think my vendor ID is usually 1313 and my product ID is like 666. But you can have it whatever you want. If you want a ton more information on how these work, I wrote an article recently where I go through step-by-step and describe each one of these group policy settings. It's out on my website and it's near the top of the list if you go to the front page and look at the history. Also, if you're using Linux, look in the U Dev rules. I haven't looked into them enough myself, but there should be ways of doing much the same thing in Linux. The OS 10 people, I don't care about you all. No one laughed at that? I'm going to get fired. Okay. Few ideas I have for future work. I'd like to make a version of the 10Z that goes in line so I can sit there and log keystrokes as well as send them. Then I can sit there and pass out when someone hits control or delete and then a tab and know, oh, that's probably the username and password that they just typed in. I can start doing my evil and use their credentials for it. Stuff like that could be very interesting. Also, long range wireless keyboard, which the guy before me has kind of gotten into. I'm going to show you how to do that. I'm going to show you how to do that. So I have various links out there. Paul's site, my project site, USB device, which is an awesome tool to see what USB devices are currently attached to your system. I've used it a lot for this. That way you can see the product ID and the vendor ID so you know what you want to spoof. RedStream app was useful for figuring out what particular applications edited what things in the registry. And Hack 5 has their own rubber ducky for them. There's tons of things out there for sources for parts. The 10Z store. Photo resistors, I get a lot of my stuff from BG Micro or Mouser. You can go to Radio Shack, but Radio Shack kind of sucks these days for parts. LED shopping is a nice place to buy all sorts of types of LEDs. And I buy tons of stuff from Deal Extreme. For instance, that little micro USB adapter I was using. And there's a really nice hub they have there that you can take apart. It has long wires and you can make it very small to fit inside of objects like a mouse. All right. A few events I want to mention. The Louisville InfoSec is coming up on October 7, 2010. Hope some of you all can make it out there. Skydog comes, it's not really a Skydog, but it's called Skydog. Skydog comes out on October 7, 2010. Skydog comes out on October 7, 2010. So, Skydog comes. He's one of our goons here. He's going to be coming out sometime in 2011. Keep pestering me to ask if he gives us a date. And also I'm regularly going to Freaknik, Nauticon, and Outerzone. All cons I recommend. And a little bit of announcement. A few of us from the Louisville area and, well, one guy from the Cleveland area are organizing a con in Louisville, Kentucky. Now, this one's way off in the future, September 30, to October 7, 2011. But it's called DerbyCon. By the way, if anybody can help us with some names for it. We trying to find, actually not names, we need a slogan. And we want it to be either Kentucky or horse themed. So a few ideas I've had, what color is your derby? 1100 nerds and devices, that's what someone came up with. Being in the security world like a French steak. The glue that holds the hacker community together. If anybody has better ideas, let me know. Special thanks to all these guys again. And questions will be out of the room. I'm going to get out of the way because I'm about to get pulled off stage. Everyone have a lovely evening.