1 00:00:00,000 --> 00:00:09,520 Hello, DEF CON 18, how are we doing? Well, hopefully y'all will be able to tolerate 2 00:00:09,520 --> 00:00:14,260 three hours of Arduino goodness since the last two presentations had some things to do with 3 00:00:14,260 --> 00:00:19,820 Arduino-based development environments as well. My particular talk is on what I like to call 4 00:00:19,820 --> 00:00:24,540 the programmable hid USB keyboard mouse dongle for pen testing. And if you want more 5 00:00:26,500 --> 00:00:34,980 information, all right, how about this? All right, guys, hopefully I'll remember to keep 6 00:00:34,980 --> 00:00:38,160 this this close so y'all can hear me waving in the back especially. If you want more 7 00:00:38,160 --> 00:00:43,000 information on this project, it's up on that very Google index friendly URL but very 8 00:00:43,000 --> 00:00:49,320 untyping friendly. The slides that are currently on your CD are rather old but I will have 9 00:00:49,320 --> 00:00:54,260 these slides posted on my website relatively shortly. First of all, a few special thanks. 10 00:00:54,540 --> 00:01:00,700 Thanks to Tenacity Solutions for helping finance the project and for helping get me here. 11 00:01:01,340 --> 00:01:08,620 Kentucky Anna ISSA for also helping to get me here. And of course PJRC for giving me some extra 12 00:01:08,620 --> 00:01:13,420 promotional materials and sending me some free hardware to start work on this project. If 13 00:01:13,420 --> 00:01:17,100 anybody wants any of their little flyers on how the 10C is built and what the pin out is, 14 00:01:17,260 --> 00:01:24,520 come see me afterwards. First of all, a little bit about me. My name is Adrian Crenshaw. I'm a 15 00:01:24,540 --> 00:01:28,060 senior at INFOSEC. I run a website called irongeek.com. . 16 00:01:30,500 --> 00:01:39,760 Thank you. Also a regular on the INFOSEC daily podcast, isdpodcast.com. I'm on there usually every 17 00:01:39,760 --> 00:01:47,340 Thursday. Slogan for my website is Lifting Dumbbells in the Gym, Supporting Them at Work. And I 18 00:01:47,340 --> 00:01:52,380 have an interest in Infosec Education. One of my main goals is basically become a Professor of 19 00:01:52,380 --> 00:01:55,740 sorts that goes around and teaches people about computer security. 20 00:02:00,600 --> 00:02:04,860 Now I don't know everything. I'm just a geek with extra time on my hands. While some people 21 00:02:04,860 --> 00:02:08,380 might be sitting around playing solitaire, I like to, well, sit around and play desktop 22 00:02:08,380 --> 00:02:14,700 tower defense and write security articles, make security videos, do research and so forth. 23 00:02:15,100 --> 00:02:20,800 Now there's many things which I'm a noob on. But I have this theory that it takes a noob 24 00:02:20,800 --> 00:02:25,980 to teach a noob sometimes. For instance, people who have been doing computer security or any 25 00:02:25,980 --> 00:02:30,780 technical subject for years and years and years might take for granted what the student would 26 00:02:30,780 --> 00:02:35,340 know. For instance, I found this most of all when I was teaching a C106 class, which is like 27 00:02:35,340 --> 00:02:40,440 intro to computing. And I saw someone grab a mouse like this and try to use it. And I never 28 00:02:40,440 --> 00:02:43,900 thought to explain to them how to use a mouse. I also saw this one lady, she learned how to 29 00:02:43,900 --> 00:02:47,400 actually use the mouse backwards. And she got proficient with it. So if it works for her, 30 00:02:47,440 --> 00:02:48,220 that's all fine and good. 31 00:02:49,700 --> 00:02:50,600 But, you know, 32 00:02:50,800 --> 00:02:56,440 for instance, explaining, you might take for granted if you're really familiar with C that 33 00:02:56,440 --> 00:03:00,100 people would automatically know they have to initialize whatever variables they create. 34 00:03:00,280 --> 00:03:03,860 You know, stuff like that. So sometimes it takes a noob to teach a noob, which is one 35 00:03:03,860 --> 00:03:07,580 of the things my website specialized in. First of all, before I really get on to the meat 36 00:03:07,580 --> 00:03:10,860 of this talk, I want to give you a little bit of a story about how I got started on 37 00:03:10,860 --> 00:03:16,600 this project. I was giving a fireside talk called, I think it's Skinny Baiting and Funny 38 00:03:16,600 --> 00:03:20,780 Pots, basically with how to screw with attackers, where I was at ShmooCon initiative. And I 39 00:03:20,800 --> 00:03:27,580 was giving a speakers gift and it was this little thing called a phantom keystroker. You 40 00:03:27,580 --> 00:03:31,380 plug it in, it does annoying stuff like type random characters, move the mouse around, 41 00:03:31,520 --> 00:03:36,200 jiggles it, turns caps lock on and off. Just things to annoy. It was meant to be a prank. 42 00:03:36,440 --> 00:03:41,680 But it started me thinking, what could I do if I could program this bad boy? So I started 43 00:03:41,680 --> 00:03:46,680 looking around for something to program. But the first thing I did was I was there and 44 00:03:46,680 --> 00:03:50,760 there was a couple other people roaming around ShmooCon with me. Well, I had known that a 45 00:03:50,800 --> 00:03:57,120 guy named Darren Kitchen from Hack Five. He had done a lot of work with U3 thumb drives, 46 00:03:57,340 --> 00:04:03,000 which you plug in and one part of the drive looks like a CD and you can use the auto run 47 00:04:03,000 --> 00:04:06,460 functionality to automatically fire off a payload. Well, a lot of people now are getting 48 00:04:06,460 --> 00:04:12,780 smart with that and they're turning off auto run. So I was thinking, well, what if I could 49 00:04:12,780 --> 00:04:16,880 do this little keyboard dongle that you plug in and it automatically starts sending keystrokes 50 00:04:16,880 --> 00:04:20,780 to do much of the same thing. So I brought the idea to Darren and he was kind of trying to 51 00:04:20,800 --> 00:04:23,520 figure out how to do it. He took me outside of Aden. We're kind of already working on that. 52 00:04:23,700 --> 00:04:28,980 But then they were going to send me some demo stuff to look at. But I got impatient. So I 53 00:04:28,980 --> 00:04:33,520 started looking around for how to build one myself. And actually, we came across the exact 54 00:04:33,520 --> 00:04:39,180 same chip, the 10C, which I'll talk more about in a second. Also, Robin Wood was involved in 55 00:04:39,180 --> 00:04:43,100 the project. I don't know if you all know Robin Wood, but he does a lot of really cool coding 56 00:04:43,100 --> 00:04:49,120 projects. Great guy. Definitely go out and check his work. And if you ever get a chance to see 57 00:04:49,120 --> 00:04:55,060 some of the work he's done on using social networks for botnet command and control, interesting 58 00:04:55,060 --> 00:04:59,100 stuff. There are little things called the rubber ducky. And they actually have a forum out there 59 00:04:59,100 --> 00:05:03,120 for extra information. If you want more information on using these kind of devices on Macintoshes, 60 00:05:03,940 --> 00:05:10,100 definitely a good place to go. Okay. Playing with the idea. For those that didn't want to wait 61 00:05:10,100 --> 00:05:14,520 for them to get a product out, I decided to, you know, for those that, as I like to say, go ugly 62 00:05:14,520 --> 00:05:19,100 early, I decided to put out some notes on how to basically build one of these devices and 63 00:05:19,120 --> 00:05:24,480 they will act as a keyboard and mouse that you can program. Free notes. I'm new to microcontrollers. 64 00:05:25,180 --> 00:05:29,680 I suck at soldering. Or at least I did a few months ago. I've gotten better. Or as I used to say, 65 00:05:29,760 --> 00:05:33,980 I used to, when I soldered, I was like an epileptic alcoholic with DTs soldering with an aluminum 66 00:05:33,980 --> 00:05:39,380 baseball bat. I'm not particularly, like I said, I'm still not great. There's a guy named Scott 67 00:05:39,380 --> 00:05:43,880 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 68 00:05:43,880 --> 00:05:47,580 better at soldering. I kind of suck. It doesn't look good. The joints are bad. And he was like showing 69 00:05:47,580 --> 00:05:49,100 me all this really expensive equipment. And I was like, I need to get better at soldering. I kind of suck. 70 00:05:49,120 --> 00:05:54,460 I need to buy. And if you're a guy like him who replaces, you know, hard drive controller boards 71 00:05:54,460 --> 00:05:59,780 and do surface mount soldering, you really need that stuff. But I'm dirt cheap. So, you know, I 72 00:06:00,480 --> 00:06:04,880 went with what I could find. Oh, I apparently suck at rotary tools as you'll see in some of my 73 00:06:05,380 --> 00:06:11,820 packaging pictures. Okay. Let's go into why you might want a programmable head USB keyboard 74 00:06:11,820 --> 00:06:17,540 dongle. First of all, it's likely going to be a type a lot faster than you can without errors. 75 00:06:18,340 --> 00:06:22,520 So, you know, instead of going up behind someone's machine and start typing, you can just like plug 76 00:06:22,520 --> 00:06:26,880 this in surreptitiously in the back of the machine and have it do the commands you want to like maybe 77 00:06:26,880 --> 00:06:32,880 add an account or whatnot. It works even if U3 auto run is turned off. Most everybody, 78 00:06:33,180 --> 00:06:38,200 I played with, if you plug in a HID device, that's human interface device, like a keyboard or 79 00:06:38,200 --> 00:06:43,460 mouse, it automatically installs and goes. It draws a lot less attention, like I was saying 80 00:06:43,460 --> 00:06:47,520 before, than sitting down in front of the terminal to type in your commands. It's a little bit 81 00:06:47,520 --> 00:06:54,860 complicated. Just plug it in and once it enumerates all the USB devices, installs it, it's 82 00:06:54,860 --> 00:07:02,040 good to go. Also, you can set it to go off on a timer. For instance, if I had a professor I knew, 83 00:07:02,140 --> 00:07:07,640 you know, and I could get access to the machine during the day, I could plug this in, I know 84 00:07:07,640 --> 00:07:12,460 eight hours it will be logged in, have it do something in eight hours. Just set it off to go on 85 00:07:12,460 --> 00:07:17,180 a timer. Or a better example would be if you know the admin is going to be in and you're on a physical 86 00:07:17,520 --> 00:07:21,400 test, with permission, and you know the admin is going to be logged into the box in eight 87 00:07:21,400 --> 00:07:25,280 hours, plug this thing in the back, have it set to go off in eight hours, do your thing, add your 88 00:07:25,280 --> 00:07:29,220 account and do what you need to do. Or a ton of other different payloads. I'm going to show 89 00:07:29,220 --> 00:07:34,720 you some payloads here in a bit. Just use your imagination on all the different ways you could 90 00:07:34,720 --> 00:07:39,900 use one of these sorts of devices. Okay. What sort of commands would you want to use? Well, I 91 00:07:39,900 --> 00:07:46,600 would suggest have it automatically add a user for you. That could be useful. Run any old program. 92 00:07:46,600 --> 00:07:51,380 For instance, you can't get Autorun to work, but you can use this along with some storage built 93 00:07:51,380 --> 00:08:00,100 into the device to fire off any old script or EXE that you have off of the storage. No problem. So 94 00:08:00,100 --> 00:08:03,340 basically you can get around the whole Autorun being disabled and still have very much like 95 00:08:03,340 --> 00:08:10,460 U3 thumb drive functionality. Copy files to your thumb drive for later retrieval. It's like I 96 00:08:10,460 --> 00:08:14,780 have a payload, you plug it in and it copies everything on the desktop to onboard storage so 97 00:08:14,780 --> 00:08:20,600 you can pause that stuff, look at it later. Possibly dump password hashes or whatnot. Look at 98 00:08:20,600 --> 00:08:24,680 the current U3 payloads that are out there for further ideas on what you can do with this tech. 99 00:08:26,000 --> 00:08:30,720 Upload local files. If you don't want to use onboard storage, you could script it to where it 100 00:08:30,720 --> 00:08:34,700 automatically opens up a web browser and goes out to your site and starts uploading certain 101 00:08:34,700 --> 00:08:40,920 files off the system. Download and install apps, fairly obvious. And something you can do is 102 00:08:40,920 --> 00:08:44,760 something that's kind of akin to cross-site request forgery, but you can do that with a lot of 103 00:08:44,780 --> 00:08:50,260 people, but not quite. Essentially how many people here when they hit a website say, yes, 104 00:08:50,320 --> 00:08:53,880 remember me, stay logged in? You lying bastards. 105 00:08:59,100 --> 00:09:02,100 Crap. I have no idea why that just closed on me. 106 00:09:09,900 --> 00:09:13,380 Hold on just a second, too. We got some small issues. 107 00:09:21,700 --> 00:09:23,180 Not that I recall. 108 00:09:30,820 --> 00:09:32,440 We have blue screen. 109 00:09:33,900 --> 00:09:34,720 . 110 00:09:43,940 --> 00:09:44,760 . 111 00:09:46,140 --> 00:09:46,500 Fly out. 112 00:09:46,500 --> 00:09:47,860 Well, most of my payloads for this are 113 00:09:47,860 --> 00:09:51,220 for Windows. And quite frankly, usually when I'm going to be targeting a system, it's going 114 00:09:51,220 --> 00:09:57,480 to be a Windows system. So. That's why it's all targeting Windows. So I guess in the 115 00:09:57,480 --> 00:10:00,700 meantime, I'll do my best karaoke while I'm up here waiting for my machine to restart. 116 00:10:01,880 --> 00:10:02,240 . 117 00:10:04,540 --> 00:10:04,900 . 118 00:10:04,900 --> 00:10:07,700 See, I've had problems with live demos before. But generally 119 00:10:07,700 --> 00:10:11,460 the slides work. But this has even happened to Bill Gates, so, you know. 120 00:10:11,540 --> 00:10:11,840 . 121 00:10:11,840 --> 00:10:41,820 Okay. Don't worry, I'll have this functional very shortly. Give 122 00:10:43,560 --> 00:10:45,920 it to me. 123 00:11:33,160 --> 00:11:37,620 By the way, they were talking a little bit ago about fuzzing USB drivers and so forth. 124 00:11:38,080 --> 00:11:40,540 I'm pretty sure that's part of what happened to me there. 125 00:11:42,860 --> 00:11:47,200 If you see a blue screen like that, you have to wonder if a USB device is causing that, 126 00:11:47,380 --> 00:11:50,700 if you can get that kind of memory corruption to cause it to crash, can you cause it to do 127 00:11:50,700 --> 00:11:54,580 something else? That's something we'll have to do a little more looking into later. Anyway, 128 00:11:54,800 --> 00:11:58,900 cross site request forgery. You might be familiar with that where you put some code on a website 129 00:11:58,900 --> 00:12:02,920 that automatically make a request on a different website that the person stayed logged in for 130 00:12:02,920 --> 00:12:06,820 because they just chose, yeah, save this cookie and I want to stay logged into this service. 131 00:12:07,440 --> 00:12:11,800 So this isn't quite cross site request forgery but essentially you leave the device in and 132 00:12:11,800 --> 00:12:16,460 if you know they stayed logged into Facebook or their bank account or what not, have it 133 00:12:16,460 --> 00:12:21,160 automatically make a transaction on that particular service to do whatever little evil task your 134 00:12:21,160 --> 00:12:30,300 heart desires. And my heart desires a whole lot of evil tasks. All right. A few other 135 00:12:30,300 --> 00:12:36,960 ideas I had. Embed a hub and storage for better packaging. And essentially this mouse I had 136 00:12:36,960 --> 00:12:41,780 plugged in a second ago, I think everybody saw it iterating through different colors, essentially I've embedded in one of my 137 00:12:41,800 --> 00:12:47,120 little 10C devices that's programmed to act as a keyboard and mouse, onboard storage and a hub. So it's 138 00:12:47,120 --> 00:12:51,740 all in one unit. You plug it in and now everything functions. And I can give this to someone as a gift 139 00:12:51,740 --> 00:12:56,420 and say hey, here's this really cool mouse that changes colors back and forth whenever you use it. 140 00:12:56,520 --> 00:13:06,440 And actually I'm going to show that real quick. And essentially it just sits there and iterates 141 00:13:06,440 --> 00:13:11,780 through the colors. But I'll show the payload it does here in a bit. I'll show it now in a few 142 00:13:11,800 --> 00:13:22,020 seconds. I'll show it now but I'm afraid of another blue screen. Okay. Leave it around and some people 143 00:13:22,020 --> 00:13:26,400 have mentioned this before. I believe they call it road apples. Leave it around as a thumb drive package 144 00:13:26,400 --> 00:13:34,040 hoping unsuspecting users will plug it in. Trojan hardware. Use a time or a sensor and embed it in a 145 00:13:34,040 --> 00:13:41,340 gift device. There's also these little USB QB toys. Maybe you all have seen something called a NASPAC. 146 00:13:41,800 --> 00:13:45,180 It's like a little bunny rabbit that glows different colors if you have e-mail or some message waiting 147 00:13:45,180 --> 00:13:53,480 for you. What is that? The humping dogs. Yes. The dogs that hump your USB port. They make your USB port 148 00:13:53,480 --> 00:13:58,420 literally. Yes. Those would be another good example of cubicle toys. But think of all the USB devices 149 00:13:58,420 --> 00:14:01,860 you have laying around that have extra space in them already. As you can see I jammed one in a mouse. 150 00:14:02,160 --> 00:14:08,420 I think my buddy Dave jammed one in a keyboard. So there's all sorts of possibilities there. You can 151 00:14:08,420 --> 00:14:14,160 can have it wake up, mount the onboard storage and have the program do whatever you want. 152 00:14:14,400 --> 00:14:17,900 If it happens to fake a blue screen of dev so it covers up what it's doing in the background, 153 00:14:18,600 --> 00:14:22,240 come on, most people are just going to figure it's one of those things. Actually now that 154 00:14:22,240 --> 00:14:26,760 I think about it, I could use that as an excuse for why I just blue screened. Damn, I should 155 00:14:26,760 --> 00:14:31,360 have thought about that earlier in the slides. All right. Also I've been thinking about doing 156 00:14:31,360 --> 00:14:35,060 a default BIOS password brute forcing. Basically you plug it in and it iterates for all the 157 00:14:35,060 --> 00:14:39,720 common BIOS passwords if someone happens to have a password on their BIOS on a boot 158 00:14:39,720 --> 00:14:45,180 up. Okay. I need a name for this project. First thing that came up was the idea of Minty 159 00:14:45,180 --> 00:14:49,640 Pwn. The very first packaging I did for this was an Altoids 10. No, I wasn't the guy who 160 00:14:49,640 --> 00:14:55,860 had the problem at the TSA and I'm hoping I don't when I go back home, either. But I 161 00:14:55,860 --> 00:15:00,040 was going to put in an Altoids 10 and Lady Ada had something called Minty Boost. I was 162 00:15:00,040 --> 00:15:03,180 going to call it Minty Pwn. But I was like, no, I don't like that name so much, not to 163 00:15:03,180 --> 00:15:05,040 mention I don't want to be like in the middle of the world. I was going to call it Minty 164 00:15:05,040 --> 00:15:10,600 Pwn on Lady Ada's territory. If you don't know who Lady Ada is, she does a whole lot 165 00:15:10,600 --> 00:15:13,120 of really cool electronics projects. Go check out her website. 166 00:15:13,580 --> 00:15:17,980 Then I thought, well, I'm using DIP switches usually to set what program I want to run 167 00:15:17,980 --> 00:15:21,900 off the system. So maybe I'll just call it the DIP stick. That name was what I used 168 00:15:21,900 --> 00:15:25,760 for a while. But then I really wanted something that was more descriptive. So I thought programmable 169 00:15:25,760 --> 00:15:29,900 head USB keyboard mouse dongle because that's exactly what this thing is. But that's a 170 00:15:29,900 --> 00:15:34,440 little bit long to say. That's a mouthful. So maybe we can abbreviate it. Okay. Let's 171 00:15:34,440 --> 00:15:35,020 go ahead and make an acronym. 172 00:15:44,780 --> 00:15:50,860 So I had to look around for something to actually build this with. And I had seen all 173 00:15:50,860 --> 00:15:55,580 sorts of stuff out there. I had seen the direct AVR code that was mentioned before. I had 174 00:15:55,580 --> 00:15:59,360 seen ways of doing it with a normal Arduino board. But it was extra circuitry, not to 175 00:15:59,360 --> 00:16:03,880 mention the Adrenos were not huge. The official hardware is a little bit bigger than I wanted. 176 00:16:03,880 --> 00:16:09,160 So I did some Googling around and I found the Tensy. Now, the Tensy is really, really 177 00:16:09,160 --> 00:16:16,940 small. And I'm trying to come up to me after this, after the question section, and I'll 178 00:16:16,940 --> 00:16:21,800 show you one. But the itty-bitty little tiny things. Basically everything you see above 179 00:16:21,800 --> 00:16:26,340 the wolf's head and below the USB adapter, that's all the Tensy. There's not much to 180 00:16:26,340 --> 00:16:33,400 one. So you can fit them in just about anything. Like 1.2 by .7 inches. It's got a little AVR 181 00:16:33,880 --> 00:16:39,280 so it runs at 16 megahertz. It's programmable in assembly, C, or the Adreno dev package. 182 00:16:39,480 --> 00:16:43,480 How many people here have ever used Adreno? All right. For those who haven't, Adreno's 183 00:16:43,480 --> 00:16:47,740 nifty. Essentially it's more or less, and someone who's a bigger Adreno developer might 184 00:16:47,740 --> 00:16:52,500 correct me on this, but it's kind of like a set of wrappers around C++ that get rid of some 185 00:16:52,500 --> 00:16:57,260 of the more complex things of the language and make it rather easy for hobbyist programmers 186 00:16:57,260 --> 00:17:02,400 and people like to mess around with electronics and digital art projects to deal with. There's 187 00:17:02,400 --> 00:17:07,080 also a version that's $27 that has more on-board storage and so forth. By on-board storage 188 00:17:07,080 --> 00:17:12,360 I mean program storage. There's ways you can use it as like a USB flash drive, but I'll 189 00:17:12,360 --> 00:17:16,960 go into why that has its problems in a bit. The best thing about the Tensy is it has built-in 190 00:17:16,960 --> 00:17:24,040 USB support. I don't need anything extra. So I was good to go. You can get those from 191 00:17:24,760 --> 00:17:29,320 pjrc.com. By the way, if anybody orders one from listening to this talk, tell them I'm 192 00:17:29,320 --> 00:17:32,380 geek sent you. Sometimes he sends me free demo hardware that I can play with. So I'm 193 00:17:32,400 --> 00:17:38,240 good to go. Here's the basic specs of both the Tensy and the Tensy++. Generally for most 194 00:17:38,240 --> 00:17:43,020 things you just go send keystrokes. The Tensy 2.0 by itself is enough. If you need a little 195 00:17:43,020 --> 00:17:50,580 bit more room for payload, look into the Tensy++ 2.0. But either one will work fine for you. 196 00:17:50,720 --> 00:17:55,700 It also depends on how many analog inputs you need and so forth. And maybe pulse width 197 00:17:55,700 --> 00:17:59,600 modulation you need. And I'll go a little bit into that. That glowing effect you saw earlier, 198 00:17:59,760 --> 00:18:02,380 that's caused by me using a PC. I'm not going to go into that. I'm going to go ahead and 199 00:18:02,400 --> 00:18:06,340 show you. PWM is pulse width modulation. Essentially what it's doing is it's turning 200 00:18:06,340 --> 00:18:14,200 on and off a particular connection on the chip really fast. And based on how fast you 201 00:18:14,200 --> 00:18:19,640 turn it on and off, you can basically make the LED dimmer or brighter. And I have like 202 00:18:19,640 --> 00:18:23,540 freedom going in there, one for red, one for green, one for blue, so I can simulate 203 00:18:23,540 --> 00:18:27,460 any color I want. And currently I just have it fading through different colors. I'll go 204 00:18:27,460 --> 00:18:29,100 a little bit more into analog in here shortly. 205 00:18:29,800 --> 00:18:32,380 Here is a simple schematic of some of the things that I'm going to show you. I'm going 206 00:18:32,380 --> 00:18:38,420 to show you some of the fucked devices I made. And all you basically see is a set of dip 207 00:18:38,420 --> 00:18:42,400 switches, one side going to ground. So I'm kind of using negative logic to where if it 208 00:18:42,400 --> 00:18:46,780 goes to ground, I'm considering it turned on. It just happens to be easier to wire 209 00:18:46,780 --> 00:18:52,180 that way. And depending on whether or not a dip switch is set or not, I can choose 210 00:18:52,180 --> 00:18:56,920 what I have the tendency to do. That way I can basically have multiple payloads all on 211 00:18:56,920 --> 00:19:00,420 one thing. I don't have to reprogram it every single time I plug into a different machine. 212 00:19:00,420 --> 00:19:07,780 But let's say you have an eight position dip switch. That gives you 256 possible different 213 00:19:07,780 --> 00:19:11,860 programs you can run. That's pretty nifty. Now the other thing you might see here is 214 00:19:11,860 --> 00:19:17,240 I have a symbol for a photo resistor and a 10 kilo ohm resistor. Now here's the way 215 00:19:17,240 --> 00:19:22,460 a photo resistor works. Essentially when light hits it, it gets lower in resistance. 216 00:19:23,040 --> 00:19:28,980 How many people here know Ohm's law, E over IR? This is the crowd for that. Essentially 217 00:19:28,980 --> 00:19:30,400 what happens, whenever that button goes off, it's going to go off. And that's going to 218 00:19:30,420 --> 00:19:33,240 make that voltage, or whenever the resistance drops on that photo resistor because more 219 00:19:33,240 --> 00:19:38,640 light hits it, its resistance lowers so more voltage is actually dropped across that 10 220 00:19:38,640 --> 00:19:42,560 K resistor. Well you see that little line going off in the middle off to I believe 221 00:19:42,560 --> 00:19:49,180 pin number 10? That's when the analog ends. It can measure that voltage change and so 222 00:19:49,180 --> 00:19:52,800 by doing that I can tell how much light is in a room. And I'll show you how I use that 223 00:19:52,800 --> 00:20:00,340 here shortly. Basically this is a better description of how that analog pin bit works. Essentially 224 00:20:00,420 --> 00:20:04,540 it's measuring the amount of voltage by comparison to reference voltage. Let's say my reference 225 00:20:04,540 --> 00:20:10,120 voltage is 5 volts and it's getting 5 volts dropped across that resistor. Well it's going 226 00:20:10,120 --> 00:20:17,940 to read approximately 1023. However, if it's 0 volts, it's going to read 0 and anywhere 227 00:20:17,940 --> 00:20:21,640 in between. So I can use that basically as the basis for knowing how much light there 228 00:20:21,640 --> 00:20:25,440 is. But I don't have to use a photo resistor. I can also use a thermistor so I can do it 229 00:20:25,440 --> 00:20:29,920 by temperature and so forth. Part of the idea of doing all this is I can have my payload 230 00:20:30,420 --> 00:20:35,820 actually fire off whenever the light levels in the office reach a certain level. And we'll 231 00:20:35,820 --> 00:20:41,220 show some of that during the demo. Oh, tensi code. Everybody can read that, right? I've 232 00:20:41,220 --> 00:20:45,140 seen some hideous slideshows. I know I'm a bit on the verbose side with all the stuff 233 00:20:45,140 --> 00:20:49,180 I put in my slides. That's because I want to provide tons of links and more information 234 00:20:49,180 --> 00:20:52,960 for people who want to look at them later. We're going to break this down into smaller 235 00:20:52,960 --> 00:20:58,120 chunks. All right. Here's the header section. Now one of the things I've done is create 236 00:21:00,420 --> 00:21:05,060 — it's a little bit of a pain in the butt to use the direct USB keyboard functionality 237 00:21:05,060 --> 00:21:11,980 in Tensy, so I simplified it somewhat. Essentially here in my header section, I create a couple 238 00:21:11,980 --> 00:21:19,660 of variables, I initialize them, I make sure I set photo read to 0, and I set my DIP switches 239 00:21:19,660 --> 00:21:25,640 and say which DIP switch is which pin on the physical Tensy device. These DIP option, 240 00:21:25,920 --> 00:21:30,240 that's basically something that I use as a comment that I can make — dump out whenever 241 00:21:30,420 --> 00:21:34,160 need it to. Because on these tensies, if I have a nine 242 00:21:34,160 --> 00:21:39,920 position dip switch, I'll forget which dip setting does what. So 243 00:21:39,920 --> 00:21:42,980 essentially I use the little button as a diagnostic tool. I 244 00:21:42,980 --> 00:21:46,340 press it and it tells me which dip selection does what 245 00:21:46,340 --> 00:21:51,160 particular functionality. And I use dip options for that. Here's 246 00:21:51,160 --> 00:21:53,920 the setup routine. Basically it's just going, iterating 247 00:21:53,920 --> 00:21:57,520 through, telling each pin what it wants it to do. And that 248 00:21:57,520 --> 00:22:01,440 minimum wait thing is just me setting up the program to wait a 249 00:22:01,440 --> 00:22:04,580 certain number of minutes. In this case, I'm actually not 250 00:22:04,580 --> 00:22:07,860 using the dip switch to say what program to run, but to set the 251 00:22:07,860 --> 00:22:11,560 number of minutes to wait in binary. But if you're familiar 252 00:22:11,560 --> 00:22:15,260 with C or C++, this is essentially the same thing but a 253 00:22:15,260 --> 00:22:18,780 little bit easier because of the Arduino wrappers obfuscating 254 00:22:18,780 --> 00:22:22,040 some of the more complex issues involved in those languages. 255 00:22:22,580 --> 00:22:23,260 Training wheels. 256 00:22:23,400 --> 00:22:27,280 What was that? Training wheels. Hey, if they help. As long as 257 00:22:27,280 --> 00:22:27,500 they don't perform well. 258 00:22:27,520 --> 00:22:30,640 I feel like I would have been a much better programmer if I 259 00:22:30,640 --> 00:22:35,020 hadn't learned basic first. Kind of makes you lazy for all future 260 00:22:35,020 --> 00:22:40,000 coding. But then we eventually have the actual payload inside 261 00:22:40,000 --> 00:22:42,680 the loop. This is basically the thing that gets done over and 262 00:22:42,680 --> 00:22:46,780 over and over again. Think of it as your main function. In this 263 00:22:46,780 --> 00:22:49,760 particular one, it delays a little bit of time after the 264 00:22:50,440 --> 00:22:53,360 conditions are met. And what it ends up doing is it uses my 265 00:22:53,360 --> 00:22:57,200 library, which has something called command at run bar, and 266 00:22:57,200 --> 00:23:00,040 it runs this command. That's a really simple Windows command. 267 00:23:00,160 --> 00:23:02,620 Everybody knows that one, right? Let me break it down for you. 268 00:23:02,820 --> 00:23:07,740 Essentially, it opens up command exe, does a for loop, looking 269 00:23:07,740 --> 00:23:12,300 through the output of the WMIC command. The WMIC command, it's 270 00:23:12,300 --> 00:23:15,960 inside of all that junk, is looking for a disk that's a USB 271 00:23:15,960 --> 00:23:20,320 disk. What it does then is it gets that output, finds out 272 00:23:20,320 --> 00:23:23,960 which disk has a certain label, in this case, my thumb. Because 273 00:23:23,960 --> 00:23:26,620 basically when you plug in a thumb drive, you don't necessarily 274 00:23:26,620 --> 00:23:27,180 know for sure. You don't know for sure. You don't know for sure. 275 00:23:27,540 --> 00:23:31,460 On a victim system, what drive load it's going to get. That 276 00:23:31,460 --> 00:23:35,060 first part finds out that drive letter for you. Then it fires off 277 00:23:35,060 --> 00:23:38,600 a script off of that drive letter. Trust me, it all works. 278 00:23:38,780 --> 00:23:41,980 This part, I believe, is in the slides you have. Try it out. 279 00:23:42,020 --> 00:23:44,960 Trust me, it seems to work pretty well. And this way, you 280 00:23:44,960 --> 00:23:47,820 don't have to code in, go to a certain drive to run something 281 00:23:47,820 --> 00:23:50,080 or copy stuff to a certain drive because you're not going to know 282 00:23:50,080 --> 00:23:52,580 what drive it is until you actually plug it in. You can use 283 00:23:52,580 --> 00:23:56,180 this little bit of scripting to find it by its volume label. And 284 00:23:56,180 --> 00:23:59,300 it does its thing and it shrinks down the current window. 285 00:23:59,520 --> 00:24:03,420 That's right after the delay 10. The delay 10 basically means 286 00:24:04,400 --> 00:24:10,700 delay 1,000 milliseconds, so one second. In the fucked library, 287 00:24:11,000 --> 00:24:14,880 I've implemented a few different commands. One is command at run 288 00:24:14,880 --> 00:24:18,740 bar and then whatever operating system. I haven't done OS 10 289 00:24:18,740 --> 00:24:21,480 yet. That's why the X is there. That could be either MS Windows 290 00:24:21,480 --> 00:24:23,900 or it could be Linux in GNOME. 291 00:24:26,180 --> 00:24:29,780 Same thing for shrink current window. Basically the idea is you 292 00:24:29,780 --> 00:24:32,580 can file something off the run and then you shrink the window so 293 00:24:32,580 --> 00:24:34,340 they don't necessarily see what you've got going on in the 294 00:24:34,340 --> 00:24:37,740 background. Press and release. Essentially this makes it a 295 00:24:37,740 --> 00:24:40,320 little bit easier to say take this one key, press it several 296 00:24:40,320 --> 00:24:43,420 times. If you want to get around in Windows and if you, like, 297 00:24:43,440 --> 00:24:46,120 open up a web browser and want to do something to someone's 298 00:24:46,120 --> 00:24:48,920 account someplace, generally it's best to get around with key 299 00:24:48,920 --> 00:24:51,920 presses rather than mouse events. So you can use this to, 300 00:24:51,980 --> 00:24:55,220 like, hit tab, tab, tab, tab, tab to get whatever field you 301 00:24:55,220 --> 00:24:55,960 actually need to get to. 302 00:24:56,180 --> 00:25:01,220 All right. Show dialogue. Essentially this function just 303 00:25:02,100 --> 00:25:07,280 sends diagnostic information out. I use this for debugging my 304 00:25:07,280 --> 00:25:10,580 programs. Essentially it reads through the pins, tells me what 305 00:25:10,580 --> 00:25:16,640 the current value is, also tells me what DIP settings I have for 306 00:25:16,640 --> 00:25:19,980 which particular premade payloads, all those sorts of 307 00:25:19,980 --> 00:25:23,480 things. And DIP options is that variable I mentioned before that 308 00:25:23,480 --> 00:25:25,540 actually gets printed out by show options. 309 00:25:28,960 --> 00:25:33,560 A few things I have implemented in there. Another thing is I have 310 00:25:33,560 --> 00:25:38,080 something called LED keys. This particular function basically 311 00:25:38,080 --> 00:25:44,000 just tells you which lock keys are down. For instance, scroll 312 00:25:44,000 --> 00:25:49,880 lock, caps lock, or num lock. And see, the next thing with 313 00:25:49,880 --> 00:25:52,440 this is there's not a whole lot of communication that comes back 314 00:25:52,440 --> 00:25:56,160 from the computer to the keyboard. But especially if I'm 315 00:25:56,180 --> 00:25:58,820 trying to start doing things on this one keyboard and this is a 316 00:25:58,820 --> 00:26:03,060 separate entity completely. However, whenever you use caps 317 00:26:03,060 --> 00:26:06,580 lock, scroll lock, or num lock, that message gets sent to 318 00:26:06,580 --> 00:26:11,060 everybody. So you can do what's I sometimes refer to as like a 319 00:26:11,060 --> 00:26:13,680 caps lock trap. Basically you turn on caps lock to be annoying 320 00:26:13,680 --> 00:26:15,940 using your Tensey and you know someone's at the station 321 00:26:15,940 --> 00:26:18,560 whenever they turn caps lock back off. And you can detect that 322 00:26:18,560 --> 00:26:22,040 with the Tensey. And you can use LED keys for that. Or I have a 323 00:26:22,040 --> 00:26:26,140 couple little Boolean functions that basically say is num lock on. 324 00:26:26,180 --> 00:26:29,920 Is caps lock on. Is scroll lock on. So basically all my stuff 325 00:26:29,920 --> 00:26:33,280 there is just to make it more convenient to create these fuck 326 00:26:33,280 --> 00:26:36,520 devices. If you want more information on this, tomorrow 327 00:26:37,600 --> 00:26:40,620 Dave Kennedy, also known as Relic, and Josh Kelly, also 328 00:26:40,620 --> 00:26:43,500 known as Winfang, are going to be giving a presentation on 329 00:26:43,500 --> 00:26:45,800 PowerShell. And they're going to go into some more advanced 330 00:26:45,800 --> 00:26:48,920 things you can do with a Tensey. So they're doing some more 331 00:26:48,920 --> 00:26:51,200 complex things than the one we're showing here. For example, 332 00:26:51,260 --> 00:26:53,740 I think they have some kind of like reverse shell they do out of 333 00:26:53,740 --> 00:26:55,880 PowerShell. So it should be pretty nifty. 334 00:27:00,180 --> 00:27:03,020 All right. Setting up the development environment. It is 335 00:27:03,020 --> 00:27:08,180 incredibly simple to set up. Let me go ahead and start this up. 336 00:27:14,260 --> 00:27:17,660 Hopefully this plays correctly. Essentially I've already 337 00:27:17,660 --> 00:27:22,460 downloaded the Arduino environment. Also, Paul, the 338 00:27:22,460 --> 00:27:26,040 guy who makes the Tenseys, has his own little special extra 339 00:27:26,180 --> 00:27:29,680 libraries and hardware specifications you have to put 340 00:27:29,680 --> 00:27:34,220 into the Arduino folder. So once you zip all those out together, 341 00:27:35,100 --> 00:27:37,220 you pretty much will have a working programming environment. 342 00:27:37,700 --> 00:27:40,000 The first thing I have to do right here is I have to install 343 00:27:40,000 --> 00:27:43,480 a driver for cereal. Sometimes people ask me if you need a 344 00:27:43,480 --> 00:27:46,500 driver install when they want it to work. No, you don't. However, 345 00:27:46,740 --> 00:27:52,240 to program it, sometimes you do. So I'm installing this so I can 346 00:27:52,240 --> 00:27:55,960 program it. This driver is not needed on the victim machine. Just 347 00:27:56,180 --> 00:28:00,120 for the sake of setting up my development environment. Also, I'm going to the device 348 00:28:00,120 --> 00:28:05,240 manager to find out what com port it is. That just makes it easier for me to do diagnostics 349 00:28:05,240 --> 00:28:13,100 and set things up. Eventually I'm going to find out the com port so I can set up my adrenal 350 00:28:13,100 --> 00:28:20,980 environment. For some reason I think I had to install that driver twice to actually make 351 00:28:20,980 --> 00:28:42,820 it function. And eventually it works. Okay. After I got all that done, I've already unzipped 352 00:28:42,820 --> 00:28:47,180 my adrenal environment. I'm going to go ahead and I think the next thing I did was I go 353 00:28:47,180 --> 00:28:50,960 into lib and I put in my ‑‑ I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. 354 00:28:50,960 --> 00:28:54,720 The latency loader, that's an extra EXE you can download from Paul's site. Essentially 355 00:28:54,720 --> 00:28:59,560 it's used for programming the latency. After you install it, essentially you can just press 356 00:28:59,560 --> 00:29:02,800 the button that's on the latency itself, that little black button you saw in some of the 357 00:29:02,800 --> 00:29:07,880 pictures, and it will automatically load code from the machine. Also, right here, I'm 358 00:29:07,880 --> 00:29:13,200 putting the adrenal extra hardware specifications and putting it towards my adrenal 359 00:29:13,200 --> 00:29:18,600 development folder so it knows what kind of board I have. With the adrenal environment you 360 00:29:18,600 --> 00:29:20,860 can program for a lot of different microcontrollers that are 361 00:29:20,860 --> 00:29:27,540 based around Adreno. The main Adrenos, there's like several different generations and a couple 362 00:29:27,540 --> 00:29:31,600 different types of Tensys and whatnot, which is why you have to install that so it knows 363 00:29:31,600 --> 00:29:38,460 about your hardware. At this point, I'm actually going to take my library, which is downloadable 364 00:29:38,460 --> 00:29:43,460 from my website, and copy it into the libraries folder. And it actually comes along with some 365 00:29:43,460 --> 00:29:47,460 examples so you can look at them and see how to do some of the stuff I'm going to be showing 366 00:29:47,460 --> 00:29:48,440 here shortly in the demo. 367 00:29:50,860 --> 00:29:55,300 At this point, whenever I want to actually program the Tensy, I just have the Tensy loader up and running, 368 00:29:56,560 --> 00:30:07,780 and I can load up Adreno. The code is fairly simple. I spent an inordinate amount of my life watching a blue 369 00:30:07,780 --> 00:30:12,740 line across the screen and I come to realize. All right, I'm going to open up one of the sample programs. 370 00:30:22,320 --> 00:30:29,360 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 371 00:30:29,360 --> 00:30:35,780 And it will load that program and it should be good to go. Also, not only what board type you 372 00:30:35,780 --> 00:30:40,700 have to tell it but also what kind of USB device you want to emulate. Paul set it up so you can emulate 373 00:30:40,700 --> 00:30:44,740 the different USB devices. For instance, you can do a keyboard mouse, but you can also do like 374 00:30:44,740 --> 00:30:50,840 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. 375 00:30:50,840 --> 00:30:54,720 functionality at all. That's not something to be used in this project. But for future 376 00:30:54,720 --> 00:31:00,560 projects I want to do, I think I might very well be using that functionality. I want to 377 00:31:00,560 --> 00:31:04,800 make my own ‑‑ who has seen aliens? You got a little sentry gun that shoots all the 378 00:31:04,800 --> 00:31:08,700 aliens? I want to make a zombie defense gun that does much the same thing. I want a heat 379 00:31:08,700 --> 00:31:13,700 sensor. I want it to detect motion. And then I want it to say, okay, is it hot or not? If 380 00:31:13,700 --> 00:31:19,040 it's cold and it's moving, it's a zombie. Fire. So I'm thinking about using the serial 381 00:31:19,040 --> 00:31:23,660 interface stuff for that. But once I have all those settings in, I tell it what com port I'm 382 00:31:23,660 --> 00:31:30,940 using, I compile it, and I go. And hopefully it gets more interesting from here, but I want 383 00:31:30,940 --> 00:31:34,240 people to know how simple it was to set up the environment. And the Arduino programming 384 00:31:34,240 --> 00:31:38,620 language, you saw my examples up there. Once you go through them a little bit, they're 385 00:31:38,620 --> 00:31:42,880 really not hard to follow at all. At least in my personal opinion. Now let's do a little bit 386 00:31:42,880 --> 00:31:49,020 of a device demo. I currently have a few devices that I'm going to show you. I'm going to 387 00:31:49,040 --> 00:31:55,780 show you some of the different devices set up. You saw, okay, you saw this one here a second 388 00:31:55,780 --> 00:32:02,020 ago. This is a mouse I have Trojan with some extra storage and a hub inside. Did some 389 00:32:02,020 --> 00:32:07,340 soldering, put the Tensy in there. And essentially it's made to be as a gag gift. I mean, it 390 00:32:07,340 --> 00:32:12,260 does all these pretty color things and so forth. But I can set it to go off via the caps lock 391 00:32:13,680 --> 00:32:18,500 trap. Instead of using caps lock for the sake of this video, what I've done is set it up to go off 392 00:32:18,500 --> 00:32:22,420 whenever it sees scroll lock hit. Because it's, you know, anymore, people don't use scroll lock, 393 00:32:22,500 --> 00:32:25,820 at least I don't, a whole lot. I'm going to have to put down the microphone to actually do this, 394 00:32:25,820 --> 00:32:33,480 though. But I could easily be caps lock or num lock. And essentially it will just sit there and 395 00:32:33,480 --> 00:32:39,820 wait for that to fire off. And when it sees that that value has changed, try that again. 396 00:32:48,500 --> 00:32:55,540 Hopefully it's supposed to be seeing that it's changed. It's possible I'm in live demo hell 397 00:32:55,540 --> 00:33:03,960 again. Anyway, it sits there and waits for the keyboard to have some change in value. And once it 398 00:33:03,960 --> 00:33:15,280 does, fires off its payload. I'll give this one more shot before I, there you go. It just fired it 399 00:33:15,280 --> 00:33:18,480 off in the background. And I'm going to give it another shot. I'm going to give it another shot. 400 00:33:18,480 --> 00:33:24,660 It started copying all the files on my desktop to the onboard storage. And it then shrank down 401 00:33:24,660 --> 00:33:28,460 the current active window. Which I screwed up by clicking on the wrong window right afterwards. 402 00:33:28,800 --> 00:33:33,140 But if I go back here and bring that window back up, what it basically did was fire off a script 403 00:33:33,140 --> 00:33:38,880 on the onboard thumb drive to start copying everything from my desktop, which might have 404 00:33:38,880 --> 00:33:42,780 interesting information, to the onboard storage. Then the person can come around later on and 405 00:33:42,780 --> 00:33:48,460 collect this device. And the scripts I've written for that are fairly easy. They're pretty easy. 406 00:33:48,480 --> 00:33:56,760 But essentially what it does is we're the current logged in user. It creates some extra folders on 407 00:33:56,760 --> 00:34:02,000 the drive. And for instance, I was logged into a different name, it would make a different folder. 408 00:34:02,060 --> 00:34:07,120 And that folder would contain all the stuff off the person's desktop. So that's one example of a 409 00:34:07,120 --> 00:34:14,720 payload. And that's one I use that I can trigger via scroll lock and whatnot. Let me back up a 410 00:34:14,720 --> 00:34:18,460 little bit. Now, a more interesting one, and one I have more advanced payloads for. I'm going to show 411 00:34:18,480 --> 00:34:24,920 is this little device. Now, this one I used a 10 C++ on just because I wanted, well, because Paul 412 00:34:24,920 --> 00:34:33,360 sent me one and I could attach more pins to it. So let me go ahead and bring this one up. I'm 413 00:34:33,360 --> 00:34:45,380 assuming this mic is live also. Groovy. All right. Now, for these demos, I've set things up to 414 00:34:48,480 --> 00:34:54,220 where I use this one button to trigger everything. Not because I have to. In real life, you'd want to 415 00:34:54,220 --> 00:34:59,580 have either it's fire off by timer, by lighting conditions, or as Mr. Elkin showed just a bit ago, 416 00:34:59,760 --> 00:35:04,180 feel like an RF trigger. But for the sake of demoing at DEF CON, I figured it would be easier 417 00:35:04,180 --> 00:35:09,620 for me to know exactly when my demo code was going to run by setting this button. I also have a 418 00:35:10,120 --> 00:35:17,980 9-pin dip switch on this thing. I can set to 512 different possible programs using that. But I 419 00:35:17,980 --> 00:35:23,840 pretty much have each individual dip set to do one particular function. Just for convenience. Now, 420 00:35:23,900 --> 00:35:29,880 I mentioned that show diagnostics. That's what I have basically set on the first pin. The reason I 421 00:35:29,880 --> 00:35:36,200 have it that way is I can sit there and look and it makes it quick for me to figure out what might 422 00:35:36,200 --> 00:35:41,860 be going wrong with my program based on the current value of each pin and what the analog value 423 00:35:41,860 --> 00:35:46,660 is. This one has a little photo resistor that I mentioned before. And I'll show how we're using 424 00:35:46,660 --> 00:35:47,380 that here in a bit. 425 00:35:47,980 --> 00:35:51,820 But the most important thing is I keep forgetting what particular functionality I have on which 426 00:35:51,820 --> 00:35:59,180 pin. So I went ahead and added these comments in there. And pin one is show dialogue. But let's 427 00:35:59,180 --> 00:36:06,020 use some of the other ones. Pin two is go to my website. Let me hope that I actually have an 428 00:36:06,020 --> 00:36:14,720 Internet connection here. And let's also hope that Chris Paget hasn't figured out CDMA hacking yet. 429 00:36:18,340 --> 00:36:24,720 All right. Let's see if this is epic fail or not. It's acting like it's connecting to something. 430 00:36:26,360 --> 00:36:32,160 All right. In theory, that should open up a web browser. Oh, I'm sorry. That first one is not open 431 00:36:32,160 --> 00:36:38,320 up a web browser. The first one is open up notepad and say Aiden was here. That's a fairly simple 432 00:36:38,320 --> 00:36:43,900 thing to do. Essentially just use that command, open a command bar and run something, function 433 00:36:43,900 --> 00:36:47,960 that I mentioned before. Let's go ahead and try dip position three. Let's go ahead and try dip position three. 434 00:36:47,980 --> 00:36:54,740 That one opens up the web browser and goes to imgeek.com which may or may not fail depending on 435 00:36:54,740 --> 00:36:59,920 whether or not I have an active Internet connection right now. I appear to. Now you can use this for 436 00:36:59,920 --> 00:37:06,560 like if you notice a drive by zero day out there, you can have it set to automatically go out to 437 00:37:06,560 --> 00:37:10,280 some website. Also if you wanted to go out to some website and start uploading stuff on the person's 438 00:37:10,280 --> 00:37:15,780 machine, you would use that kind of functionality. But I'm going to shrink that down right now. And 439 00:37:15,780 --> 00:37:17,940 let's go to the next thing. Oh, set to zero. All right. Let's go to the next thing. Oh, set 440 00:37:17,980 --> 00:37:24,460 caps lock trap. I'm going to turn off that one, turn on number four. Essentially what this does is 441 00:37:24,460 --> 00:37:29,260 it starts annoying the user until they turn caps lock off. Then you know for sure someone is 442 00:37:29,260 --> 00:37:34,320 actually at the keyboard. So let me fire off the caps lock trap. All right. I'm just the average 443 00:37:34,320 --> 00:37:39,940 user typing along, hey, I'm shouting at everybody. What am I supposed to do? All right. So I turn 444 00:37:39,940 --> 00:37:47,960 off caps lock. And it fires off the script that I had set. All right. Now I'm going to go back to 445 00:37:47,980 --> 00:37:52,880 Facebook. And essentially it just tells you what it could have done. And I have word wrap turned 446 00:37:52,880 --> 00:37:58,520 off so you don't see it all. But just type something different into notepad. All right. Let's 447 00:37:58,520 --> 00:38:03,680 see if we have anything else more interesting than that. Ooh. It would be more interesting if 448 00:38:03,680 --> 00:38:10,540 it was a bank account. But, you know, Facebook will work also. All right. This one, essentially 449 00:38:10,540 --> 00:38:14,080 what it's going to do is it's going to open up the mobile version of Facebook. It was just so 450 00:38:14,080 --> 00:38:17,900 much easier to script the right number of tabs to get to the right spot in the forms if I use 451 00:38:17,980 --> 00:38:23,240 the mobile version because it's just a lot less complex to look at. Essentially you can have this 452 00:38:23,240 --> 00:38:26,740 paid off, go off by time or some other thing like the light functionality I'm going to show 453 00:38:26,740 --> 00:38:32,000 shortly. It goes out to Facebook, hits the right number of tabs, gets itself to the right 454 00:38:32,000 --> 00:38:37,780 position and makes a post. It could be some other kind of transaction as well. But I just 455 00:38:37,780 --> 00:38:45,880 happened to decide to do Facebook. Thank you. Let me see. What's the other one I had on there? 456 00:38:48,880 --> 00:38:55,160 This is just to get your brain working on what you could possibly use this for. Oh. Define my 457 00:38:55,160 --> 00:39:00,340 drive by its name, my thumb and start copying stuff to it. I pretty much always show that with 458 00:39:00,340 --> 00:39:06,200 the Trojan mouse. I think Dave and Josh tomorrow may have a Trojan keyboard they'll be bringing 459 00:39:06,200 --> 00:39:09,200 with them. I'm not sure. I haven't actually seen the presentation yet because I didn't go to 460 00:39:09,200 --> 00:39:15,160 Black Hat. And I got there a little bit late for B-Sides. All right. Brightness detection. Oh, 461 00:39:15,160 --> 00:39:16,860 yeah. That one's fun. We'll go ahead and do that one. 462 00:39:17,980 --> 00:39:32,740 7, 7, 7, 7, 7. All right. For that, I'm going to need some freaking lasers. With no 463 00:39:32,740 --> 00:39:37,700 sharks necessarily attached. Though if anybody happens to have any sharks in the audience, bring 464 00:39:37,700 --> 00:39:42,520 them on up and we can try. All right. Essentially the light detection just detects the amount of 465 00:39:42,520 --> 00:39:45,840 light in the area. I was telling you you could trigger it by environmental conditions. This 466 00:39:45,840 --> 00:39:47,960 could also be like a thermistor and you could do it with a light detector. You could also do it 467 00:39:47,980 --> 00:39:53,760 via heat. But essentially I press the button and it says the lights seem to be on because I'm 468 00:39:53,760 --> 00:40:00,860 sitting here in a fairly brightly lit section of the room. I'm going to cover the photoresistor, do 469 00:40:00,860 --> 00:40:15,620 it again. Let's try this again. You know, it's distinctly possible that I destroyed something in 470 00:40:21,960 --> 00:40:32,280 here. It happens. That's why it's always good to bring backup. Hold on a second. 471 00:40:42,940 --> 00:40:46,580 Hopefully I have the exact same program loaded on this particular unit. 472 00:41:03,080 --> 00:41:07,920 Oh, another thing I've been doing is making those little Trojan devices. You can see the little 473 00:41:07,920 --> 00:41:14,620 things flashing. This is the unit that I recently was at a meeting with tenacity and I had this 474 00:41:14,620 --> 00:41:17,960 embedded in a wolf's head because the logo is a wolf. So I'm going to go ahead and do that. I'm 475 00:41:17,980 --> 00:41:22,480 going to put this in the eyes and make it flash and so forth. But hopefully I have all the right 476 00:41:22,480 --> 00:41:31,700 stuff set in it to act as a demo for this. Let's go ahead and one. All right. Brightness 477 00:41:31,700 --> 00:41:36,580 detection. Yes, that's number seven on this particular unit. Let's see if this one blows up in 478 00:41:36,580 --> 00:41:44,840 my face or not. All right. Brightness detection. Do it. Lights are on. That's expected. 479 00:41:48,000 --> 00:41:55,440 I'm scared of the dark because I got it covered. It's possible I even have an open and a short on 480 00:41:55,440 --> 00:41:59,500 that. It's causing that analog read to always read the same thing. I may have screwed that up and 481 00:41:59,500 --> 00:42:05,700 jostling it around on the plane here. And that was light to dark and let's get a little bit more 482 00:42:05,700 --> 00:42:06,040 creative. 483 00:42:20,040 --> 00:42:25,420 And that's why it's always good to bring back up. But I also have a payload on there. I think you 484 00:42:25,420 --> 00:42:30,400 may have saw that one in the listing when I did my diagnostic called motion sensor. And essentially 485 00:42:30,400 --> 00:42:35,700 all it's doing is using the photo resistor where it sees a change in the value of light. Because 486 00:42:35,700 --> 00:42:39,900 generally, you know, if someone moves, a shadow happens, something gets rearranged, light reflects 487 00:42:39,900 --> 00:42:47,840 differently. It's a great way to detect motion. So when it detects some kind of change, it should 488 00:42:47,980 --> 00:42:54,320 ‑‑ oh, actually, I have the wrong one there. I'm not using all the nine pins on this one. 489 00:42:57,860 --> 00:43:02,280 Motion detected. You can have it fire off some other payload. The payload I have just types out into 490 00:43:02,280 --> 00:43:07,000 notepad. But you can just as easily have it add an account, make one of those transactions I 491 00:43:07,000 --> 00:43:12,100 mentioned before. Just a ton of different things. All right. I'm going to unplug that bad boy. 492 00:43:13,220 --> 00:43:16,140 And now we can go back to the slide part. 493 00:43:17,980 --> 00:43:26,540 Assuming I can find it amongst all the windows that I now have open. There we go. All right. 494 00:43:27,840 --> 00:43:32,780 Demo units. The first time I made a demo unit, and anybody that wants to see these after the main 495 00:43:32,780 --> 00:43:37,940 part of the talk, come on up and I'll show them to you. First one I made was an Altoids 10. And 496 00:43:37,940 --> 00:43:42,440 I've also tried directly soldering the dip switches onto the 10C. But that makes it hard to 497 00:43:42,440 --> 00:43:47,040 repurpose. And I like to use my 10C for other things like ‑‑ ten minutes. Thank you. 498 00:43:47,980 --> 00:43:52,620 I like to use it for other purposes like controlling servos and whatnot. So I decided to start doing 499 00:43:52,620 --> 00:43:58,800 these things like shields. Essentially I make it so I can just solder on sockets. Not to mention 500 00:43:58,800 --> 00:44:03,700 sockets are much cheaper. I'd much rather burn out a $30 ‑‑ sorry, $30 component than like an 501 00:44:03,700 --> 00:44:08,680 $18 component. So I solder those on and I can actually start making shields that can pop on and 502 00:44:08,680 --> 00:44:13,900 off for different functionality. Like you see right here. Oh, by the way, that adapter I got, I 503 00:44:13,900 --> 00:44:17,960 think it's the same adapter that Mr. Elkins was using. It's the same adapter that Mr. Elkins was 504 00:44:17,980 --> 00:44:22,220 using. Got it from Dill Extreme for dirt cheap. It's about the smallest one I can find. If you 505 00:44:22,220 --> 00:44:25,600 break it apart, you can actually make it a little bit smaller by getting rid of that plastic casing. 506 00:44:26,280 --> 00:44:32,560 Also, I have versions that ‑‑ there is an SD card adapter so you can make it read a micro SD 507 00:44:32,560 --> 00:44:39,480 card and use that instead of any kind of flash drive. The problem is the 10C operates at 1.1 USB 508 00:44:39,480 --> 00:44:42,960 speeds, which is perfectly fine for a mouse and keyboard. It's not going to be going any faster 509 00:44:42,960 --> 00:44:47,960 than that anyways. But it is kind of a limitation for micro SD. Don't be afraid to use it. It's 510 00:44:47,960 --> 00:44:50,200 going to be great. I'm hoping that Paul is going to implement some more stuff with the lower 511 00:44:50,200 --> 00:44:55,500 level of the 10C so you can start using it for, like, pulling up password lists and whatnot. 512 00:44:57,120 --> 00:45:01,940 Beyond the dipstick, I've been talking about Trojan USB devices. I've always showed you the 513 00:45:01,940 --> 00:45:10,360 mouse. I've been working on ‑‑ okay, Tenacity's logo is this howling wolf. And while I was at a 514 00:45:10,360 --> 00:45:15,440 recent meeting, they gave me this cool little plush stress toy. But it was hard to fit all my 515 00:45:15,440 --> 00:45:17,940 electronics in it. So I've been trying to get better at sculpting. I've been trying to get better at 516 00:45:17,960 --> 00:45:20,680 sculpting. So let me see if I can put this guy back together with a function. 517 00:45:29,260 --> 00:45:32,180 So I have a 50‑50 chance of hooking this thing up right. 518 00:45:48,540 --> 00:45:52,260 All right. Someone come up to me later on. I think I got it with me. Who has ever seen 519 00:45:52,260 --> 00:46:00,000 Army of Darkness or Evil Dead 2 or one of those movies? I have a Necromonicon-styled iPod touch 520 00:46:00,000 --> 00:46:08,000 cover. Unfortunately, I haven't got the finger biting part done yet. That's going to have to 521 00:46:08,000 --> 00:46:12,560 require a few servos and some extra electronics. But we'll talk about it later. All right. 522 00:46:12,560 --> 00:46:17,940 Here's my little Tenacity wolf I tried to sculpt. And I've essentially used RGB LED lights. 523 00:46:17,960 --> 00:46:23,720 And I can actually change those programmatically. So if I want to make a more advanced version of 524 00:46:23,720 --> 00:46:27,940 this, I could make it like the Navs tag. That's that little rabbit you see right there that gives 525 00:46:27,940 --> 00:46:31,040 you extra information about what's going on in the computer, like is there new e‑mails or 526 00:46:31,040 --> 00:46:35,560 whatnot. Well, I can make the eyes change different colors based on what's going on in the 527 00:46:35,560 --> 00:46:40,420 computer system. But to do that, I need extra software installed. So when you're socially 528 00:46:40,420 --> 00:46:44,700 engineering someone to install these things, you can say, yeah, I've got this cool desktop toy 529 00:46:44,700 --> 00:46:47,940 for you. It does extra things for your computer. But you've got to install this extra software. 530 00:46:47,960 --> 00:46:53,800 Along with it. I'm not much of a social engineering. I mean, I leave that to people like Dave 531 00:46:53,800 --> 00:46:59,440 Kennedy and Chris Nicholson and the guys on the social engineering podcast. It's been said before 532 00:46:59,440 --> 00:47:04,960 that I use my personality as birth control. Not to mention my accent kind of gives me away if I'm 533 00:47:04,960 --> 00:47:10,500 talking on the phone to somebody. But social engineering with Trojan devices or beware of 534 00:47:10,500 --> 00:47:16,500 geeks bearing gifts is another option. I'm going to start speeding up through this. This is 535 00:47:17,960 --> 00:47:23,800 that mouse I was showing off earlier. If I can get this to play. Essentially I've just 536 00:47:23,800 --> 00:47:31,620 soldered in the 10 C, a little hub so I can still get USB 2 speeds on onboard storage. And the 537 00:47:31,620 --> 00:47:38,120 thumb drive I have in here isn't exactly a thumb drive. It's essentially a micro SD card adapter. 538 00:47:38,580 --> 00:47:42,700 And you'll see it behind everything else. There's that little RGB LED which I basically just have 539 00:47:42,700 --> 00:47:46,540 set to iterate through colors to make it pretty. But I could program it to do something more 540 00:47:46,540 --> 00:47:52,400 advanced if I really, really want to. But that's essentially how this one's built. And if 541 00:47:52,400 --> 00:47:58,680 anybody wants to see it in the Q&A room, feel free to come on up. Oh, another thing I made. I'm 542 00:47:58,680 --> 00:48:02,900 not much of a sculptor. I'm getting better at it. For some reason I can sculpt skulls. I don't 543 00:48:02,900 --> 00:48:07,220 know why. So this is another little Trojan device that you can give to someone as a cube toy. 544 00:48:07,620 --> 00:48:14,880 Basically it's a little skull that the eyeballs flash different colors. Eventually. There we go. 545 00:48:16,540 --> 00:48:20,260 And it looks nifty. That one I made out of something called shape lock which I'll talk a little 546 00:48:20,260 --> 00:48:25,760 bit more in a second. All right. Is it more likely than you think? All right. 547 00:48:26,360 --> 00:48:33,440 There's also the cool things out there for making these kind of Trojan toys. Shape lock is the 548 00:48:33,440 --> 00:48:37,160 first thing I want to mention. Shape lock is five minutes. Thank you. Shape lock is this cool 549 00:48:37,160 --> 00:48:41,940 stuff. I believe the guy before me mentioned it as well. Essentially you put it in boiling water. 550 00:48:42,020 --> 00:48:46,080 It melts down. It becomes very flexible. You can mold it into whatever you like. But then when it 551 00:48:46,540 --> 00:48:51,100 gets hard it becomes like hard plastic nylon. It's very, very tough stuff. And that's what that 552 00:48:51,100 --> 00:48:57,060 skull you saw a second ago is made of. Also, LEDs don't always look the best if it's a raw LED 553 00:48:57,060 --> 00:49:01,380 because you can see the individual elements in it. But if you diffuse them, if you basically put 554 00:49:01,380 --> 00:49:05,060 the light through something, it actually looks better. And shape lock is really good as a 555 00:49:05,060 --> 00:49:10,520 diffusing substance. Two-part silicone putty. Some of the stuff I've sculpted myself. Some other 556 00:49:10,520 --> 00:49:15,940 stuff like my little penguin here. I basically found someone else's penguin toy, cast it with this 557 00:49:16,540 --> 00:49:21,900 silicone putty, and then I could keep casting more and more of the same toy to use as packaging 558 00:49:21,900 --> 00:49:29,460 for my devices. If you're really lazy, go to like a hobby store. Cake, soap, and candy molds also 559 00:49:29,460 --> 00:49:33,960 work very well. So, for instance, if you know your target is very religious, you can go out there 560 00:49:33,960 --> 00:49:39,860 and find like a soap mold that is made like a crucifix or a cross or a Star of David, which 561 00:49:39,860 --> 00:49:46,420 brings up the subject, why would someone want to use a cross as a soap mold? I mean, I've seen 562 00:49:46,540 --> 00:49:52,280 it. It was in the store. I'm not sure why. But, I mean, that's an option for making toys to hand 563 00:49:52,280 --> 00:49:57,100 to people. Silicone caulk also will work as a casting agent, but you don't get very good definition 564 00:49:57,100 --> 00:50:01,040 and it's kind of messy and you've got to use water with it to get it to set within a reasonable 565 00:50:01,040 --> 00:50:05,360 amount of time. Polymer clay, which is what I sculpted the wolf head over here out of, 566 00:50:05,420 --> 00:50:09,140 was very easy stuff to work. Kind of looks like the opposite of shape lock. You basically bake it 567 00:50:09,140 --> 00:50:15,160 and it becomes hard and tough. And then you can use that to cast other items, which is some of the 568 00:50:15,160 --> 00:50:20,480 things I've done. Hot glue also works as a casting agent and it's really good at diffusing light. 569 00:50:21,380 --> 00:50:25,880 And fishing lures. A lot of these rubbery substances I've been messing around with are actually 570 00:50:25,880 --> 00:50:31,060 made out of melted down fishing lure. It gives this really cool, funny texture and it's really 571 00:50:31,060 --> 00:50:36,140 easy to cast and once it comes out, it's awesome. And it's fairly heat tolerant. You've got to get 572 00:50:36,140 --> 00:50:41,380 it fairly hot to actually melt it. Unlike shape lock, shape lock, I made the mistake of leaving 573 00:50:41,380 --> 00:50:45,140 something I made on the dashboard of my car. And a hot glue, it's really easy to cast and it's 574 00:50:45,160 --> 00:50:50,000 not summer day, black Honda fit. It wasn't a pretty sight. But here's a bunch of stuff I've 575 00:50:50,000 --> 00:50:54,680 been casting. I'm going to start speeding this up because I don't want to run out of time. 576 00:50:55,120 --> 00:50:58,560 Now, there's various things you can do to protect against these kind of fuck devices. For 577 00:50:58,560 --> 00:51:03,960 instance, Windows 7 Vista has a ton of things in group policy that you can go in and set. And 578 00:51:03,960 --> 00:51:08,020 there's more information in that particular URL and that part is in the slides that are on your 579 00:51:08,020 --> 00:51:15,140 CD and I'm going to have it out on my website before long. Also, basically it manipulates data 580 00:51:15,160 --> 00:51:19,080 with these particular registry keys. So you can basically go in there and say, don't 581 00:51:19,080 --> 00:51:23,000 automatically install any USB device. And that's the safest bet. You can also go in and say, don't 582 00:51:23,000 --> 00:51:29,220 install this particular vendor ID and product ID, which is how you can kind of like a or all 583 00:51:30,520 --> 00:51:35,760 these USB devices have vendor IDs and product IDs and you can black list those. But you can also 584 00:51:35,760 --> 00:51:39,460 on the 10Z set them to whatever you like. You can tell it's an Apple keyboard if you want. So 585 00:51:39,460 --> 00:51:44,120 that doesn't do you any good. I usually set mine, I think my vendor ID is usually 1313 and my 586 00:51:44,120 --> 00:51:49,400 product ID is like 666. But you can have it whatever you want. If you want a ton more 587 00:51:49,400 --> 00:51:53,240 information on how these work, I wrote an article recently where I go through step-by-step and 588 00:51:53,240 --> 00:51:57,000 describe each one of these group policy settings. It's out on my website and it's near the top of 589 00:51:57,000 --> 00:52:02,360 the list if you go to the front page and look at the history. Also, if you're using Linux, look in 590 00:52:02,360 --> 00:52:06,080 the U Dev rules. I haven't looked into them enough myself, but there should be ways of doing much 591 00:52:06,080 --> 00:52:12,900 the same thing in Linux. The OS 10 people, I don't care about you all. No one laughed at that? 592 00:52:13,460 --> 00:52:14,100 I'm going to get fired. 593 00:52:18,080 --> 00:52:21,700 Okay. Few ideas I have for future work. I'd like to make a version of the 10Z that goes in 594 00:52:21,700 --> 00:52:27,240 line so I can sit there and log keystrokes as well as send them. Then I can sit there and pass 595 00:52:27,240 --> 00:52:32,100 out when someone hits control or delete and then a tab and know, oh, that's probably the username 596 00:52:32,100 --> 00:52:36,920 and password that they just typed in. I can start doing my evil and use their credentials for it. 597 00:52:37,180 --> 00:52:42,360 Stuff like that could be very interesting. Also, long range wireless keyboard, which the guy 598 00:52:42,360 --> 00:52:44,100 before me has kind of gotten into. I'm going to show you how to do that. I'm going to show you how 599 00:52:44,120 --> 00:52:50,480 to do that. So I have various links out there. Paul's site, my project site, USB device, 600 00:52:50,660 --> 00:52:54,220 which is an awesome tool to see what USB devices are currently attached to your system. I've used 601 00:52:54,220 --> 00:52:58,240 it a lot for this. That way you can see the product ID and the vendor ID so you know what you 602 00:52:58,240 --> 00:53:03,620 want to spoof. RedStream app was useful for figuring out what particular applications edited 603 00:53:03,620 --> 00:53:09,380 what things in the registry. And Hack 5 has their own rubber ducky for them. There's tons of things 604 00:53:09,380 --> 00:53:13,820 out there for sources for parts. The 10Z store. Photo resistors, I get a lot of my stuff from BG 605 00:53:13,820 --> 00:53:17,940 Micro or Mouser. You can go to Radio Shack, but Radio Shack kind of sucks these days for parts. 606 00:53:18,540 --> 00:53:22,780 LED shopping is a nice place to buy all sorts of types of LEDs. And I buy tons of stuff from 607 00:53:22,780 --> 00:53:26,940 Deal Extreme. For instance, that little micro USB adapter I was using. And there's a really nice 608 00:53:26,940 --> 00:53:31,620 hub they have there that you can take apart. It has long wires and you can make it very small to fit 609 00:53:31,620 --> 00:53:36,080 inside of objects like a mouse. All right. A few events I want to mention. The Louisville InfoSec 610 00:53:36,080 --> 00:53:42,840 is coming up on October 7, 2010. Hope some of you all can make it out there. Skydog comes, 611 00:53:42,920 --> 00:53:43,800 it's not really a Skydog, but it's called Skydog. Skydog comes out on October 7, 2010. Skydog comes out 612 00:53:43,820 --> 00:53:47,160 on October 7, 2010. So, Skydog comes. He's one of our goons here. He's going to be coming out 613 00:53:47,160 --> 00:53:52,620 sometime in 2011. Keep pestering me to ask if he gives us a date. And also I'm regularly going to 614 00:53:52,620 --> 00:53:58,080 Freaknik, Nauticon, and Outerzone. All cons I recommend. And a little bit of announcement. A 615 00:53:58,080 --> 00:54:02,880 few of us from the Louisville area and, well, one guy from the Cleveland area are organizing a 616 00:54:02,880 --> 00:54:07,780 con in Louisville, Kentucky. Now, this one's way off in the future, September 30, to October 617 00:54:07,780 --> 00:54:13,800 7, 2011. But it's called DerbyCon. By the way, if anybody can help us with some names for it. We 618 00:54:13,820 --> 00:54:18,360 trying to find, actually not names, we need a slogan. And we want it to be either Kentucky or 619 00:54:18,360 --> 00:54:24,300 horse themed. So a few ideas I've had, what color is your derby? 1100 nerds and devices, 620 00:54:24,660 --> 00:54:29,180 that's what someone came up with. Being in the security world like a French steak. The glue 621 00:54:29,180 --> 00:54:32,960 that holds the hacker community together. If anybody has better ideas, let me know. Special 622 00:54:32,960 --> 00:54:36,220 thanks to all these guys again. And questions will be out of the room. I'm going to get out of 623 00:54:36,220 --> 00:54:39,020 the way because I'm about to get pulled off stage. Everyone have a lovely evening.