All right. Good morning. Should I not talk too loud? Any of you guys got headaches? What's that? Pass the flask around. A little hair of the dog. Yeah, all right. Yeah, there isn't enough left in the flask. But so, yeah, I'll try not to bore you guys to death this morning. But thanks for turning out. Yeah, it is interesting times in the wireless village. I was originally scheduled for 7 o'clock on Thursday, but those darn EFF people got in our way. So here we are back. I'm going to do the talk that was originally scheduled for Thursday at 7 now. Bright and shiny early Saturday morning after all our great DEF CON parties. Yeah, I went to bed early. I went to bed early. 2 a.m., and the alarm went off at 6.45, and I haven't had nearly enough coffee yet. So all right, let's get started. We're going to do an introduction to the Nordic NRF24L01 Plus. It's a pretty cool wireless chipset that I had an opportunity to do some playing with for a project. We'll talk about that project and all of the stuff that went along with that. We'll see that within sort of this project and the presentation and some of the stuff that we worked on for this, this may also be a candidate for next year's fail panel. How many of you got to go to the DEF CON Comedy Jam panel? And yeah, we had some folks up there. The overarching theme of that is fail every year. And we tried to do something that was humorous. One of my coworkers and I, we hacked some Teledildonic devices. So we played and hacked with an internet and Bluetooth-connected vibrator for epic lulls. It was lots of fun. And it, yeah, owned all sorts of interesting social connotary as well. So the overarching theme of fail, people make mistakes, and there were definitely some mistakes that were made going into this. One of those being, you ever have that time when you take on one too many projects? Yeah, I'm about three projects too many too deep, and this was one of them. So there's sort of lots of exercise left to the reader. It is definitely an introduction to some of the capabilities of this Nordic Radio. But we'll give you some examples, some ideas as how you can use it. And it's definitely something affordable that you guys might want to start playing with. All right. So a little bit about me. I'm a hardware hacker and penetration tester for a small boutique consulting group called InGuardians. I just had my one-year anniversary with them. And sort of as a part of this project, my one-year anniversary right about DEF CON last year, I had a little impact into the project where I got introduced to this radio. And I'll explain that in a little bit. I'm also an instructor for the SANS Institute. I teach their wireless class, SANS Sec 617. So wireless security, ethical hacking, and defense. I'm also a member of the Paul's Security Weekly crew, formerly known as Paul.com Security Weekly. Yes, trademark disputes. We changed the name. It was going to cost us $15,000 to fight the Paul.com issue with no guarantees at the end. So we elected to spend $5,000 to rebrand and have a $10,000 party with a guarantee at the end. So yeah, it was a financial decision and it worked out. I'm also an extra class ham radio operator. My call sign's KB1TNF, Kilo Bravo 1, Tango November Foxtrot. Or if you're being funny, Kevin Bacon 1. That's not funny. Okay. How many of you guys are going to take your ham radio exams tomorrow? How many of you guys are going to show up and take the cram session at 9 to noon here tomorrow? Yes, come do it. It's totally worth it. Totally worth it. All right. All right. So I had a little inspiration for talking about this radio and learning about this radio. I participate as an event organizer and volunteer for the Mid-Atlantic Cyber Collegiate Defense Competition. It's a competition where college students create teams within their local university for computer security club or computer club. They participate in some local and regional events. The semifinals are held regionally. I participate at the Mid-Atlantic region that divided into a bunch of different regions. As part of my involvement for the last four years, I've created their electronic badges. And their electronic badges as part of their scenario have been what's considered in scope. They're a hackable and defendable asset and they're scored based on points as to what they do with these badges. Normally this goes pretty darn well. We have lots of time to work on the badges. We know what the theme for the next year's competition is going to be a year in advance. So basically the ride home, eight-hour car ride on the way home, my cohort and I start talking about what we're going to do for the badges next year on the ride home. Unfortunately, the year before we didn't have a good handle on what we were going to do. And right about that time, so actually not last year, the year before at Mid-Atlantic CCDC competition, I was actually participating in my exit interview for getting laid off while at competition. So I was leaving competition unemployed. That was kind of interesting. So to that, in that year, over the last year, things sort of got put on hold as far as examining stuff what we're going to do for last year's Mid-Atlantic CCDC competition. So I was unemployed, found a job, was a great job. I was there three and a half months and they laid me off. So I got laid off twice in a four-month period, which sucked. In that four-month, three-and-a-half-month period, we had a child. We have two kids. So yeah, we had a four-week-old at home who had just come home from the hospital, was three weeks early, and has spent a week and a half in the NICU. So needless to say, there was a little bit going on in my life outside of looking at badges for the Mid-Atlantic CCDC competition. It ended up coming down to two months prior. Oh, so my compatriot as well, Darren Wigley, had helped me for four years on building badges and coming up with a scenario. He also got laid off from the same company at CCDC the year prior and his new job had him traveling 90% and had just no cycles to give to me to help with the badges. So I was on my own and by the time it came down to it, I had exactly two months to come up with a scenario, build a badge, get it implemented, and then bring it to the competition. So I needed something fast and easy. Some of those design constraints for that particular badge were you're going to be handing this badge to a bunch of college students that may have never touched a microcontroller in their entire life, yet you're giving them a badge with a microcontroller that they have to learn how to program and defend in two days. Same thing from the red team side, the attackers that are attacking these students' networks. Some of these attackers are not hardware guys, they're software guys, they're web application security guys. They may have never touched a microcontroller in their life. So they need to learn how to turn the badge into an attack tool in two days. So it needs to be something that you can attack and defend in two days and do it fairly simply. Turns out this was a pretty interesting thing. I had some design constraints that I needed to think about for this. We're giving them to them as a badge, and so they need to be powered for two days. The badge needed to be powered with some fairly standard type of batteries. There was a budget involved. I couldn't spend two or three hundred dollars on a badge. I think I had the whopping price of $48 per person for a badge, which is pretty significant. The badge development effort is all funded through grants through the National Science Foundation for this event, as well as private donations and corporate donations as well. So there is a limit. I needed something that we could have low power that the students and attackers could wear around their necks for two days on a set of batteries. It needed to be relatively low cost and sort of low barrier to entry for the students to start figuring out what they needed to do. What ended up happening is I selected a set of radios because they ended up being fairly low power, fairly inexpensive, and easy to use. But additional research after the fact and during implementation time, I found these radios, the Nordic NRF 24L01 pluses, and I went, oh, these are going to suit my purpose. These are really neat. And then after I got them in my hand, I was like, these things are awesome. There's so much more that you can do with these with some hackery. And that's sort of what I wanted to introduce to you folks today. This is probably a radio chip set that many of you have never heard of but can have some really cool fun things and some potential security application for you as well. We're only going to take sort of a scratch at the surface. Many of those exercises left to the reader. I'm going to give you the introduction as to some of the things you can start doing, some challenges with those as well. So this is the display. We've got a setup here. Not quite as nice. What the badges ended up turning out to be were simulated aircraft ADS-B beacons and simulated because they had very little code space to deal with. So basically what ended up happening is that the badge just spits out an aircraft tail number. Hey, I'm aircraft this. And the radios have a fairly short transmit and receive distance. So we built a aircraft arrivals and board. So when they came close to the, quote, airport, the station here, the station would receive messages. And it would receive messages of a tail number. So we'd put them in an arrivals board. And every time a message was received, they'd reset the counter on the arrivals board. After that message was not seen for a five-minute period, it would move into the departures board. If we didn't see a beacon from an aircraft for five minutes, that means they're not there anymore. They've departed. After they were in the departures board for five minutes, that means that they're gone. This was also right about the time that the Malaysian airlines flight disappeared over the ocean. So there were all sorts of jokes there. Yeah. Completely unrelated. Yeah. Yeah. Yeah. What? Too soon? Okay. All right. All right. So a little bit about this radio. It's a 2.4 gigahertz radio in the ISM band, industrial, scientific and medical band. No license required to use. Just like your BGN wireless stuff, some BGN wireless stuff in the same frequency ranges. It's fairly low speed. Maximum data rate transfer is 2 meg. Typically we see them more often in the 250k to 1 meg range depending on application. It is very low power consumption for a radio. You can do all sorts of radio shut down over the radio with some of the various implementations. Requires 3.3 volts. And at a minimum, sorry, 3.3 volts at a minimum 1.9. So we'll take a set of batteries and drain those really well. Take them all the way down to make them unusable. Grab every possible amount of power out of them. So get some pretty decent battery life and it will continue to work all the way down to 1.9 volts. Uses Gaussian frequency shift keying, GFSK modulation. So for those of you doing some of the GNU radio, GNU radio companion stuff, we now know how we can potentially start decoding some of this stuff. The chip itself is a QFN 20 by 24 by 4 millimeter by 4 millimeter. 10 millimeter by 10 millimeter, sorry. QFN package. These things suck to solder. Hence, every time you're probably going to buy one, you're going to buy them on one of these breakout boards. This is actually some of the samples that I had in my home office. Some of these breakout boards that elude at higher expense actually include a RPSMA connector and you can add a standard 2.4 gigahertz antenna to it. So this has just got the like the 1.1 DBI rubber ducky antenna. There's no reason we can't go take an 18 DBI parabolic dish antenna and put it on here if we want to. So we increase in distance and have all sorts of good fun there. The standard version without the RPSMA connector, very similar to this one, in small quantity, quantity of 10 on eBay from China, they're about $1.10 a piece. I can buy a bunch of these things and throw them away if I want to because they're that cheap. You think about some of the other chipsets that you may be looking at, you know, Wi-Fi chipsets, you're probably going to pay $30 or $40 for. The breakout boards from SparkFun are going to be relatively expensive, maybe $50, $60. Bluetooth, Bluetooth Low Energy, you're probably $5 to $10 a piece. Zigbee, some of the stuff that I've seen for the development kits are about $40 on the low end. These are a dollar. That's good. And for a radio that costs a dollar, we can do all sorts of fun stuff with those. Okay. Some other interesting ones as well, the NRF24LU one also has built-in USB support, so it becomes a USB device. You can plug that into any USB port and access it over serial. The devices that we're looking at here are actually SPI bus, so a little bit different. We've got to have another microcontroller in between this device and potentially something else to use it. Those other devices are a little bit more expensive with the built-in serial support, and they don't necessarily integrate as well with a standalone microcontroller. All right. Within the Nordic NRF24LU one, they've got their own standard protocol called shockburst, and most notably advanced, sorry, shockburst enhanced. It does all sorts of fun packet stuff for us, very much like we'd expect for 802.11 TCP, you name it, it does packet assembly, CRC checksums, retransmissions, shockburst enhanced will handle all of this stuff for us. In the default mode. Plug it in, start sending packets to the radio, packets come out of the radio, received by another radio, shockburst enhanced, and we don't have to worry about anything. Awesome. And it costs me a dollar. However, we can take one of these devices and put them in what they call direct shockburst mode, which leverages us the ability to directly access the radio and craft our own packets within the limitations of the shockburst enhanced framework. There's some specific challenges to that. So we can implement with these radio chips, implement ANT, iBeacon and some Bluetooth low energy functionality for a radio that costs us a dollar. It's all done in software and not saved at the radio. We've got some links to the spec sheet as well. And I'm trying to remember, my images for these, for a lot of the slides come up as take the title of the slide, go to Google image search and take the first image that's decent and shows up. This is a Marvel superhero from like Marvel Saturday morning cartoon somewhere. And I have no idea which one it is. And I tried to remember which one it was. But it was the only one that actually looks cool when I put protocol in Google image search. So that's what we've got. All right. How do we interact with the radio? We're going to use SPI. When I started looking at SPI, I had never worked with SPI before I worked on this project for the Mid-Atlantic CCDC project. And I thought it was this voodoo and magic. Turns out you spend about 15 or 20 minutes with it and you'll get some pretty good ideas. I happened to interface mine with an Arduino. And I can hear you guys saying I hate Arduinos for microcontroller. I get it. But guess what? I had design constraints. They're easy to use. Had to have students that had open IDE that they could use. Didn't want to have to have them spend money to participate in this challenge. It's easy to use. Even a monkey can do it just like this one up here. Using SPI on the Arduino was actually pretty darn easy. So if you want to learn some more about the SPI implementation, Nordic Semiconductor and some other folks have got some great tutorials on understanding SPI. This was the one that I used. And SPI does allow us to have multiple of these serial devices on the same chain. So we can conceivably daisy chain multiple radios. Pulsing which ones are on and off. And we could conceivably do that with an Arduino as well. It turns out it's really not as much voodoo as you seem to think and ends up being fairly easy. So Larry, why the heck do we care about this stuff? Well, we're seeing the adoption of the Nordic NRF24L01 and L01 plus radios in all sorts of commercial devices. Max Moser and I want to say Dominic Spill actually spent some time as part of their Keyboard Sniffing Development Project figuring out which devices had some of the stuff. That's where some of the Ativa platform stuff. It's a voting platform for like when you go into like a closed caption studio audience type of thing. And you can vote on various things based on some of the shows and some of those types of things. Wireless device that you can do some voting with. The Nike plus portion that goes the beat portion that goes with your in your shoe that tracks your steps. Uses the Nordic radio as well. The Garmin Chirp for doing activity tracking for exercise. A whole bunch of unnamed medical devices. In this one, a Suunto sports instrument. This one's the Microsoft keyboard. The Logitech unifying receiver. How many of you guys have bought one of these Logitech wireless keyboards at like Staples recently with a unifying receiver? It's the one with the little like red star thing on it. Nordic NRF24L01 plus radios. In fact, I picked this one up at Staples last week for 20 bucks. And now we can have all sorts of fun hackery for a $20 keyboard and a $1 radio. A little bit more complicated. Various unnamed medical devices. I have a good friend that may or may not have hacked his own insulin pump and I'll leave it at that. Some of those type of devices that may be life-saving actually contain some of these radios and could have some pretty serious impact should some of that stuff go bad. So thanks to Travis Goodspeed. He spent a lot of time looking at some of these radios and interacting with these radios with the GoodFET, the interactive board for dealing with all sorts of fun devices, ZigBee and others, dealing with various wireless chipsets and all open source. I highly suggest if you're interested to pick one up, it's all open source. Travis, through some magic of math and implementation hacks, discovered that we can turn one of these Nordic radios into a promiscuous sniffer. It's a little bit convoluted. He's using some modes for the registers in the chipset to an invalid state at which point the radio says, oh, well, that's fine. I'll just turn the radio on and just spit you a stream of raw data. And then we can disable some of the other settings as well. So shock burst doesn't process stuff like CRC 32-bit checksums. And now we potentially have a $1 2.4 gigahertz sniffer. Okay. It does require some interesting hackery. It will not do channel hopping. The radio takes in radio terms, anyways, takes some significant time to retune the radios between the different channels for channel hopping and the time that is remaining for a lot of the protocols that do channel hopping. We don't have enough time left to actually do any processing on the packet that we receive. So it can't hop fast enough. But we can sit on one channel and listen for traffic as it goes by on that one channel. Very similar to how the Uber Tooth One operates for doing some of the Bluetooth sniffing. It sits on channel 39 by default and listens for all the packets go by on channel 39 when it hops 1,600 times a second. We'll get to this a little bit more. All right. So one of the things that we mentioned, we can do Bluetooth low energy. And for any of you who have seen Mike Ryan's talk on how smart is Bluetooth smart, you learn that Bluetooth low energy is all sorts of fail. They significantly reduced the channel hopping requirements, took out half the number of frequencies and the number of channels, shortened the frequency hopping time frame, and some various cryptographic failures as well. So it might be neat for us to start looking at some Bluetooth low energy stuff. The maximum data rate transfer for Bluetooth low energy is 1 meg, which is well within the duty cycle of the Nordic radio. It would do 250, 1 and 2 meg. So we certainly can do some of that. The problem is that observing and or transmitting some packets with the Nordic radio, the enhanced shock burst when we go into direct mode and disable CRC 32-bit checksum checks, the packet size is only 32 bytes long. Let me make sure I get that number right. Yep. 32 bytes long. But Bluetooth low energy packets can be up to 39 bytes long. Some of the packet types, depending on their advertising rates, we can fit and have fit in the 32-byte packet. So we only have the ability to sniff and or transmit specific packet types. Specifically, one of those is the advanced no connection indicator. Hey, I'm a device and I'm here. So broadcast packets. So we can observe broadcast packets and we can conceivably craft our own. However, also only on channels 37, 38 and 39, which is where all of these actually happen within Bluetooth low energy. All of the discoverable mode packets for Bluetooth low energy happen on three channels as opposed to 79 with normal Bluetooth stuff. So Bluetooth low energy sniffing, yes, I actually went to meme generator and created this specifically for this slide. I couldn't find anything in Google image search, so I went and made my own. It's not so easy to do Bluetooth low energy sniffing with one of these devices. The channel hopping is one of the ways that's going to come down to fail for us. The radio just can't hop fast enough for Bluetooth low energy to do connection following. But we could do very similar types of things like the ubertooth one does by listening on one or potentially implementing three radios and sniffing on just three channels. However, based on the packet size problems, we're only able to grab those advanced non-connection indicator packets. So we can find beaconing devices and potentially beacon devices ourselves. So some limited capabilities, but we only paid a dollar for it. All right. Have you guys heard of iBeacon? This is kind of neat stuff. Apple's pseudo-proprietary technology for doing location tracking. Some of the stories that we hear about Apple wants to see successes for iBeacon is to put iBeacon's devices within, say, grocery stores so that when you fire up your grocery store application and you walk around the grocery store and you show up in the toilet paper aisle, it knows you're in the toilet paper aisle and you're standing in front of the Charmin and it can beam a coupon for Charmin to your phone while you're standing in front of Charmin. Because you'd normally buy Quilted Northern, but hey, now I've got this coupon and now they're the same price or cheaper, so I'll buy Charmin. Location tracking within building with a commercial application and now we start tying that to something for purchasing habits, that's kind of creepy. That said, it's still a pretty darn neat application. We can still, with the Nordic Radio, do some stuff with iBeacon. However, iBeacon is based on Bluetooth Low Energy and we just sort of went over some of those challenges with Bluetooth Low Energy. However, some of those challenges still exist. We can only either broadcast or sniff the presence for some of those devices. And injection actually works a little bit better here. So we can create iBeacon advertisements. Hey, I'm an iBeacon and I'm here. And that's sort of about it for this radio with iBeacon. All right, some practical implementation for you guys to get started for some of this stuff. This is exactly what we used for the Mid-Atlantic CCDC competition. This is their badge. Sexy, isn't it? It's an Arduino micro and one of the radios. And a battery pack and a lanyard. I didn't put the battery pack. They had four AA batteries and a USB connected thing. So I made these guys wear four AA batteries around their neck with this nice thin lanyard for two days. It sucked. It sucked. But the battery packs were cheap. We got them in all under budget. I got them in way under budget and they had a great time with them. Okay, so with this, with the Arduino, we're using the SPI libraries, which were included. If not, fairly easy to grab. And there are a couple of ‑‑ there are at least two Nordic NRF 24L01 libraries available for Arduino. This was the one I found to be the most robust, the one from Maniac Bug. Easy to install, copy, unzip, put in your Arduino libraries folder and import your libraries. He's got tons of examples. Part of the reason why I really liked some of his stuff, it's well documented. And the examples are well documented as well. The ADS‑B beacon is half of his ping pair transponder examples. It took me all of three days to write the code to modify his stuff and put it through some pretty rigorous testing. Based on the code for that ping pair example. And yes, giving credit where credit was due. Most of the code was Maniac Bug's. And got it done in a two‑month time frame. This is the one that was really flexible. Because it's library based, we can do some modification to it. We can actually use the libraries to set all the registers to disable the CRC 32‑bit checksum. We can enable shock burst direct mode if we really want to. And there's also some libraries for us to do some of that limited Bluetooth low energy stuff under Arduino as well. With the BT ‑‑ Bluetooth low energy libraries as well. So, fairly easy to use. It's six wire SPI. If I remember correctly. Five or six wires. We can go through and count them if we really want. When we built these, I recruited help. I recruited my six‑year‑old daughter and my wife to wire these. If my six‑year‑old can wire these, so can you. All right. So, lots of good fun. Now, there's all sorts of things that right out of the box with the Arduino stuff, we can start capturing. We can start capturing some of other Arduino traffic. Some other potential applications with standard shock burst enhanced stuff. For example, some great proprietary type of items. There's some folks here at Con from the Midwest, a group that calls themselves the Whiskey Pirates. They decided that they wanted to have a learning experience before they came to DEF CON. One of the guys wanted to learn surface mount soldering. The other guy wanted to learn how to do board design with Eagle. The other guy wanted to learn how to program ARM Cortex A7 processors and do some firmware development for that. So, they got together and they did just that. And, in fact, they built this badge in, like, four and a half months. Like, damn! And they didn't get to implement all the features and firmware. They gave me this one Thursday late afternoon. They were still in their hotel room cranking out firmware and they were, like, reflashing these things every 15 minutes because they were adding more and more features. As one of the things that they wanted to do further development for, these badges feature Nordic NRF24L01 radios. They wanted to be able to do games between the multiple badges, the ability to have a microphone so that would do VU meter type of stuff and sync the levels for the VU meter between all the badges. So, like, one guy could be in the party and everybody else can be in the hallway and they're all thumping to the same beat. Pretty cool. We can potentially use that to sniff and or mess with those as well. Okay. Lots of hobby-based applications. How many of you guys have seen the Flea Microcopter? And I can't remember the company that makes it. It's one of the tiny, tiny nano quadrotors. It's about this big. They use the Nordic NRF radio to do control for that device. Wireless 2.4 gigahertz. So you can now conceivably build your own controllers and crash other people's quadcopters. Okay. All right. Some of the stuff on the back end may require some significant post processing depending on what you're doing. Okay. So this stuff becomes fairly easy to do. We talked about the Arduino. How many of you guys have ever done any Arduino work? Okay. All right. You guys can do this. Grab the demo stuff and start from there. My college professors told me all good programmers reuse code. Doesn't necessarily need to be your code. Give credit where credit's due. So really easy for us to implement. The libraries are there. There's some great examples. And sure enough, take one of the examples, flash them to a pair of Arduinos, and it's that simple. And communication works. I'm the challenges that I ran into with the Mid-Atlantic CCDC badges that I didn't realize until half the badges were already built is that they'll make a pseudo mesh as part of shock burst enhanced. But the mesh will really only support effectively six devices. I created a mesh and it had 110 devices. It didn't work very well. It worked well enough for the students to have fun with it. But that was one of the things that we ended up telling them about. You can create cascaded meshes so that you can do routing and fault tolerance over the meshes as well with enhanced shock burst. So you could have conceivably multiple meshes with six or five or six devices and route through those meshes as well. I didn't know that at the time. I just gave everything the same address and sent all the traffic to broadcast. It did not work out so well. There were lots of crashed aircraft. But so it can be loads of fun with too many nodes, potential denial of service conditions. So that might be something to look at as well. I specifically talked about using it with the Arduino. That was where a lot of my experience lied. However, it's a standard SPI bus. So any microcontroller that you can do SPI with, you can use this radio on. You want to do that on the Arduino, sure. You want to do it on a Raspberry Pi, great, no problem. You can even use the Bus Pirate, which if I recall is MSP430 based. Same thing with the GoodFET from Travis Goodspeed. Also MSP430. Parallax from your DEF CON badge this year. If it does SPI, you can interface with the radio. And there are likely libraries that you can use. And here's some of the standard pinouts to be able to interface with the radios. Readily available on the internet. So very easy for us to get to. So this is how you change a tire like a boss. I have no idea. I told you. Google image search. Easy mods. And this came up. This looks like the Chinese army learning how to change a tire while driving on their motorcycle with sidecar. I've actually seen one of these videos and it's pretty damn impressive that they change the tire on the sidecar while they're driving. Yes, you too can do this very easily. We can modify the libraries to change the various settings, change frequency channels, change whether we're going to use shock burst in direct mode, set our rates right within our Arduino libraries. However, if you're going to change it within a library, the Arduino will use that same library in that same setting. So you may want to have multiple instances of libraries or modify those libraries to assign all of those from a variable from your main program. Fairly easy to undertake. Standard programming practices about importing libraries and referencing libraries. So it doesn't exist currently, but that's something that would be relatively easy to undertake. So for example, here are some of the items within the RF24 libraries for us accessing some of the registers within the radio. The libraries will handle all of this for us. You tell it to initialize the radio, it goes and initializes the radio with all of these default settings, just like we'd expect. You do two of them and they do the same things. Some additional registers so that we know what the default values are. Go and read the spec sheet from Nordic. Find out what some of the values you may want to change are depending on your application. And again, easily changeable within the modules. Okay. All right. We talked about Arduino. That was really easy. You fire up the Arduino IDE, you load some demo code, you put some stuff on there, and hey, look, it works! Let's go down a little bit more advanced application. And I will admit, when I say advanced application, it wasn't terribly bad. We talk about ‑‑ I talked a little bit about having one too many projects. I did my advanced implementation stuff. I wrote these slides Tuesday. Because I actually got a chance to do it on Tuesday. So I wrote the slides and did these on Tuesday right before DEF CON. And I had some of the stuff sort of preloaded. But it was just a matter of putting the pieces together and it didn't turn out too bad. Okay. So as we mentioned, Travis Goodspeed found a way for us to be able to capture data with the Nordic radio with some promiscuity giving us a raw stream of data. Now why don't we leverage some tools to take that raw data and do some post processing. His implementation sets some of those registers for an invalid mode to give us raw data and disables all of the CRC calculations and checking so that it's not modifying any of that data on the way inbound. So his hackery was great. Send us all this raw data. The data is going to look like data. But when we've got noise, it is typically ‑‑ the 00 in hex or FF in hex. So let's throw all of the 00s and FFs in hex away and or search for very specific strings for a device that we're looking for. In the case of Logitech and Microsoft keyboards, the sync word and or start of some of the headers for some of the packets start with 55 in hex or AA in hex. So if you see a packet that's ‑‑ or a value that starts 55, maybe this is a packet. Were there 0s and FFs before it? Yes. Throw that stuff away. This is likely the start of a packet. Now let's start capturing that and take a look at that. That's pretty darn neat. So why would Larry consider this advanced? Well, it requires the use of a that you can actually purchase a good FET from Adafruit industries. They're 50 bucks. To me that's kind of pricey for what it is. However, you can assemble your own. How many of you guys have done surface mount soldering work? This is a great opportunity to go try to start with. This was my first surface mount job. Which I got it to work. I used it to program my IME pink pager and that was the only time it ever worked. It was my first surface mount solder job. It was horrible. And I wanted to use it. This is the only one I had for this. So I had to take it down to the basement to the soldering iron and put on the loop. And I had to reflow every single joint on the board. I don't have a reflow oven. I don't have a hot plate. It's all by hand. So to me, that's one of the reasons why it's advanced. The hardware assembly is a little bit more complex. But Travis's design uses the MSP430 and there's SPI libraries with that. And Travis has done a lot of the heavy lifting for us. He's got some applications for us to be able to interact with the MSP430 and trigger the radio for us to capture packets. There's also a port that I discovered on Tuesday of the GoodFET software to the Arduino with the same functionality. So you can do all the same stuff that you can do with the GoodFET with an Arduino by having the libraries ported to an Arduino as well. And the reason for that was the gentleman had more experience with the Arduino, didn't have the ability to get his hands on or assemble a GoodFET. So he ported that to the Arduino with the idea to be able to sniff packets from keyboards using Travis's promiscuity hack. Great. I found out about this one Wednesday afternoon at 2 o'clock. Like, I'm trying to pack to go to DEF CON and I'm still updating slides for this talk. Because there was a post that got made on Hackaday Wednesday morning. I didn't stumble upon it until 2 o'clock. I had to go to work on Wednesday and found it at 2 o'clock right after lunch. And a gentleman had created an Arduino sketch and some plug-ins for Wireshark and a Windows-based application to do a named pipe to interact with the Arduino to pass data to a named pipe to Wireshark on Windows. So we can now use Wireshark to directly sniff using Travis's promiscuity hack right into Wireshark. And he wrote some protocol dissectors for the Nordic NRF24L01 packets. So we've got a module there, post-processing module, as well as the underlying protocol for a device called MySensors. They do temperature monitoring and home control type of stuff, open source type of things as well. And that's really what he wanted to do with it. He wanted to be able to interact with that with the Arduino. So he did. All of the stuff is available at these three blog spot links here. I apologize. It's a little eye chart. We'll get to that. But limited analysis as far as the protocol dissectors go. But we've got PCAPs. Like stuff that we know how to deal with with all sorts of various tools. And directly within Wireshark. The problem is, I set this up to give you guys a demo. And it requires Windows. And Wireshark on Windows. And application with name pipes. And I'm missing some redistributable.net objects on that Windows VM. And I just didn't have enough time to make it happen. So it's a little buggy on the install. And there's some comments on one of these blog posts on some of the issues that are still going. But still incredibly possible. Okay. We can also do software defined radio stuff for some sniffing. However, many of the software defined radios that you're going to find that are affordable such as the RTLSTR real tech type dongles, the digital DV tuner stuff, do not accurately do in many cases 2.4 gigahertz. So you now need to use a down converter, something that will capture 2.4 gigahertz and then sort of retransmit that at a lower frequency within the dongles. There are some plug-ins for I think SDR sharp as well as we can do this with GNU radio and GNU radio companion to be able to decode enhanced shock burst packets. So all of the stuff is there. It's just a matter of being able to capture that. This may be interesting for you that are working on challenges, CTF. So I have some of the software defined radios. I don't have a down converter yet. It's just too many projects, not enough time. And the CFO has yet to approve additional purchases because I've already got enough hardware to play with. And by CFO, chief financial officer, I do not mean the CFO at my day job. I mean my wife. Okay. She does the, honey, would you rather this neat new tech toy or diapers? Yeah, let's do the diapers. Because I don't want to clean the carpet. Let's do the diapers. So, yeah, and it can be done relatively inexpensive. Under $75, including the software defined radio. Folks that like hack shop or get them direct from China. Down converters and cables direct from China, places like deal extreme. Have you guys done deal extreme before? That place is like the easiest place for me to part with my money. You go to deal extreme and you're looking for one thing and like, hey, this is cool. Android tablet, $20. Smart watch, $6. Give me three. Yeah. Next thing I know, I'm checking out a deal extreme and I got a $300 order of just cheap Chinese stuff that's awesome to play with. And when am I going to have time to play with it? Yeah. So, for example, when we do the demos, I've got this solar powered battery, 30,000 milliamp hour solar rechargeable battery. I lost my other one, so I went to deal extreme to buy this one. Turns out they were so cheap, I bought four. So I can lose it three more times. Okay. Turns out they're really handy, especially when you come to DEF CON, because one can be in your hotel room charging while you're charging your phone with the other one. Okay. So, yeah, we can do this fairly inexpensively and use software to find radio to tune into some of the stuff as well. All right. So as promised from the talk description, I'm going to do some demonstration, hopefully, and I'm going to tempt the 2.4 gigahertz demo unicorns. And for those of you who have seen the Photoshop version of this with Dave Kennedy's head, it's significantly better. Okay. So now let's see if we can actually make something work. But before we get into that, the first one that we're going to do, I know this is definitely high chart. I am going to give you guys a location where you can go grab the slides. This is the code as part of the two halves of the Mid-Atlantic CCDC badge for the badges that we did. This one happens to be the ADSB receiver. So I've got an Arduino with one of these radios just sitting here listening for beacons, and I'm going to show you sort of the output for that. Pretty short for code. I know it's a little crunched, so I could get it all on one slide and make it somewhat readable. It will be better in the PDF, I promise. And here's the transmitter, the ADSB beacon. You can actually read that one on the slide. It's what? 30 lines of code, if that. And the sad part is, some of these lines of code don't even need to be there. I was in a rush, and it worked. So if it ain't broke, don't fix it. When I was going through and cleaning some of it up to actually make it take out some of the extra spaces, I'm like, I don't need that. But, you know, in a matter of full disclosure, I'm going to tell you guys that I screw up. And, yeah, there's some screw-ups in here. But it works. For example, we do not need the type def enumeral. It's about the seventh line down. The role ping out equals one. Doesn't do anything. It's defining a variable that we don't even reference. So one line down. Okay. All right. Let's try this. All right. So serial application tied to the receiver in the purple case. It's connected over serial. And now we'll power up the badge. And, again, thank you for loaning me the micro USB cable. Remind me to give this back to you. To prove that I'm not doing anything funny standalone. Plug this in. Let it boot up. And it should immediately start spitting out tail number. And we gave it a fun tail number. Okay. The aircraft beacon is DEF CON 22 wifi village NRF54L01 plus. No, it's the 24L01 plus. Low bandwidth radio. Processing for the Arduino is eh. But it will have some issues. So it is actually the DC wifi village NRF24L01 radio. But in some of the cases it's received as 54. Why? No idea. But it is. It started doing this at home to me, too. So maybe I screwed something up. It is actually the 24. It is 24 in the code when I programmed it. That was easy. Go flash two Arduino examples. Plug them in. And you're doing data transfer at 1 meg for $1 radios and connect it to, like, $25 Arduinos. It's pretty cool. All right. Now let's go for the advanced one. All right. Let's just disconnect that. No. All right. For the advanced one. All right. So I need to unplug that. And need to plug this in. So this is the unifying receiver from Logitech that I'm going to plug in here. And hopefully that will work just fine. Keyboard is on. And working. So I've got one of these Nordic NRF radios attached to GoodFET according to Travis's wiring. And the GoodFET is actually working. The reflow actually worked. So we can now use the GoodFET applications. Travis has given us some nice scripts. The GoodFET.NRF script. And if we run that without some commands, he's going to tell us all the different fun things that we can do. Capture spark fun, dongle traffic, open beacon traffic. We can do some auto tune for radios to try to discover stuff that's on specific channels. However, if we do that with the sniff Microsoft keyboard. We're going to sniff Microsoft keyboards with specific HID applications. If we have the Microsoft keyboard, it will determine all of the USB human interface device codes and will convert those to keystrokes. This is unfortunately not a Microsoft keyboard. It is a Logitech keyboard. So it doesn't know how to decode them into the keystrokes. It will, however, give us the raw packets. And then we can potentially do some magic with those packets as well. It does take a little bit of time because the radios on these devices turn on to a pseudo random frequency every time it turns on. So it attempts to do sniffing on all channels. But it cannot do that. It has to go through each channel at a time. And when it sees stuff that are interesting based on various headers, either 55 or AA, it says, hey, we've seen some stuff that looks like it might be a packet. And we're going to see... so we saw one. This one looks like a valid packet coming from a device of AAA. And quite honestly, this may be the guys over doing CTF totally screwing with me. So it's going to step through all the various channels. It takes some time. And eventually we'll start seeing stuff that end up looking like packets. This is totally impressive, right? Hey, look. It tuned to a channel. Yeah. There's not a lot of way I can make it speed up. I'm like, oh, great. I'll just find out what channel this keyboard talks on and set it to tune to that channel automatically. Don't do any of this auto tune stuff and just have it spit packets. The problem is every time you turn on the keyboard, it does a different channel. So we saw some different stuff on 2403. Again, lots of AAA stuff. So likely noise. Probably some more noise there. We had lots of fives in a row. And 2403 as well. It now starts spitting us out packets. When we see stuff that ends up being valid over a longer period of time, we can take the address cell, tell it, hey, just sniff for this address. And then it starts dumping us keystrokes. So with the Microsoft keyboard, it gives us actual converted keystrokes. With this one, I haven't had the opportunity to figure out how to make that work. Again, I was working on this on Tuesday. Made this work on Tuesday and into Wednesday morning. So haven't had the opportunity to start reversing that. But fun stuff. Didn't take a heck of a lot to make that happen. Of course, now all the guys at CTF are turning around going, huh. No. All right. We'll let that stop. Hey, guess what? No demo unicorns. All right. And now I get to admit something kind of embarrassing. Well, that's all I've got for you guys in some pretty good time. But so the demo unicorns were tempted and they didn't show up. So he-man on a flying unicorn, your argument is invalid. However, I take issue. This is not a unicorn. A unicorn has a horn and no wings. A pegasus has wings and no horn. So what is a flying unicorn called? An alicorn. Why do I know this? My 6-year-old daughter is obsessed with My Little Pony. I'm like a closet brony and I don't know it. That's all that we watch in our house is My Little Pony. Please, God, save me. To the point that I knew that this was an alicorn. And I actually went and made sure I looked it up. So, yeah, it is not a unicorn. It could be. It's not a unicorn. It's either an alicorn or, according to some sci-fi authors, it is also a pegacorn or a unipeg. So, yes. And my boss so kindly filled me in when, even better, that this is neither an alicorn, a unipeg, a pegasus, a unicorn, or a pegacorn. This is, in fact, Strider from He-Man. All right. So thank you guys very much for getting up nice and early on Saturday. Hopefully I didn't bore you too much. And, you know, go forth and conquer. Some really neat stuff. Really inexpensive to start getting involved with. And has some pretty interesting application. You guys can build a keyboard sniffer for Microsoft Logitech 2.4 gigahertz keyboards and take this back to your organization, do some auditing and say, get rid of these damn things. Unless you really want to have some fun. These radios will transmit. So now take what you've learned about the receive and start crafting packets and injecting keystrokes. Exercise left to the reader. Some of these slides, text is a little bit hard to read. If you want to go back and look at this, I know they're recording it. So it will likely be at irongeek.com later and various places. The slides, as soon as I get home, and by home, I mean probably late next week, because I go directly from DEF CON to a client site. I hope they like the hair. So I'm literally leaving from DEF CON to go to a client site after I go home. I'm going home for about six hours, pack a suitcase and leaving again. So I will put the PDFs up on my website at hacksterthematrix.com. It's my blog. There's a total of five entries. You'll be able to find it. So I won't give you a specific link to a specific entry. You'll be able to find it. And there's all sorts of other fun stuff up there as well. Great. So thank you for spending some time with me this morning. I'm going to stick around for a while if you guys have got questions, cool fun things. I actually want to see if I can capture some stuff with some software defined radio as part of the CTF and get some practice. So good time to do that. Thanks for coming. And thank you. Enjoy the rest of your DEF CON. And we'll see you all for ham radio exams tomorrow, right?