start	end	text
0	3240	All right. Good morning.
4920	7900	Should I not talk too loud? Any of you guys got headaches?
10980	15040	What's that? Pass the flask around. A little hair of the dog.
15180	19940	Yeah, all right. Yeah, there isn't enough left in the flask.
21100	27460	But so, yeah, I'll try not to bore you guys to death this morning. But thanks for turning out.
27460	32820	Yeah, it is interesting times in the wireless village. I was originally scheduled for 7 o'clock
32820	39380	on Thursday, but those darn EFF people got in our way. So here we are back. I'm going to do the
39380	45160	talk that was originally scheduled for Thursday at 7 now. Bright and shiny early Saturday morning
45160	54780	after all our great DEF CON parties. Yeah, I went to bed early. I went to bed early.
55420	61660	2 a.m., and the alarm went off at 6.45, and I haven't had nearly enough coffee yet.
61780	71100	So all right, let's get started. We're going to do an introduction to the Nordic NRF24L01 Plus.
71100	76700	It's a pretty cool wireless chipset that I had an opportunity to do some playing with for a
76700	81220	project. We'll talk about that project and all of the stuff that went along with that.
81780	87080	We'll see that within sort of this project and the presentation and some of the stuff that
87080	93440	we worked on for this, this may also be a candidate for next year's fail panel.
93640	100780	How many of you got to go to the DEF CON Comedy Jam panel? And yeah, we had some folks up there.
100780	106580	The overarching theme of that is fail every year. And we tried to do something that was humorous.
106580	112940	One of my coworkers and I, we hacked some Teledildonic devices.
113520	118540	So we played and hacked with an internet and Bluetooth-connected vibrator
119360	127580	for epic lulls. It was lots of fun. And it, yeah, owned all sorts of interesting social
127580	133380	connotary as well. So the overarching theme of fail, people make mistakes,
133380	139720	and there were definitely some mistakes that were made going into this. One of those being,
139720	145580	you ever have that time when you take on one too many projects? Yeah, I'm about three projects too
145580	152880	many too deep, and this was one of them. So there's sort of lots of exercise left to the reader. It is
152880	157700	definitely an introduction to some of the capabilities of this Nordic Radio. But we'll
157700	162300	give you some examples, some ideas as how you can use it. And it's definitely something affordable
162300	168500	that you guys might want to start playing with. All right. So a little bit about me. I'm a hardware
168500	177280	hacker and penetration tester for a small boutique consulting group called InGuardians. I just had
177280	184160	my one-year anniversary with them. And sort of as a part of this project, my one-year anniversary
184160	188640	right about DEF CON last year, I had a little impact into the project where I got introduced
188640	195180	to this radio. And I'll explain that in a little bit. I'm also an instructor for the SANS Institute.
195180	203200	I teach their wireless class, SANS Sec 617. So wireless security, ethical hacking, and defense.
203260	208350	I'm also a member of the Paul's Security Weekly crew, formerly known as Paul.com Security Weekly.
208860	215380	Yes, trademark disputes. We changed the name. It was going to cost us $15,000 to fight the
215910	223480	Paul.com issue with no guarantees at the end. So we elected to spend $5,000 to rebrand and have
223600	230120	a $10,000 party with a guarantee at the end. So yeah, it was a financial decision and it worked
230120	237100	out. I'm also an extra class ham radio operator. My call sign's KB1TNF, Kilo Bravo 1, Tango November
237100	244760	Foxtrot. Or if you're being funny, Kevin Bacon 1. That's not funny. Okay. How many of you guys
244760	248300	are going to take your ham radio exams tomorrow? How many of you guys are going to show up and
248300	255140	take the cram session at 9 to noon here tomorrow? Yes, come do it. It's totally worth it. Totally
255140	261640	worth it. All right. All right. So I had a little inspiration for talking about this radio and
261640	269500	learning about this radio. I participate as an event organizer and volunteer for the Mid-Atlantic
269500	276240	Cyber Collegiate Defense Competition. It's a competition where college students create teams
276240	282680	within their local university for computer security club or computer club. They participate in some
282680	288640	local and regional events. The semifinals are held regionally. I participate at the
288640	294020	Mid-Atlantic region that divided into a bunch of different regions. As part of my involvement
294520	299600	for the last four years, I've created their electronic badges. And their electronic badges
299600	305700	as part of their scenario have been what's considered in scope. They're a hackable and
305700	310640	defendable asset and they're scored based on points as to what they do with these badges.
312980	316820	Normally this goes pretty darn well. We have lots of time to work on the badges. We know what the
316820	323780	theme for the next year's competition is going to be a year in advance. So basically the ride home,
323780	330180	eight-hour car ride on the way home, my cohort and I start talking about what we're going to do for
330180	335660	the badges next year on the ride home. Unfortunately, the year before we didn't have a good
335660	341800	handle on what we were going to do. And right about that time, so actually not last year,
341800	347040	the year before at Mid-Atlantic CCDC competition, I was actually participating in my exit interview
347040	352920	for getting laid off while at competition. So I was leaving competition unemployed.
354180	363040	That was kind of interesting. So to that, in that year, over the last year,
363040	367300	things sort of got put on hold as far as examining stuff what we're going to do for
367300	376380	last year's Mid-Atlantic CCDC competition. So I was unemployed, found a job, was a great job.
376380	381440	I was there three and a half months and they laid me off. So I got laid off twice in a four-month
381440	386700	period, which sucked. In that four-month, three-and-a-half-month period, we had a child.
387060	393020	We have two kids. So yeah, we had a four-week-old at home who had just come home from the hospital,
393020	398980	was three weeks early, and has spent a week and a half in the NICU. So needless to say,
398980	405060	there was a little bit going on in my life outside of looking at badges for the Mid-Atlantic CCDC
405060	411660	competition. It ended up coming down to two months prior. Oh, so my compatriot as well,
411660	417100	Darren Wigley, had helped me for four years on building badges and coming up with a scenario.
417420	423720	He also got laid off from the same company at CCDC the year prior and his new job had him
423720	430900	traveling 90% and had just no cycles to give to me to help with the badges. So I was on my own
430900	437500	and by the time it came down to it, I had exactly two months to come up with a scenario, build a
437500	442660	badge, get it implemented, and then bring it to the competition. So I needed something fast and
442660	448440	easy. Some of those design constraints for that particular badge were you're going to be handing
448440	452560	this badge to a bunch of college students that may have never touched a microcontroller in their
452560	457120	entire life, yet you're giving them a badge with a microcontroller that they have to learn how to
457120	462960	program and defend in two days. Same thing from the red team side, the attackers that are
462960	467440	attacking these students' networks. Some of these attackers are not hardware guys, they're software
467440	471720	guys, they're web application security guys. They may have never touched a microcontroller in their
471720	478520	life. So they need to learn how to turn the badge into an attack tool in two days. So it needs to be
478520	483620	something that you can attack and defend in two days and do it fairly simply. Turns out this was a
483620	488820	pretty interesting thing. I had some design constraints that I needed to think about for this.
488960	494140	We're giving them to them as a badge, and so they need to be powered for two days. The badge needed
494140	498380	to be powered with some fairly standard type of batteries. There was a budget involved. I couldn't
498380	505320	spend two or three hundred dollars on a badge. I think I had the whopping price of $48 per person
505320	513180	for a badge, which is pretty significant. The badge development effort is all funded through
513180	518820	grants through the National Science Foundation for this event, as well as private donations and
518820	524160	corporate donations as well. So there is a limit. I needed something that we could
524160	528320	have low power that the students and attackers could wear around their necks for two days on a
528320	534900	set of batteries. It needed to be relatively low cost and sort of low barrier to entry for the
534900	541910	students to start figuring out what they needed to do. What ended up happening is I selected a
541910	546330	set of radios because they ended up being fairly low power, fairly inexpensive, and easy to use.
546630	552970	But additional research after the fact and during implementation time, I found these radios, the
552970	557930	Nordic NRF 24L01 pluses, and I went, oh, these are going to suit my purpose. These are really
557930	563230	neat. And then after I got them in my hand, I was like, these things are awesome. There's so
563230	567270	much more that you can do with these with some hackery. And that's sort of what I wanted to
567270	572710	introduce to you folks today. This is probably a radio chip set that many of you have never heard
572710	578710	of but can have some really cool fun things and some potential security application for you as
578710	583870	well. We're only going to take sort of a scratch at the surface. Many of those exercises left to
583870	587630	the reader. I'm going to give you the introduction as to some of the things you can start doing,
587630	594030	some challenges with those as well. So this is the display. We've got a setup here. Not quite
594030	602050	as nice. What the badges ended up turning out to be were simulated aircraft ADS-B beacons and
602050	606890	simulated because they had very little code space to deal with. So basically what ended up happening
606890	612250	is that the badge just spits out an aircraft tail number. Hey, I'm aircraft this. And the
612250	619030	radios have a fairly short transmit and receive distance. So we built a aircraft arrivals and
619030	625730	board. So when they came close to the, quote, airport, the station here, the station would
625730	630570	receive messages. And it would receive messages of a tail number. So we'd put them in an arrivals
630570	636150	board. And every time a message was received, they'd reset the counter on the arrivals board.
636150	643510	After that message was not seen for a five-minute period, it would move into the departures board.
643750	647490	If we didn't see a beacon from an aircraft for five minutes, that means they're not there
647490	652650	anymore. They've departed. After they were in the departures board for five minutes,
652650	656850	that means that they're gone. This was also right about the time that the Malaysian
656850	661570	airlines flight disappeared over the ocean. So there were all sorts of jokes there.
662250	670530	Yeah. Completely unrelated. Yeah. Yeah. Yeah. What? Too soon? Okay. All right.
670730	675050	All right. So a little bit about this radio. It's a 2.4 gigahertz radio in the ISM band,
675050	681430	industrial, scientific and medical band. No license required to use. Just like your BGN
681430	687570	wireless stuff, some BGN wireless stuff in the same frequency ranges. It's fairly low speed.
687590	693950	Maximum data rate transfer is 2 meg. Typically we see them more often in the 250k to 1 meg
694570	701890	range depending on application. It is very low power consumption for a radio. You can do all
701890	708050	sorts of radio shut down over the radio with some of the various implementations. Requires 3.3
708050	716290	volts. And at a minimum, sorry, 3.3 volts at a minimum 1.9. So we'll take a set of batteries
716290	723250	and drain those really well. Take them all the way down to make them unusable. Grab every possible
723250	728790	amount of power out of them. So get some pretty decent battery life and it will continue to work
728790	736590	all the way down to 1.9 volts. Uses Gaussian frequency shift keying, GFSK modulation. So for
736590	741190	those of you doing some of the GNU radio, GNU radio companion stuff, we now know how we can
741190	750330	potentially start decoding some of this stuff. The chip itself is a QFN 20 by 24 by 4 millimeter
750330	757410	by 4 millimeter. 10 millimeter by 10 millimeter, sorry. QFN package. These things suck to solder.
758410	761930	Hence, every time you're probably going to buy one, you're going to buy them on one of these
761930	766750	breakout boards. This is actually some of the samples that I had in my home office. Some of
766750	771450	these breakout boards that elude at higher expense actually include a RPSMA connector and you can add
771570	778230	a standard 2.4 gigahertz antenna to it. So this has just got the like the 1.1 DBI rubber ducky
778230	782970	antenna. There's no reason we can't go take an 18 DBI parabolic dish antenna and put it on here
782970	789890	if we want to. So we increase in distance and have all sorts of good fun there. The standard
789890	798810	version without the RPSMA connector, very similar to this one, in small quantity, quantity of 10
798810	805290	on eBay from China, they're about $1.10 a piece. I can buy a bunch of these things and throw them
805290	809610	away if I want to because they're that cheap. You think about some of the other chipsets that you
809610	813510	may be looking at, you know, Wi-Fi chipsets, you're probably going to pay $30 or $40 for.
813870	817530	The breakout boards from SparkFun are going to be relatively expensive, maybe $50, $60.
818690	824230	Bluetooth, Bluetooth Low Energy, you're probably $5 to $10 a piece. Zigbee, some of the stuff that
824230	831850	I've seen for the development kits are about $40 on the low end. These are a dollar. That's good.
831870	836950	And for a radio that costs a dollar, we can do all sorts of fun stuff with those.
836950	846910	Okay. Some other interesting ones as well, the NRF24LU one also has built-in USB support,
846910	853070	so it becomes a USB device. You can plug that into any USB port and access it over serial.
853650	859630	The devices that we're looking at here are actually SPI bus, so a little bit different.
859630	863810	We've got to have another microcontroller in between this device and potentially something
863810	867890	else to use it. Those other devices are a little bit more expensive with the built-in
867890	873430	serial support, and they don't necessarily integrate as well with a standalone microcontroller.
874690	882570	All right. Within the Nordic NRF24LU one, they've got their own standard protocol called
882570	891550	shockburst, and most notably advanced, sorry, shockburst enhanced. It does all sorts of fun
891550	899190	packet stuff for us, very much like we'd expect for 802.11 TCP, you name it, it does packet
899190	906870	assembly, CRC checksums, retransmissions, shockburst enhanced will handle all of this stuff
906870	912930	for us. In the default mode. Plug it in, start sending packets to the radio, packets come out
912930	916150	of the radio, received by another radio, shockburst enhanced, and we don't have to worry about
916150	925190	anything. Awesome. And it costs me a dollar. However, we can take one of these devices and
925190	930950	put them in what they call direct shockburst mode, which leverages us the ability to directly
930950	936290	access the radio and craft our own packets within the limitations of the shockburst enhanced
936290	942070	framework. There's some specific challenges to that. So we can implement with these radio chips,
942070	950370	implement ANT, iBeacon and some Bluetooth low energy functionality for a radio that costs us a
950370	958090	dollar. It's all done in software and not saved at the radio. We've got some links to the spec
958090	964010	sheet as well. And I'm trying to remember, my images for these, for a lot of the slides come up
965330	970770	as take the title of the slide, go to Google image search and take the first image that's
970770	977270	decent and shows up. This is a Marvel superhero from like Marvel Saturday morning cartoon
977270	982090	somewhere. And I have no idea which one it is. And I tried to remember which one it was.
982270	987730	But it was the only one that actually looks cool when I put protocol in Google image search.
987970	993250	So that's what we've got. All right. How do we interact with the radio?
993250	1000210	We're going to use SPI. When I started looking at SPI, I had never worked with SPI before I
1000210	1005770	worked on this project for the Mid-Atlantic CCDC project. And I thought it was this voodoo
1005770	1011770	and magic. Turns out you spend about 15 or 20 minutes with it and you'll get some pretty good
1011770	1017870	ideas. I happened to interface mine with an Arduino. And I can hear you guys saying I hate
1017870	1023190	Arduinos for microcontroller. I get it. But guess what? I had design constraints. They're easy to
1023190	1027710	use. Had to have students that had open IDE that they could use. Didn't want to have to have them
1027710	1032970	spend money to participate in this challenge. It's easy to use. Even a monkey can do it just
1032970	1039230	like this one up here. Using SPI on the Arduino was actually pretty darn easy.
1041130	1048010	So if you want to learn some more about the SPI implementation, Nordic Semiconductor and some
1048010	1053130	other folks have got some great tutorials on understanding SPI. This was the one that I used.
1053690	1059750	And SPI does allow us to have multiple of these serial devices on the same chain. So we can
1059750	1066670	conceivably daisy chain multiple radios. Pulsing which ones are on and off. And we could conceivably
1066670	1071990	do that with an Arduino as well. It turns out it's really not as much voodoo as you seem to think and
1071990	1079810	ends up being fairly easy. So Larry, why the heck do we care about this stuff? Well, we're seeing
1079810	1089690	the adoption of the Nordic NRF24L01 and L01 plus radios in all sorts of commercial devices. Max
1089690	1097770	Moser and I want to say Dominic Spill actually spent some time as part of their Keyboard
1097770	1103930	Sniffing Development Project figuring out which devices had some of the stuff. That's where some
1103930	1112330	of the Ativa platform stuff. It's a voting platform for like when you go into like a
1112330	1116550	closed caption studio audience type of thing. And you can vote on various things based on some of
1116550	1122550	the shows and some of those types of things. Wireless device that you can do some voting with.
1122550	1129250	The Nike plus portion that goes the beat portion that goes with your in your shoe that tracks your
1129250	1138170	steps. Uses the Nordic radio as well. The Garmin Chirp for doing activity tracking for exercise.
1138670	1147810	A whole bunch of unnamed medical devices. In this one, a Suunto sports instrument.
1148650	1155070	This one's the Microsoft keyboard. The Logitech unifying receiver. How many of you guys have
1155070	1160890	bought one of these Logitech wireless keyboards at like Staples recently with a unifying receiver?
1160890	1167550	It's the one with the little like red star thing on it. Nordic NRF24L01 plus radios. In fact,
1169190	1172390	I picked this one up at Staples last week for 20 bucks.
1173310	1178630	And now we can have all sorts of fun hackery for a $20 keyboard and a $1 radio. A little bit more
1178630	1184010	complicated. Various unnamed medical devices. I have a good friend that may or may not have
1184010	1189970	hacked his own insulin pump and I'll leave it at that. Some of those type of devices that may be
1189970	1194790	life-saving actually contain some of these radios and could have some pretty serious impact should
1194790	1201470	some of that stuff go bad. So thanks to Travis Goodspeed. He spent a lot of time looking at
1201470	1209210	some of these radios and interacting with these radios with the GoodFET, the interactive board
1209210	1215850	for dealing with all sorts of fun devices, ZigBee and others, dealing with various wireless chipsets
1216910	1222930	and all open source. I highly suggest if you're interested to pick one up, it's all open source.
1224330	1230570	Travis, through some magic of math and implementation hacks, discovered that we
1230570	1238090	can turn one of these Nordic radios into a promiscuous sniffer. It's a little bit convoluted.
1238090	1245630	He's using some modes for the registers in the chipset to an invalid state at which point the
1245630	1250150	radio says, oh, well, that's fine. I'll just turn the radio on and just spit you a stream of raw
1250150	1255250	data. And then we can disable some of the other settings as well. So shock burst doesn't process
1255250	1262570	stuff like CRC 32-bit checksums. And now we potentially have a $1 2.4 gigahertz sniffer.
1262570	1270090	Okay. It does require some interesting hackery. It will not do channel hopping. The radio takes
1270090	1275210	in radio terms, anyways, takes some significant time to retune the radios between the different
1275210	1280410	channels for channel hopping and the time that is remaining for a lot of the protocols that do
1280410	1284110	channel hopping. We don't have enough time left to actually do any processing on the packet that
1284110	1291030	we receive. So it can't hop fast enough. But we can sit on one channel and listen for traffic as
1291030	1297190	it goes by on that one channel. Very similar to how the Uber Tooth One operates for doing some of
1297190	1303210	the Bluetooth sniffing. It sits on channel 39 by default and listens for all the packets go by on
1303210	1312050	channel 39 when it hops 1,600 times a second. We'll get to this a little bit more. All right.
1312050	1317290	So one of the things that we mentioned, we can do Bluetooth low energy. And for any of you who
1317290	1324750	have seen Mike Ryan's talk on how smart is Bluetooth smart, you learn that Bluetooth low
1324750	1333490	energy is all sorts of fail. They significantly reduced the channel hopping requirements,
1334180	1339510	took out half the number of frequencies and the number of channels, shortened the frequency
1339510	1346090	hopping time frame, and some various cryptographic failures as well. So it might be neat for us to
1346090	1352770	start looking at some Bluetooth low energy stuff. The maximum data rate transfer for Bluetooth low
1352770	1358650	energy is 1 meg, which is well within the duty cycle of the Nordic radio. It would do 250, 1 and
1358650	1367370	2 meg. So we certainly can do some of that. The problem is that observing and or transmitting
1367370	1373810	some packets with the Nordic radio, the enhanced shock burst when we go into direct mode and
1373810	1382170	disable CRC 32-bit checksum checks, the packet size is only 32 bytes long. Let me make sure I
1382170	1389530	get that number right. Yep. 32 bytes long. But Bluetooth low energy packets can be up to 39
1389530	1396910	bytes long. Some of the packet types, depending on their advertising rates, we can fit and have fit
1396910	1402690	in the 32-byte packet. So we only have the ability to sniff and or transmit specific packet types.
1402690	1408870	Specifically, one of those is the advanced no connection indicator. Hey, I'm a device and I'm
1408870	1415290	here. So broadcast packets. So we can observe broadcast packets and we can conceivably craft
1415290	1423270	our own. However, also only on channels 37, 38 and 39, which is where all of these actually happen
1423270	1428470	within Bluetooth low energy. All of the discoverable mode packets for Bluetooth low energy happen on
1428470	1436350	three channels as opposed to 79 with normal Bluetooth stuff. So Bluetooth low energy sniffing,
1436350	1440850	yes, I actually went to meme generator and created this specifically for this slide.
1441010	1450270	I couldn't find anything in Google image search, so I went and made my own. It's not so easy to do
1450270	1455690	Bluetooth low energy sniffing with one of these devices. The channel hopping is one of the ways
1455690	1461750	that's going to come down to fail for us. The radio just can't hop fast enough for Bluetooth
1461750	1466790	low energy to do connection following. But we could do very similar types of things like the
1466790	1472410	ubertooth one does by listening on one or potentially implementing three radios and
1472410	1477270	sniffing on just three channels. However, based on the packet size problems, we're only able to
1477270	1484090	grab those advanced non-connection indicator packets. So we can find beaconing devices and
1484090	1489350	potentially beacon devices ourselves. So some limited capabilities, but we only paid a dollar
1489350	1499050	for it. All right. Have you guys heard of iBeacon? This is kind of neat stuff. Apple's
1500750	1507250	pseudo-proprietary technology for doing location tracking. Some of the stories that we hear about
1507250	1515830	Apple wants to see successes for iBeacon is to put iBeacon's devices within, say, grocery stores
1515830	1520070	so that when you fire up your grocery store application and you walk around the grocery store
1520070	1526510	and you show up in the toilet paper aisle, it knows you're in the toilet paper aisle and you're
1526510	1532370	standing in front of the Charmin and it can beam a coupon for Charmin to your phone while you're
1532370	1537630	standing in front of Charmin. Because you'd normally buy Quilted Northern, but hey, now I've
1537630	1543830	got this coupon and now they're the same price or cheaper, so I'll buy Charmin. Location tracking
1543830	1549610	within building with a commercial application and now we start tying that to something for
1549610	1558110	purchasing habits, that's kind of creepy. That said, it's still a pretty darn neat application.
1558830	1564690	We can still, with the Nordic Radio, do some stuff with iBeacon. However, iBeacon is based on
1564690	1570030	Bluetooth Low Energy and we just sort of went over some of those challenges with Bluetooth Low Energy.
1570590	1577510	However, some of those challenges still exist. We can only either broadcast or sniff
1578010	1584270	the presence for some of those devices. And injection actually works a little bit better
1584270	1591210	here. So we can create iBeacon advertisements. Hey, I'm an iBeacon and I'm here. And that's
1591210	1597110	sort of about it for this radio with iBeacon. All right, some practical implementation for you guys
1597110	1602070	to get started for some of this stuff. This is exactly what we used for the Mid-Atlantic CCDC
1602070	1609430	competition. This is their badge. Sexy, isn't it? It's an Arduino micro and one of the radios.
1609430	1614630	And a battery pack and a lanyard. I didn't put the battery pack. They had four AA batteries
1614630	1619370	and a USB connected thing. So I made these guys wear four AA batteries around their neck
1619370	1626890	with this nice thin lanyard for two days. It sucked. It sucked. But the battery packs were cheap.
1626890	1631150	We got them in all under budget. I got them in way under budget and they had a great time with them.
1631170	1637530	Okay, so with this, with the Arduino, we're using the SPI libraries, which were included. If not,
1637530	1645810	fairly easy to grab. And there are a couple of ‑‑ there are at least two Nordic NRF 24L01
1645810	1652450	libraries available for Arduino. This was the one I found to be the most robust, the one from
1652450	1659110	Maniac Bug. Easy to install, copy, unzip, put in your Arduino libraries folder and import your
1659110	1664430	libraries. He's got tons of examples. Part of the reason why I really liked some of his stuff,
1664430	1673010	it's well documented. And the examples are well documented as well. The ADS‑B beacon is half of
1673010	1680090	his ping pair transponder examples. It took me all of three days to write the code to modify his stuff
1680090	1687230	and put it through some pretty rigorous testing. Based on the code for that ping pair example. And
1687230	1696350	yes, giving credit where credit was due. Most of the code was Maniac Bug's. And got it done in a
1696350	1702670	two‑month time frame. This is the one that was really flexible. Because it's library based, we
1702670	1707870	can do some modification to it. We can actually use the libraries to set all the registers to
1707870	1712610	disable the CRC 32‑bit checksum. We can enable shock burst direct mode if we really want to.
1712610	1718370	And there's also some libraries for us to do some of that limited Bluetooth low energy stuff
1718370	1727090	under Arduino as well. With the BT ‑‑ Bluetooth low energy libraries as well. So, fairly easy to
1727090	1733570	use. It's six wire SPI. If I remember correctly. Five or six wires. We can go through and count
1733570	1740730	them if we really want. When we built these, I recruited help. I recruited my six‑year‑old
1740730	1747730	daughter and my wife to wire these. If my six‑year‑old can wire these, so can you.
1748870	1756510	All right. So, lots of good fun. Now, there's all sorts of things that right out of the box
1756510	1760250	with the Arduino stuff, we can start capturing. We can start capturing some of other Arduino
1760250	1766350	traffic. Some other potential applications with standard shock burst enhanced stuff.
1766350	1774430	For example, some great proprietary type of items. There's some folks here at Con from the Midwest,
1774830	1780050	a group that calls themselves the Whiskey Pirates. They decided that they wanted to have a learning
1780050	1785070	experience before they came to DEF CON. One of the guys wanted to learn surface mount soldering.
1785070	1790010	The other guy wanted to learn how to do board design with Eagle. The other guy wanted to learn
1790010	1797250	how to program ARM Cortex A7 processors and do some firmware development for that. So, they got
1797250	1804210	together and they did just that. And, in fact, they built this badge in, like, four and a half
1804210	1809950	months. Like, damn! And they didn't get to implement all the features and firmware. They
1809950	1815690	gave me this one Thursday late afternoon. They were still in their hotel room cranking out
1815690	1819310	firmware and they were, like, reflashing these things every 15 minutes because they were adding
1819310	1824390	more and more features. As one of the things that they wanted to do further development for,
1824390	1831530	these badges feature Nordic NRF24L01 radios. They wanted to be able to do games between the
1831530	1839070	multiple badges, the ability to have a microphone so that would do VU meter type of stuff and sync
1839070	1844150	the levels for the VU meter between all the badges. So, like, one guy could be in the party
1844150	1849250	and everybody else can be in the hallway and they're all thumping to the same beat. Pretty cool.
1849250	1855130	We can potentially use that to sniff and or mess with those as well. Okay. Lots of hobby-based
1855130	1860890	applications. How many of you guys have seen the Flea Microcopter? And I can't remember the
1860890	1870970	company that makes it. It's one of the tiny, tiny nano quadrotors. It's about this big. They
1870970	1877810	use the Nordic NRF radio to do control for that device. Wireless 2.4 gigahertz. So you can now
1877810	1885650	conceivably build your own controllers and crash other people's quadcopters. Okay. All right. Some
1885650	1889810	of the stuff on the back end may require some significant post processing depending on what
1889810	1897010	you're doing. Okay. So this stuff becomes fairly easy to do. We talked about the Arduino. How many
1897010	1902950	of you guys have ever done any Arduino work? Okay. All right. You guys can do this. Grab the demo
1902950	1910490	stuff and start from there. My college professors told me all good programmers reuse code. Doesn't
1910490	1916970	necessarily need to be your code. Give credit where credit's due. So really easy for us to
1916970	1922830	implement. The libraries are there. There's some great examples. And sure enough, take one of the
1922830	1932930	examples, flash them to a pair of Arduinos, and it's that simple. And communication works. I'm
1932930	1937190	the challenges that I ran into with the Mid-Atlantic CCDC badges that I didn't realize
1937190	1942430	until half the badges were already built is that they'll make a pseudo mesh as part of
1942430	1949670	shock burst enhanced. But the mesh will really only support effectively six devices. I created
1949830	1958390	a mesh and it had 110 devices. It didn't work very well. It worked well enough for the students
1958390	1962130	to have fun with it. But that was one of the things that we ended up telling them about.
1962130	1968290	You can create cascaded meshes so that you can do routing and fault tolerance over the
1968290	1973750	meshes as well with enhanced shock burst. So you could have conceivably multiple meshes
1973750	1978590	with six or five or six devices and route through those meshes as well.
1978590	1982530	I didn't know that at the time. I just gave everything the same address and
1982530	1989370	sent all the traffic to broadcast. It did not work out so well. There were lots of crashed aircraft.
1990170	1995650	But so it can be loads of fun with too many nodes, potential denial of service conditions.
1995650	2001330	So that might be something to look at as well. I specifically talked about using it with the
2001330	2008910	Arduino. That was where a lot of my experience lied. However, it's a standard SPI bus. So any
2008910	2014030	microcontroller that you can do SPI with, you can use this radio on. You want to do that on the
2014030	2020750	Arduino, sure. You want to do it on a Raspberry Pi, great, no problem. You can even use the Bus
2020750	2027510	Pirate, which if I recall is MSP430 based. Same thing with the GoodFET from Travis Goodspeed.
2027650	2035970	Also MSP430. Parallax from your DEF CON badge this year. If it does SPI, you can interface
2035970	2040110	with the radio. And there are likely libraries that you can use. And here's some of the standard
2040110	2045330	pinouts to be able to interface with the radios. Readily available on the internet. So very easy
2045330	2053270	for us to get to. So this is how you change a tire like a boss. I have no idea. I told you.
2053270	2061190	Google image search. Easy mods. And this came up. This looks like the Chinese army learning
2061190	2067530	how to change a tire while driving on their motorcycle with sidecar. I've actually seen
2067530	2071710	one of these videos and it's pretty damn impressive that they change the tire on the
2071710	2078370	sidecar while they're driving. Yes, you too can do this very easily. We can modify the libraries
2078370	2084510	to change the various settings, change frequency channels, change whether we're going to use
2084510	2091470	shock burst in direct mode, set our rates right within our Arduino libraries. However, if you're
2091470	2096390	going to change it within a library, the Arduino will use that same library in that same setting.
2096390	2102590	So you may want to have multiple instances of libraries or modify those libraries to assign
2102590	2110390	all of those from a variable from your main program. Fairly easy to undertake. Standard
2110390	2116050	programming practices about importing libraries and referencing libraries. So it doesn't exist
2116050	2121830	currently, but that's something that would be relatively easy to undertake. So for example,
2121830	2131710	here are some of the items within the RF24 libraries for us accessing some of the registers
2131710	2136870	within the radio. The libraries will handle all of this for us. You tell it to initialize the radio,
2136870	2140750	it goes and initializes the radio with all of these default settings, just like we'd expect.
2140750	2147130	You do two of them and they do the same things. Some additional registers so that we know what
2147130	2152890	the default values are. Go and read the spec sheet from Nordic. Find out what some of the
2152890	2157970	values you may want to change are depending on your application. And again, easily changeable
2157970	2166950	within the modules. Okay. All right. We talked about Arduino. That was really easy. You fire
2166950	2173650	up the Arduino IDE, you load some demo code, you put some stuff on there, and hey, look, it works!
2173650	2180750	Let's go down a little bit more advanced application. And I will admit, when I say
2180750	2186730	advanced application, it wasn't terribly bad. We talk about ‑‑ I talked a little bit about having
2186730	2193010	one too many projects. I did my advanced implementation stuff. I wrote these slides
2193650	2201770	Tuesday. Because I actually got a chance to do it on Tuesday. So I wrote the slides and did these
2201770	2210690	on Tuesday right before DEF CON. And I had some of the stuff sort of preloaded. But it was just a
2210690	2215890	matter of putting the pieces together and it didn't turn out too bad. Okay. So as we mentioned,
2216330	2223610	Travis Goodspeed found a way for us to be able to capture data with the Nordic radio with some
2223610	2228150	promiscuity giving us a raw stream of data. Now why don't we leverage some tools to take that raw
2228150	2235050	data and do some post processing. His implementation sets some of those registers for an
2235050	2241170	invalid mode to give us raw data and disables all of the CRC calculations and checking so that it's
2241170	2249650	not modifying any of that data on the way inbound. So his hackery was great. Send us all this raw
2249650	2258130	data. The data is going to look like data. But when we've got noise, it is typically ‑‑ the
2258130	2268970	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
2268970	2275570	specific strings for a device that we're looking for. In the case of Logitech and Microsoft
2275570	2282350	keyboards, the sync word and or start of some of the headers for some of the packets start with
2282350	2288910	55 in hex or AA in hex. So if you see a packet that's ‑‑ or a value that starts 55,
2288910	2294410	maybe this is a packet. Were there 0s and FFs before it? Yes. Throw that stuff away. This is
2294410	2298490	likely the start of a packet. Now let's start capturing that and take a look at that. That's
2298490	2309470	pretty darn neat. So why would Larry consider this advanced? Well, it requires the use of a
2310210	2318370	that you can actually purchase a good FET from Adafruit industries. They're 50 bucks. To me
2318370	2323770	that's kind of pricey for what it is. However, you can assemble your own. How many of you guys
2323770	2329330	have done surface mount soldering work? This is a great opportunity to go try to start with. This
2329330	2336590	was my first surface mount job. Which I got it to work. I used it to program my IME pink pager
2336590	2343210	and that was the only time it ever worked. It was my first surface mount solder job. It was horrible.
2343610	2348130	And I wanted to use it. This is the only one I had for this. So I had to take it down to the
2348130	2354730	basement to the soldering iron and put on the loop. And I had to reflow every single joint
2354730	2358870	on the board. I don't have a reflow oven. I don't have a hot plate. It's all by hand.
2359590	2365110	So to me, that's one of the reasons why it's advanced. The hardware assembly is a little bit
2365110	2371790	more complex. But Travis's design uses the MSP430 and there's SPI libraries with that. And
2371790	2377750	Travis has done a lot of the heavy lifting for us. He's got some applications for us to be able
2377750	2387710	to interact with the MSP430 and trigger the radio for us to capture packets. There's also a port
2387710	2394890	that I discovered on Tuesday of the GoodFET software to the Arduino with the same functionality.
2395170	2401130	So you can do all the same stuff that you can do with the GoodFET with an Arduino by having the
2401130	2407950	libraries ported to an Arduino as well. And the reason for that was the gentleman had more
2407950	2414350	experience with the Arduino, didn't have the ability to get his hands on or assemble a GoodFET.
2414350	2421450	So he ported that to the Arduino with the idea to be able to sniff packets from keyboards using
2422450	2431230	Travis's promiscuity hack. Great. I found out about this one Wednesday afternoon at 2 o'clock.
2431310	2436210	Like, I'm trying to pack to go to DEF CON and I'm still updating slides for this talk.
2437470	2443910	Because there was a post that got made on Hackaday Wednesday morning. I didn't stumble
2443910	2449970	upon it until 2 o'clock. I had to go to work on Wednesday and found it at 2 o'clock right after
2449970	2458570	lunch. And a gentleman had created an Arduino sketch and some plug-ins for Wireshark and a
2458570	2464890	Windows-based application to do a named pipe to interact with the Arduino to pass data to a named
2464890	2471610	pipe to Wireshark on Windows. So we can now use Wireshark to directly sniff using Travis's
2471610	2478590	promiscuity hack right into Wireshark. And he wrote some protocol dissectors for the Nordic
2481190	2488930	NRF24L01 packets. So we've got a module there, post-processing module, as well as the underlying
2488930	2495090	protocol for a device called MySensors. They do temperature monitoring and home control type of
2495090	2498310	stuff, open source type of things as well. And that's really what he wanted to do with it. He
2498310	2504090	wanted to be able to interact with that with the Arduino. So he did. All of the stuff is available
2504090	2515130	at these three blog spot links here. I apologize. It's a little eye chart. We'll get to that. But
2515670	2522130	limited analysis as far as the protocol dissectors go. But we've got PCAPs. Like stuff that we know
2522130	2528190	how to deal with with all sorts of various tools. And directly within Wireshark. The problem is, I
2528190	2534410	set this up to give you guys a demo. And it requires Windows. And Wireshark on Windows. And
2534410	2542590	application with name pipes. And I'm missing some redistributable.net objects on that Windows VM.
2542590	2547390	And I just didn't have enough time to make it happen. So it's a little buggy on the install.
2547570	2552370	And there's some comments on one of these blog posts on some of the issues that are still going.
2552370	2559610	But still incredibly possible. Okay. We can also do software defined radio stuff for some
2559610	2562570	sniffing. However, many of the software defined radios that you're going to find that are
2562570	2570010	affordable such as the RTLSTR real tech type dongles, the digital DV tuner stuff, do not
2570010	2576070	accurately do in many cases 2.4 gigahertz. So you now need to use a down converter, something that
2576070	2580490	will capture 2.4 gigahertz and then sort of retransmit that at a lower frequency within the
2581010	2590890	dongles. There are some plug-ins for I think SDR sharp as well as we can do this with GNU radio
2590890	2596810	and GNU radio companion to be able to decode enhanced shock burst packets. So all of the
2596810	2602350	stuff is there. It's just a matter of being able to capture that. This may be interesting for you
2602350	2611250	that are working on challenges, CTF. So I have some of the software defined radios. I don't
2611250	2619430	have a down converter yet. It's just too many projects, not enough time. And the CFO has yet
2619430	2624250	to approve additional purchases because I've already got enough hardware to play with. And
2624250	2631510	by CFO, chief financial officer, I do not mean the CFO at my day job. I mean my wife. Okay.
2631510	2636710	She does the, honey, would you rather this neat new tech toy or diapers?
2639370	2644530	Yeah, let's do the diapers. Because I don't want to clean the carpet. Let's do the diapers.
2644990	2650270	So, yeah, and it can be done relatively inexpensive. Under $75, including the
2650270	2654470	software defined radio. Folks that like hack shop or get them direct from China.
2654870	2660510	Down converters and cables direct from China, places like deal extreme. Have you guys done
2660510	2665170	deal extreme before? That place is like the easiest place for me to part with my money.
2665410	2669030	You go to deal extreme and you're looking for one thing and like, hey, this is cool.
2669150	2677690	Android tablet, $20. Smart watch, $6. Give me three. Yeah. Next thing I know, I'm checking out
2677790	2683490	a deal extreme and I got a $300 order of just cheap Chinese stuff that's awesome to play with.
2683490	2688110	And when am I going to have time to play with it? Yeah. So, for example, when we do the demos,
2688110	2695070	I've got this solar powered battery, 30,000 milliamp hour solar rechargeable battery.
2695410	2699570	I lost my other one, so I went to deal extreme to buy this one. Turns out they were so cheap,
2699570	2706870	I bought four. So I can lose it three more times. Okay. Turns out they're really handy,
2706870	2710170	especially when you come to DEF CON, because one can be in your hotel room charging while
2710170	2715790	you're charging your phone with the other one. Okay. So, yeah, we can do this fairly inexpensively
2715790	2722470	and use software to find radio to tune into some of the stuff as well. All right. So as promised
2722470	2727890	from the talk description, I'm going to do some demonstration, hopefully, and I'm going to tempt
2727890	2733710	the 2.4 gigahertz demo unicorns. And for those of you who have seen the Photoshop version of this
2733710	2739770	with Dave Kennedy's head, it's significantly better. Okay. So now let's see if we can
2739770	2745290	actually make something work. But before we get into that, the first one that we're going to do,
2745290	2749310	I know this is definitely high chart. I am going to give you guys a location where you can go grab
2749310	2757930	the slides. This is the code as part of the two halves of the Mid-Atlantic CCDC badge for the
2757930	2764730	badges that we did. This one happens to be the ADSB receiver. So I've got an Arduino with one
2764730	2768830	of these radios just sitting here listening for beacons, and I'm going to show you sort of the
2768830	2774470	output for that. Pretty short for code. I know it's a little crunched, so I could get it all
2774470	2780910	on one slide and make it somewhat readable. It will be better in the PDF, I promise. And here's
2780910	2788430	the transmitter, the ADSB beacon. You can actually read that one on the slide. It's what? 30 lines
2788430	2793930	of code, if that. And the sad part is, some of these lines of code don't even need to be there.
2793930	2800270	I was in a rush, and it worked. So if it ain't broke, don't fix it. When I was going through
2800270	2803450	and cleaning some of it up to actually make it take out some of the extra spaces, I'm like,
2803450	2808130	I don't need that. But, you know, in a matter of full disclosure, I'm going to tell you guys that
2808130	2816630	I screw up. And, yeah, there's some screw-ups in here. But it works. For example, we do not need
2816630	2823110	the type def enumeral. It's about the seventh line down. The role ping out equals one.
2823710	2829090	Doesn't do anything. It's defining a variable that we don't even reference. So one line down.
2829090	2841230	Okay. All right. Let's try this. All right. So serial application tied to the receiver in the
2841230	2850190	purple case. It's connected over serial. And now we'll power up the badge. And, again, thank you
2850190	2856270	for loaning me the micro USB cable. Remind me to give this back to you. To prove that I'm not
2856270	2865950	doing anything funny standalone. Plug this in. Let it boot up. And it should immediately start
2865950	2875010	spitting out tail number. And we gave it a fun tail number. Okay. The aircraft beacon is DEF CON
2875010	2886470	22 wifi village NRF54L01 plus. No, it's the 24L01 plus. Low bandwidth radio. Processing for the
2886470	2897710	Arduino is eh. But it will have some issues. So it is actually the DC wifi village NRF24L01 radio.
2897710	2904790	But in some of the cases it's received as 54. Why? No idea. But it is. It started doing this at
2904790	2911350	home to me, too. So maybe I screwed something up. It is actually the 24. It is 24 in the code when I
2911350	2918250	programmed it. That was easy. Go flash two Arduino examples. Plug them in. And you're doing data
2918250	2927490	transfer at 1 meg for $1 radios and connect it to, like, $25 Arduinos. It's pretty cool. All right.
2927570	2934770	Now let's go for the advanced one. All right. Let's just disconnect that. No. All right.
2934790	2952950	For the advanced one. All right. So I need to unplug that. And need to plug this in. So this
2952950	2959430	is the unifying receiver from Logitech that I'm going to plug in here. And hopefully that will
2959430	2968230	work just fine. Keyboard is on. And working. So I've got one of these Nordic NRF radios attached
2968230	2973710	to GoodFET according to Travis's wiring. And the GoodFET is actually working. The reflow
2973710	2980190	actually worked. So we can now use the GoodFET applications. Travis has given us some nice
2980190	2986290	scripts. The GoodFET.NRF script. And if we run that without some commands, he's going to tell
2986290	2993250	us all the different fun things that we can do. Capture spark fun, dongle traffic, open beacon
2993250	2999890	traffic. We can do some auto tune for radios to try to discover stuff that's on specific channels.
3000170	3006070	However, if we do that with the sniff Microsoft keyboard. We're going to sniff Microsoft
3006070	3012730	keyboards with specific HID applications. If we have the Microsoft keyboard, it will determine
3012730	3019330	all of the USB human interface device codes and will convert those to keystrokes. This is
3019330	3024450	unfortunately not a Microsoft keyboard. It is a Logitech keyboard. So it doesn't know how to
3024450	3029290	decode them into the keystrokes. It will, however, give us the raw packets. And then we can
3029290	3035710	potentially do some magic with those packets as well. It does take a little bit of time because
3035710	3043150	the radios on these devices turn on to a pseudo random frequency every time it turns on. So it
3043150	3048850	attempts to do sniffing on all channels. But it cannot do that. It has to go through each
3048850	3055150	channel at a time. And when it sees stuff that are interesting based on various headers, either
3055150	3061070	55 or AA, it says, hey, we've seen some stuff that looks like it might be a packet. And we're going
3061070	3068310	to see... so we saw one. This one looks like a valid packet coming from a device of AAA. And
3068310	3075070	quite honestly, this may be the guys over doing CTF totally screwing with me. So it's going to
3075070	3080190	step through all the various channels. It takes some time. And eventually we'll start seeing
3080190	3087750	stuff that end up looking like packets. This is totally impressive, right? Hey, look. It tuned to
3087850	3093110	a channel. Yeah. There's not a lot of way I can make it speed up. I'm like, oh, great. I'll just
3093110	3098210	find out what channel this keyboard talks on and set it to tune to that channel automatically.
3098210	3102130	Don't do any of this auto tune stuff and just have it spit packets. The problem is every time
3102130	3108210	you turn on the keyboard, it does a different channel. So we saw some different stuff on
3108910	3116590	2403. Again, lots of AAA stuff. So likely noise. Probably some more noise there. We had lots of
3116590	3123110	fives in a row. And 2403 as well. It now starts spitting us out packets. When we see stuff that
3123110	3130790	ends up being valid over a longer period of time, we can take the address cell, tell it, hey, just
3130790	3137930	sniff for this address. And then it starts dumping us keystrokes. So with the Microsoft
3137930	3144010	keyboard, it gives us actual converted keystrokes. With this one, I haven't had the opportunity to
3144010	3149130	figure out how to make that work. Again, I was working on this on Tuesday. Made this work on
3149130	3153630	Tuesday and into Wednesday morning. So haven't had the opportunity to start reversing that.
3154030	3158870	But fun stuff. Didn't take a heck of a lot to make that happen. Of course, now all the guys
3158870	3169090	at CTF are turning around going, huh. No. All right. We'll let that stop. Hey, guess what?
3169810	3176970	No demo unicorns. All right. And now I get to admit something kind of embarrassing.
3179170	3183210	Well, that's all I've got for you guys in some pretty good time.
3183210	3191650	But so the demo unicorns were tempted and they didn't show up. So he-man on a flying unicorn,
3191650	3199010	your argument is invalid. However, I take issue. This is not a unicorn. A unicorn has a horn and
3199010	3208640	no wings. A pegasus has wings and no horn. So what is a flying unicorn called? An alicorn.
3209160	3215620	Why do I know this? My 6-year-old daughter is obsessed with My Little Pony. I'm like a closet
3215620	3220660	brony and I don't know it. That's all that we watch in our house is My Little Pony. Please,
3220660	3227100	God, save me. To the point that I knew that this was an alicorn. And I actually went and made sure
3227100	3231900	I looked it up. So, yeah, it is not a unicorn. It could be. It's not a unicorn. It's either an
3231900	3243280	alicorn or, according to some sci-fi authors, it is also a pegacorn or a unipeg. So, yes. And my
3243280	3251540	boss so kindly filled me in when, even better, that this is neither an alicorn, a unipeg, a
3251540	3263020	pegasus, a unicorn, or a pegacorn. This is, in fact, Strider from He-Man. All right. So thank you guys
3263020	3268440	very much for getting up nice and early on Saturday. Hopefully I didn't bore you too much.
3268440	3272760	And, you know, go forth and conquer. Some really neat stuff. Really inexpensive to start getting
3272760	3277660	involved with. And has some pretty interesting application. You guys can build a keyboard
3277660	3284220	sniffer for Microsoft Logitech 2.4 gigahertz keyboards and take this back to your organization,
3284220	3290220	do some auditing and say, get rid of these damn things. Unless you really want to have some fun.
3290840	3294660	These radios will transmit. So now take what you've learned about the receive
3294660	3300640	and start crafting packets and injecting keystrokes. Exercise left to the reader.
3302040	3305420	Some of these slides, text is a little bit hard to read. If you want to go back and look at this,
3305420	3310760	I know they're recording it. So it will likely be at irongeek.com later and various places.
3312940	3319080	The slides, as soon as I get home, and by home, I mean probably late next week,
3319080	3323480	because I go directly from DEF CON to a client site. I hope they like the hair.
3325080	3329580	So I'm literally leaving from DEF CON to go to a client site after I go home. I'm going home for
3329580	3334600	about six hours, pack a suitcase and leaving again. So I will put the PDFs up on my website
3334600	3341820	at hacksterthematrix.com. It's my blog. There's a total of five entries. You'll be able to find it.
3341820	3345480	So I won't give you a specific link to a specific entry. You'll be able to find it.
3345700	3349760	And there's all sorts of other fun stuff up there as well. Great. So thank you for spending some
3349760	3353860	time with me this morning. I'm going to stick around for a while if you guys have got questions,
3353860	3358220	cool fun things. I actually want to see if I can capture some stuff with some software
3358220	3364220	defined radio as part of the CTF and get some practice. So good time to do that. Thanks
3364220	3369360	for coming. And thank you. Enjoy the rest of your DEF CON. And we'll see you all for
3369360	3370760	ham radio exams tomorrow, right?
