Today we're talking about the Universal RF USB Keyboard Emulation Device. You know, some things, they lend themselves to a good acronym, but I kept having trouble with this one, so the best thing I could come up with was IRFUKED. So today we're going to talk about IRFUKED. Some work better than others. But we have to do the obligatory about the author, so we'll fly through this and then get on with it. So, my name is this, and I'm all of these. And I'm also one of these, except I'm not this kind, so I'm more like this kind. Except sometimes I have to put on one of these so that I can think like one of these. So that I can keep the server room, which is supposed to look like this, from looking like this. And I'm kind of like this. And I'm kind of into this, except it looks like this, and I have to wear one of these. And you won't find it here, but you will find it here. And it looks a little like this, and I've won some of these. All right, so that's it. Let's go back for a quick review. We see that I'm kind of into this. And I'm sort of into this. And I've been told I look... I look a little like this. Or maybe more like this. But in any case, I've never been involved with this particular one of these. All right, so that's me. Let's start. The Universal RF USB Keyboard Emulation Device, or FooCAD, consists of two parts. At the top, we have a transmitter. And at the bottom, a USB, essentially a USB receiver, a microcontroller. Here's a quick overview, and then we'll get with the demo and talk about it a little more. Basically, a microcontroller is plugged into a computer secretly, right? This is a physical attack, but it has certain advantages, right? You look kind of suspicious, right? We know you own a box. When you get the box out, and you open it up, and you take the hard drive out, and you start doing that, and that's kind of hard to do in somebody's office while they're watching you or while you're walking by. This physical attack means plugging in this receiver and leaving. Then, attacks are triggered remotely by RF from the transmitter. And we'll see how that's done. Let's do a live demo. Time to pray to the demo gods. All right. Who brought a machine? No malicious attacks here that will volunteer and bring it on up. Come on up. Come on up. All right. Anybody else? Any USB, you know, powered devices? I'll tell you what. Wait right here. We've got ladies first. But hey, you get this cool-looking t-shirt, all right? Everybody gets a t-shirt. All right, come on up. I've got this dress up here. Oh, come on, come on, let them up here. What size t-shirt do you have? Large. Large. It's medium, medium, medium, medium, medium. It doesn't work on Linux. It says universal, doesn't it? Okay. Large? Yep. All right, who's next? What size? Large. Large. Whatever you prefer. Let's see what else. Let's see if we've got some more larges. Oh, another large. Do I know you? What's your name? I know you. Well, I know your talks. Large. Oh, man. Let me see. One more large. Yeah. But I just hit it. I don't know if you saw what they say. They say, I make the Internet work in big letters, and the little letters are, you're welcome. They're cute. They're cute. I get lots of comments on them. All right. We've got a little Windows box up here. Yes. Yes, yes, yes, yes. All right. You guys will see bigger pictures later on because you can't see this here, but I've got pictures in the presentation. And it actually works pretty well for laptops because most people use a docking station, right? They stand up. They walk away. They don't check the back of their docking station. They just plug their machine into it in the mornings. At least that's the way it's worked for me. And again, we'll go into more detail in a second, but I'm going to select an attack. This looks like Windows. That's 01, attack 01. So we set the attack, and then we hit transmit. Whoa. And away it goes. So much for live demos. We'll try one more time. Oh, we can't. Oh, let's try moving. All right. Which way? Let's see the whole thing. Let me look at this. Oh, you're not seeing any of this. It should be mirror. All right. Hey. Hang on. All right. Let's try that. Can we reacquire this one? Oh. Much better. Thank you. What are you supposed to sacrifice to the demo gods? I'm not. Is that what it is? Where do you find those? Okay. In any case, set the attack, and hit the transmit button. And away it goes. Whoa. Wow. An amazing demo. Yeah. Thank you. Thank you. Thank you very much. All right. Well, guys, if you guys want to come talk to me in the over in the speaker room, this is actually a set up. She's my co-worker. And we have this bet about whether or not I can get anybody else to volunteer to come up and volunteer their machines. All right. All right. All right. Thank you, guys. Oh, everybody. Thank you. And I got a few more of these T-shirts for anybody else who wants them. I'll take that back down. I'm good. I'm good. Thanks. No. I'll just take the player on. Thanks. Thank you. Thank you. Thank you. Thank you. All right, so let's get back to the rest of it. That was a demo, which I think went remarkably well. All right, well, you know, you always have to have a backup plan in case that fails. That also gives us a chance to take a look at what happens. So what really happened was that this device pretends to be a keyboard. And so it uses keyboard shortcuts and executes commands with the permission of the user. In this case, it uses the Windows key and an R to pop up this run dialog box. It executes notepad.exe. This is a non-malicious example, but, you know, it could just as easily be any arbitrary command. When that window comes up, it gets a focus, and it's able to type in that window as well. So you see that you can run an arbitrary command, and you can then send it information. Now, you're doing this blind. This is prescripted. It's run by this microcontroller that's plugged in the machine, which also gives us some other abilities to do some cool stuff. It's universal. So it has to run on Apple, too. And here's what it looks like. You know, pretty much the same thing. The key sequences are, oh, yeah, they're the same. They're pretty much the same on Apple. Now, Apple, you know, I thought with Apple, everything was supposed to just work. But in this case, probably because of the identifier I have up, it says, hey, I don't recognize this keyboard. And could you press? You know, I don't recognize this keyboard. You know, the key went to the right of the shift or something to help me identify it, and then it's okay. So, of course, you can script all that in as well. But the easiest thing to do is let the user do it. I did this, you know, a couple of guinea pigs around my office. They should know better. But I'm like, hey, I've got this real cool thing I want to show you. You know, are you game? And they say yes. I usually get permission. And so. So, you know, in the morning before he gets there, I plug it into his machine. Later on during the day, I come in and I do the demo for him. I get the little transmitter. I hit it. It opens up this box in his machine. He's like, amazed. How did you do that? You know, you control my machine with RF. So we went through the little talk and how it works that, you know, it's doing the keyboard emulation. And I plugged in this microcontroller. He's like, oh, yeah. And he's a smart guy. He's a security-minded guy. He was like, yeah, when I got here this morning, there was this pop-up thing. And I just clicked through. And, you know, I forgot about it. So. That's always the best thing. Just let the users, let the users do it. Oh, yeah. And it can't really be universal without Linux, of course. Now, in Linux, it just works. You don't get any pop-ups. You don't get any messages. You plug it in. And it goes. You're done. You're good. And in this case. . Pull up a shell and type into the shell. Which, again, you recognize you can execute any kind of arbitrary command that you want to execute. All right. So let's talk a little bit about, you know, what might you want to do? What can you do with this kind of a resource? Some of the things may be political-style attacks. I know. Kitty porn. Tends to be a big issue. You can imagine bringing this up on somebody's machine. And you can also combine with a denial of service attack. You can denial of service the mouse on the machine. You pull it all the way down to the bottom right. And it's moving so fast that you effectively have no control. Right? You're trying to bring it back, but you can't. This thing types a lot faster than you do. I think you can overwhelm the keyboard buffer, the keyboard strokes, too. I haven't done that yet. I'm missing kind of the top of the. I'm missing the title of those other slides. Anyway, if they're logged into Facebook, you can post Facebook commands. Apparently, this was a real one. Maybe. They forgot their boss was on there and, you know, said some pretty ugly stuff and got fired. So, you know. . . Usually, when you're doing a Trojan horse kind of attack, you have to get the user to do the work. Right? They have to download the stuff and they have to install that and, you know, it's a lot of hard labor. But here, you can script it. Right? You're running with their permissions on their machine after they log in. You know, some other things you could do is run an email or FTP. Of course, you can remove anything. You can remove any file that they have access to if you want to. The same thing about being logged into other accounts like eBay or PayPal. You know, maybe it's just enough to insert. I was wondering, how do you get somebody to install a, you know, a root certificate authority if you're not DEF CON? So, maybe you could just. . . Maybe that's enough, right? You automatically install it and from then on, you can man in the middle of them. Um. . . Since it's. . . It's also a microcontroller, you know, this screen is, can we try reacquiring it? We're missing the top and the bottom. No. . . No. . . Maybe. . . Oh, much better. Since it's a microcontroller, you can also time delay it, right? So, you know, the scenario goes, you plug it in the machine. . . You're plugging in the receiver when. . . When somebody's not there. . . They stepped out for lunch. Or before they get in in the morning. Or after they leave. You know, this is the kind of the physical attack that you might do while you're talking to somebody even. You're standing up behind their desk. You're sitting behind their desk. The computer's on the floor. You drop something. You slide in a USB key, right? Still a physical attack, but it's much less intrusive than trying to open the case. But anyway. . . Since all the attack is run from the receiver. . . That's the microcontroller. You can also put a delay on the trigger, right? So, you might trigger the attack as you walk by. You see that they're sitting at their machine and they are logged in. And it might not run for 30 seconds. Or five minutes. Or, you know, some other time delay. That way you're not around. You're not in the area when it actually. . . When it actually executes. Right. Let the user do the work. Let the user do the work for you. Yeah. We might see some of that. All right. So, what's it look like? Here's what the receiver looks like. It's a teensy microcontroller. 18 bucks. Small. Fun. Easy to play with. You can't quite see the LAN behind it. But there's an RF receiver LAN back there that's soldered on. The quarters just to show. . . Show the size so that you can see that it's pretty small. You could probably fake a USB key. Maybe slightly larger than a USB key. Maybe not. It depends on how big the USB key is. This is what the transmitter looked like that I built. And by the way, you know, we're going through the notes here so that by the time we get done, this should be easy for you guys to do. We've got code and everything that you need here. So. . . But this is one that I built. Power switch. Some input buttons and some lights to show me what attack that I'm going to do. In particular, I'm using the first two bits to represent basically the type of attack. Well, the operating system. I select 01 on those first two lights for Windows. 10, which is 2 for Mac. 3 for Linux. 4 for keyboard and mouse type attacks. And then I use the other two bits to select the actual attack. So you might plug it up and decide what attack that you're doing later on. Or maybe you see what OS they're either running or they're in at the moment. And then the transmit key. After you enter it, you hit transmit. So you could set it up, you know, for this transmitter, which is kind of big. All right. You could set it up. I'll put the transmit. Stick it in your pocket. Keep your finger on it. And when you walk by, hit transmit. Inspiration. I've seen some other people doing some work with this. I saw Adrian Crenshaw, the Iron Geek, do this one. He was programming with a dip switch. And when I saw it, I thought, timing. You know, I want to be able to time this. I've got to wait. There's no magic about user credentials. Right? I'm waiting for the user to log in. And then I'm going to use his credentials. Right? So blind timing is a little hard. And so I thought a radio frequency trigger would be the way to go. And I think Adrian is going on and doing some more experimentation with it. And he's doing a talk in a little while. So you guys look for that. And whenever I find you and meet you, I owe you. All right. Three components primarily. This transmitter. Expensive, right? Okay. 395. Sources in the back. It's pretty small. You can see from the quarter there. Easy to use. Receiver. A little bit bigger. A little more expensive. 495. And finally, they're both run by this teensy microcontroller. 18 bucks. USB connector. Reset switch. All the power ground and data lines around the outside. I really like this teensy. And the guy who built it said, make sure you let the guys know that you can do it for other things than breaking stuff. And I said, they're not interested. So in any case, it's really cool. And we'll talk a little more about it in a minute, too. The receiver looks like this. Seven wires. You can solder seven wires. Your receiver is done. That's all. Well, okay. Eight if you had the antenna. The antenna is optional. But it adds to the range. They claim about 150 meters. That depends on the transmitter voltages. I really haven't played a lot with it yet. Not very hard. That's what the actual schematic looks like. It's going to show you which pins to hook where. The receiver has several of its pins duplicated. It has multiple power and ground pins. And I'm not really an RF engineer. But I've heard that it doesn't work as well if you don't power them all and ground them all. So I connected them all up. And it seems to be working pretty well. Transmitter data sheet is pretty easy. Power, ground, data, antenna. That's all you need. And you're done for the transmitter. Other than if you want to build a custom user interface. In this case, I built four buttons. Or three buttons. Four lights. And a switch. I should have put some other pictures. But a lot of that really is junk I found around the house. I pulled those little buttons out of an old DVD player that was bad. That's what's hiding behind the buttons that are on there. And the little switch I got out. We have dollar stores where I come from. You buy everything in there for a dollar. And there was a little night light. It had those switches and batteries that I used in another project. So that was great. And there's the pin assignment for the Teensy. I have a bunch of these cards. If you guys want one of the cards about the Teensy, see me in the question room afterwards. And I'll hand them out. Thanks to Paul, the guy who built it. Again, I love the Arduino and the Teensy. They're great devices to work on. And if you haven't done stuff like this. And I know some of you have and some of you haven't. But I think this is a great little device to start with. I've played with lots of microcontrollers a little off and on over the years. And I like this one a lot. There's a schematic for the interface. Four lights. Three switches. You know, you guys have done this before. You know that for the switches you usually need pull-up resistors. Well, those are built in. You can turn them on on those data lines. So you don't need those. It's pretty easy to do. I built it in this eyeglass case. Just because it was handy and cheap. And had plenty of room. And seemed pretty solid. Cut it out. Screwed it in. Had room for, you know, big batteries. Relatively big. Those are triple A's. And it all fits in the same case. And this is where the magic happens. This is the receiver. And it's tiny. It's teensy, I guess. But the teensy is on top. The receiver is on the bottom. A little bit of epoxy to hold it together. You can case it up if you want to. Build something around it. The actual adapter there is available from Deal Extreme. And I don't know if you guys know about them. But I buy lots of junk from them. It's a great place to buy cheap electronics from China. Well, it turns out the receiver is always receiving bits. Right? It's picking up noise. And it's deciding 1, 0, 1, 0. So you get a continuous stream out of it. That's kind of difficult. Right? Because we're looking for particular, you know, particular information. So I built a simple transmission frame. To deal with that. It begins with a three or more byte carrier of AA and hex. Then it's followed by a command sequence number. And we'll talk about that in a second. And then the command byte. That's the attack that the receiver is going to run. We identify it with a byte. Right now I'm just using four bits. But, you know, you could easily run up to a byte with the code that I've got. And finally, a checksum. Because, again, this radio frequency can be pretty noisy. We want to make sure. That it was received correctly. We don't want to run the wrong attack. You know, maybe it was supposed to be a demo. And it ends up erasing all their files. That would be bad. All right. The transmitter also, for each attack, transmits that frame ten times. Again, it's for redundancy and noise. And at this point people always ask, well, isn't that running the same attack over and over again? And the answer is no. That's what the command sequence number is for. So the receiver, if it receives a valid command frame, and the command sequence number is the same as the previous number it received, it doesn't execute it. It has to be a different number. So that way you can send the same command transmission frame over and over again multiple times. And the receiver will only execute it once. The transmitter will, and then somebody else asks me, he says, oh, well, what if you want to hack it more than 127 times? I don't know. The transmitter will actually roll over and start back at zero. And the receiver really doesn't care. It just wants to know that the number isn't the same as the last one. It can be any new number as long as it's not the same as the last one. That way you don't have to worry about maybe you tried to transmit an attack and it didn't receive it. All right. Quick look at the software. Again, the Teensy is great to work with. Over the years I've worked with different microcontrollers. And, I mean, well, maybe I should take one step back. I know some of you have done this, some of you haven't. You know, the microcontroller, the device with a processor and some memory and maybe some more permanent storage to store programs in, typically they're a pain in the butt to work with. Or at least maybe historically. You get this little computer and then you're trying to wire up a bunch of memory and then, you know, and then you've got to learn a new assembly language to program the thing in. And that's just nuts. So, more recently, the Arduino. And this is the same environment that the Arduino is programmed in. But it looks like this. It's written a lot like C. And the, you see the, the, the, the, the, the, the, the, the, the, the, the, the, the, the, the, the the, it's a little development environment there on the right. Very simple. But it works. And then the loader on the left, you press a little button on the, up here, I can't see anything with this little pointy mouse. But anyway, you press one of the buttons up there. It compiles the code. It uploads it to the HitTeensy in one step, and you're done. Whatever you want to run on there is just done. Again, we're not going to go in depth into the code. code. It's available online. You can pull it all down and write it yourself. All that development environment, it runs in Windows and it runs on Linux. So you can run it wherever you prefer. Let's see. So again, just to give you some idea of what the code looks like, you've got integer, it does floating point math. I can't believe I don't have to write a multiply instruction. That's just awesome. So for the RF carrier here, this is on the receiver side. So it's looking for three or more bytes of AA hex, right? That's identifying this upcoming frame. When it finds it, you know, it recognizes that the frame's coming. Here's the actual code that executes the attacks. And a couple, for the example, the first one here is this mouse DOS kind of attack. Basically, it just moves the mouse to the bottom right of the screen. It keeps moving the mouse down and right, down and right, down and right continuously. And it does it faster than you can move it. I like the next one. The next one's kind of cute. Let's assume that, you know, you have a screen lock that comes up nine minutes. Somebody who likes to walk away from their box. So you set the timer, in this case, for nine minutes. And every nine minutes, you move the mouse one pixel and then move it back one pixel. Cool, right? So I think it's sweet. You can't even see it, you know, even if you're looking at it. And once every nine minutes, you've got to be kidding me. So if they get up and walk away from their box, that's fine. You can keep it unlocked as long as you want. On the other hand, if somebody's looking at their box, by the time they see it, it's too late. It's like, hey, there's a window. What's that? What was that? Must be a Windows thing. And as long as it doesn't come back, they don't care. Sometimes their screen's slow because now it's all getting streamed across the network. And again, just for an example, the Linux attack. Here's the case. code for it. It presses the AUG key, the F2 key. It opens a GNOME terminal and it types gedit in it. And then it types, you know, this machine was pwned by Monte. So the code is simple. It's straightforward. Easy to do. And it's online. If you want it, there it is. This presentation, by the way, the one on the disk is a little out of date. I mean, it's still valid. But I've got a lot more stuff in this one. So the full talk is there, is there too, and the code. All right. A quick look at some other implementations. I'm a little paranoid. And I haven't tried to travel on an airplane with anything like this. I've heard stories. I saw a teensy device that was built into an Altoids 10 online. Well, I'm trying to figure out if I can carry this on the airplane. And apparently, you know, they went through, somebody went through the screening with this little teensy in this Altoids box. And holy crap, you know, what's going on. And they called the bomb squad. I don't need that. And the bomb squad decided that they couldn't definitively say that it wasn't a bomb. So what do they do? All right. They take it out to the parking lot and they blow it up. And you see this picture of, you know, a little bits of Altoids 10 all over the place. And I've got a feeling that I don't think a cavity search will be near as much fun as a TSA makes it out to be. So anyway, I built another one. And I shipped one through the mail and brought the other one with me. I didn't have, I really didn't have trouble with the one I brought. But this one might be a little more or less conspicuous. I'm not sure which. But it's just a hollowed-out cell phone with the interface in the front. All right. All right. All right. All right. All right. All right. All right. All right. All right. Cut out the circuit board with the dremel tool and laid the TNC in the transmitter in the back. I actually used the buttons. They were already there on the cell phone. So I soldered up to the buttons. Select the attack with the top two buttons and transmit it with the bottom one. The real James Bond thing is that for some reason, they've got a switch. See the one labelled power? And that's triggered by the antenna, all right. So I push the antenna in, it turns on. You pull it out, it goes off. I just thought it was cool. And, you know, it looks like this on the front. But, you know, you could be walking around with a cell phone in your hand, and who's not? And, you know, nobody's going to pay any attention to what's going on. Now, this little red wire, I've got a little clip on there. It's the safety. It keeps it from being turned on. And there's another receiver, just encased in Instamorph plastic. And if you haven't played with that, it's great stuff. It's kind of expensive. You heat it up, I think, to about 140. Basically, you put it in hot water, and you can pull it out and mold it. And when you get done, it's very rigid, very useful. But, you know, I'm looking around the house, and I found this. And you've got to love Happy Meal toys, because they have screws, right? You unscrew it, and they just fit. The transmitter went in sideways, and the Arduino went this way. And it was a little spring-loaded toy, right? It would roll across the floor, and so the USB plug fit right out the back. And like I said up here, you know, you write something like 8G on that, and somebody will pick it up and plug it in for you, right? That's all you need. All right. Well, that's pretty much it. Sources are here, where you can find the stuff. And you can find it cheap. And, you know, the schematics are in there. If you want to find me, here I am. The latest stuff is on that site. If you want to ask me questions, you want to talk about training or whatever, give me a yell. Some shout-outs to Adrian Crenshaw, who did an earlier version. Paul, who built the Teensy. The Arduino folks, who are doing lots of cool stuff with the Arduino. And that's it for me. I've got a couple of t-shirts. When we go over to the room, what room are we going to? Oh, anyway, I think they're marked. So thank you guys very much. I appreciate it. I hope you all enjoy your time at DEF CON. I'll see you next time.