I'm Ryan. I'm going to be talking to you about a little project I did. I released it a couple months ago. It's a CTF based on BLE. I'll kind of tell you a little bit in depth about why I did it and kind of some of the components of it and the makeup. So it's my Twitter handle at hacknar if you want to send me anything. So the de facto who am I slide before I get started. I work at Atlassian. I run the security intelligence team which is our DFIR team globally and our red team. I'm an advisor for an endpoint security company named Zipton. It was kind of like a past life of mine when I worked there but I'm happy at Atlassian now. I do a lot of Bluetooth stuff in my spare time. I'm an old man skateboarder. I like to skateboard a lot. There's a picture of me trying to teach my kid to drop in on a quarter pipe. Anyone else here like to skateboard? If you do, there's a really cool skate park about 15 minutes from here that I went to the other day. It's called like Arroyo Grand Skate Park. It's like a really unique park that's all like pump tracks. It killed my legs in about 20 minutes but it was a lot of fun. And then I'm a regular member of AHA as well which is an Austin thing. A bunch of security nerds that get together once a month. Okay. So on with this. The important stuff. What is this thing? So the BLE CTF is a Bluetooth low energy CTF. It's built on an ESP32 chipset. So I did nothing with the hardware, right? I just wrote all the firmware for this thing that kind of hosts the whole entire CTF. So there's my little disclaimer there that this chipset is not my creation design or manufacturer or anything like that. I just flashed the CTF to the firmware. You can even flash it on the DC darknet badge as well. You can even flash it on the DC darknet badge as well. It's pretty cool. I was glad to get my hands on one of those. It's all written in C. I actually got the ESP32 because I heard you could do it in Micro Python. You could run Micro Python on it. And I was like, oh, that would be super quick. I can do this like in five minutes. But you can't do a Micro Python stack and keep the Bluetooth stack at the same time. So I just wrote it all in C. The GAT server itself, basically the firmware creates a GAT server which hosts the CTF. And there's about 20 flags in total. And they're all meant to kind of step you through editorively like from beginning to more advanced steps in Bluetooth low energy. So why did I create this thing? Right? I think like throughout the years I've done a lot of Bluetooth talks and just a lot of Bluetooth research. And there wasn't like a de facto standard way to educate people on Bluetooth low energy. Even in Bluetooth classic it's the same problem. So I created this CTF. And it's really kind of like an entry level learning platform in order to get you ramped up to the skill set. And it's really kind of like an entry level learning platform in order to get you ramped up to the skill set that you can start tinkering and hacking on Bluetooth low energy GAT servers. Low cost of entry. Right? You can get these chips from China for about $5. So I didn't want to make anything that was super expensive. You need no prior Bluetooth experience if you want to get started with this. Don't think that, you know, like I've had my colleague Christian who's in the audience, he had no Bluetooth experience before. I used him as a guinea pig on the CTF to make sure that people could actually go through this thing from start to finish without knowing Bluetooth. And I wanted to get more people involved. I do a lot of Bluetooth talks and a lot of times I just see people's eyes glaze over and they have no idea what I'm talking about. So I just wanted more people involved in this. And I've never written a GAT server before. So it was a challenge to myself. So what do you need to get started? As I mentioned, you'll need an ESP32 of any form, shape, whatever manufacturer. You can buy them on eBay for $5. You can buy them on Prime if you're impatient and get it the next day for $10. Or if you don't want to flash it at all, I sell overpriced ones for either $20 or a beer. And they're just pre-flashed with the CTF. And if you are getting one that's not pre-flashed, you'll need the source code which is in my repo that I'll share later. Basically you just compile it up and then you flash it to the ESP32. And then I would recommend that you have a Linux box in order to do the CTF. A lot of people have contacted me and they're like, oh, I just did it on my phone with NRF connect. You can. But I think you're better off with a GAT server. So I would recommend that you have a Linux box in order to do the CTF. So from the software side, like I mentioned, if you're using standard Linux box, you can really do the entire CTF with HCI util and GAT tool. There's other tools that help. Evil socket, Simone evil socket's tool, blah, if I'm pronouncing it wrong, let me know. It's really useful for visualizing a GAT server and seeing everything that's running on it. So really great tool for it. You don't need it. You can't actually do the whole CTF and blah. But it's really nice in order to just kind of visualize what's going on. And then I provide a vagrant script in the source repository as well that will just spin up a new bot2 box with all the tools that you need on it if you're not running a Linux box and you're doing it on something like OSX. Cool. What will you learn? If you do the CTF from start to finish, it teaches you all the basics of Bluetooth low energy like in interacting with a GAT server. So you'll learn how to do reads in many ways. You'll learn how to do writes in many ways. Notifications and notification tricks. Indication, internet. You'll learn how to do a lot of things. You'll learn how to do a lot of communication tricks. You'll learn to tinker with a lot of the client settings on a Bluetooth dongle and like HCI util and things like that. And you'll learn a lot of the server structures that you will see in a GAT server. And there's a lot of other stuff in there. But these are kind of like the basics that you'll take away after you finish the CTF. Cool. So I embedded a video demo. See if it even works. All right. So here's me. Cool. It's going over there but not over there. So this is just showing getting started, right? Like doing a HCI util scan and finding the CTF. So basically after you plug in the ESP32 and it's live, you'll do a scan and you'll find the MAC address that you'll need in order to just kind of poke around with it. And the next one is flag 1. This is not like a spoiler. You can only get flag 1 by actually sorry the text is a little small here. So I'm just going to take a few slides to my Git repo afterwards. Let's see if I can make a good start. Screw this. I'll just do it this way. Cool. So here I have the Git repo up and oh, God, it's not working over there. Hang on. Demo error. So I'm just going to go ahead and do a quick test. Okay. So flag 1 is a gimme. You can only get it from reading the documentation and the whole purpose of it is to actually just make sure that you know how to properly do a get read and a get write. So here on your left side you'll see the repo. The repo hosts a hint for every single flag. None of the hints will actually give you a straight take away on how to actually get the flag. Except for flag 1 because flag 1 is just meant to be like kind of cut and paste. You swap out your MAC address and then you submit your flag value to the GAT server. So here in the bottom I'm just kind of going to read one character handle. There's one handle inside of the GAT server that will basically tell you your score out of 20. So you have a 0 out of 20 or you have a 1 out of 20, what not. Depends on how many flags you've submitted. And then you'll see here on the right side you'll see the number of the flags you've submitted. So the first thing we're going to do here is we're going to read that. We'll see that we have a 0 out of 20 score. Then after that we're going to take the value for flag 1 which is given to you in the documentation and we're going to do a GAT tool write of that value. And uh do do do do. You can do these GAT writes with either GAT tool or you can use uh Blaz really nice way to do it. Especially for a lot of the ASCII values because you can submit the ASCII straight and not have to convert the hex to ASCII. Um so it's a nice way to do it. And then after that we're just going to go ahead and we're going to read the flag handle again and we'll see that we have a score of 1 out of 20 instead of 0 out of 20. Uh and then just for kind of clarity as well. Um we'll go ahead and we'll read the GAT server with Blaz in order to show all the values which is a lot more nice way to actually visualize the whole thing. Um so it's going to be coming next. He's got cooler ASCII graphics than me too. So. But here you can see um we now have a you know 1 out of 20 because we submitted the first flag. Cool. As for extras. Um there's kind of like some extras here. Um as I mentioned you can do this whole CTF with just basics. Um using HCI util and GAT tool. Um but I had a lot of people say hey you know like I wanted something that was more complex and I needed an uber tooth or anything like that. Um I didn't make that as a requirement because you know as I mentioned before I wanted this to be very entry level and cheap. Um and so um but it is a great utility for learning to tinker with your uber tooth or uh nrf sniffer firmware. Um so as you kind of do the whole entire CTF you know the values that you're submitting from the client to the server. Um so sniffing the traffic with an uber tooth or an mi or nordic semi semiconductor sniffer firmware. Um you know what values you're looking for in the PCAP files so it makes for a really nice tool. And a lot of people have trouble when they first get into sniffing traffic with an uber tooth or nrf connect or nrf nordic firmware sniffer firm blah blah blah. Um so because um it's kind of fickle sometimes when you try to first sniff that you know that initial connection in order to follow all the packets and dump all your data into PCAP. Um so this is a really nice way to kind of learn how to hone your skills in in those tools as well. Um another little easter egg too is there's actually two LEDs on this version of the uh ESP32 development uh hardware that I'm using. Um and so anytime anyone like when you first fire it up only the red light's on and then anytime anyone ever does a uh a test run of the uh the uh the uh the um like a a gat read on any of your characteristics the blue light turns on. Um so it's a really fun way to just like walk around the conference and see if anyone's actually looking at your Bluetooth. Um I've actually had a couple of them like running the whole entire time uh through besides Defcon and Blackhat and I haven't had a blue light turn on once. Um so it kind of gives you a little idea of how many people are actually just actively you know scanning all Bluetooth devices out there. Um and as I mentioned I released this a few months ago and I've gotten a lot of feedback a lot of people just saying that it's a great tool to learn Bluetooth from the ground up. Um I was actually impressed with all the feedback I've gotten. Um so if you have done the CTF and you've given me feedback thank you very much I appreciate it. Um but my favorite feedback is this one. Um there's an intern who I think lives in Minnesota that's his GitHub repo there. Um he wrote a he forked the whole project to a fantasy RPG Bluetooth low energy um CTF. So basically as you complete flags you kill like goblins and trolls and you know get cool swords and stuff. Um so I was like dude you're so amazing. That's a a really cool project. Um so I don't know him but if you want to check out his stuff it's there. I think his repo name is just BTLECTF under bar fun. Cool. Future work. So I really love feedback. I love critical feedback as well and I realize that a lot of people want um more advanced versions of the CTF. Um so here's some of the future work that I'm working on and some of the timelines that I kind of gave myself. Um so some of the stuff that I want to do for this version is to randomize all the flag values so every time that you do a make and make flash you have randomized values in the the actual uh GAT server. Um and then I submitted this to a couple CTFs for upcoming conferences and if I get accepted then I want to write a CTFD harness for it. So uh the ESP32s are actually dual band you can do wifi and Bluetooth on it. Um so it'd actually be really easy to just kind of run through it and see what's going on. Um and then you can kind of hook up a networking harness to CTFD so you can actually keep scores and have like 20 of these things spread out and then everyone can actually do uh their own CTF and then you can see the scores and and and the competition. So um so those are the two things for version one I'm going to be adding. And then in late September I've uh started work on V2. I hope to have it done by late September. Um and this one's just evil. I took like every single like evil GAT trick that I've learned and could think of and I've kind of started iterating it into um pox right now and I'm gonna just plug it all together and then have something uh in late September. Um a lot of people it's probably gonna make you bang your head on the table and pull out all your hair and you'll think that it's broken. Um but there's a lot of evil GAT stuff you can do that you just don't see in in any device. Um but once you start using the APIs and coding it all in C and getting low level with it there's a lot of really nasty stuff you can do. Um and then in in uh late January probably around shmoo time um I'm trying to get a V3 out of V2 ESP32s. Um so that would actually have a requirement that you would need some type of sniffer hardware. Um whether it be an uber tooth or uh the nordic semiconductor sniffer firmware. So. So those are my rough deadlines and I hope to get them done by then. Couple of shoutouts. Thanks to everyone that's actually done it. Um I I really appreciate the feedback. Um my friend Alec who I was drinking beers with at shmoo con and kind of came up with this idea for the CTF. Uh Christian for making BTLE uh CTF stickers for me. Um I'm really happy to be able to share this with you guys. Um and then my friend Nick for helping me because it's something I probably would have never done. Um and he was a good guinea pig. And then all uh my aha aha people for listening to all my Bluetooth talks. And then uh here's the resources uh if you want to check out the project uh the repo's on the bottom uh or you can just ping me um read my blog I have a couple write ups on it as well. Um but yeah. That's it. Questions? I got a bag full of these things too if you want one just come talk to me. How did I get into attacking Bluetooth? I don't know. I started working on the Ubertooth firmware back when it was released. I did a DEF CON talk about it before Dominic did. So I have that one on him. He's not paying attention to me. Anywho. But that's how I got into it. I just started playing around with Ubertooth and then had a lot of fun with it and started just playing with Bluetooth. Yeah, the question is what is the tool chain I'm using? I'm using the flash to ESPs. It's just the, what is the manufacturer for them? Just the typical APK for it. The expressive software development kit. So that's it. For a couple of these you can actually use like, I've never done it, but apparently you can flash a lot of the ESPs with like Arduino and stuff like that. But I don't know if it will work or not. I just use the expressive SDK. Other questions? All right. That's it. Thank you for coming.