In a world... He sold tortillas on the corner. And the mob wanted in. These are my tortillas. Are we going? So you caught my little tortilla boy invitation? It's not very good. Alright! Welcome! I'm gonna use my search warrant voice. All of you put your hands behind your head. Excellent. Seriously, come on in, sit down, have fun. We're all here for the fun. My name is Zero Chaos. I am here with the Wireless Village. And it's my fault that this is all delayed. So, if you are just walking in, that's great. You're catching the first important talk. Only some losers spoke earlier. So, welcome. This is Intro to SDR. This is Russ. Russ is the newest member of our inner circle. And he has penetrated not only our networks, but our hearts. All the thanks. Wow, that was fricking risky business letting you do that. Thank you, Zero. So, I'm humbled. Thank you, everyone, for coming. My name is Russ. I'm going to teach you about a handful of things regarding software-defined radios. More importantly, for two reasons. One, so that y'all can play with all the stuff that we set up over here. Secondarily, I really want to see more ham radio operators. So, I'm going to show you the fun world of various bits of radio communications that are out there. And what you need to do in order to start testing the waters legally and cleanly. So, the title of the talk was originally, so you want to get into SDR. I was on the Blade RF channel not so long ago. And they actually suggested I change it to being 64 shades of qualm. As opposed to, like, 50 shades of gray. But nonetheless, I have Hoopy Cat to thank for that one. Real quickly, I'm going to cover some SDR 101 stuff. So that everyone understands what the heck I'm talking about. Some of the cool things that you can do with them as far as having distributed radios, portable packs. Some of the issues and concerns in regards to all that sort of stuff. Let's say you want to start setting these things up at your house. What do you need to do? Things to be cautious of in order to keep from burning equipment. Some nice things to be able to do that you can do with these various devices. And some various random things, more importantly, that I've come across that will be kind of hintish for the challenge. But also some of the other things that you may be interested in. And poking it around. So, software-defined radios, unfortunately, as far as getting into the hobby or working into it, is much like this picture describes. How to draw an owl. Well, draw two circles and then draw the rest of the fucking owl. There's a lot of people who are out there who say, Okay, I bought this dongle, I pop it in, and then woohoo, I'm sniffing the airwaves. Well, okay, maybe. So, how do you get from seeing that hearing static to a signal to actually seeing actual real data or anything along those lines? There's a missing step between this. So, I hope to be able to provide some information as to the missing steps so that you too can draw your very own owl. The thing to keep in mind with software-defined radios is that they are software-defined. It's just a radio at the front end. It is taking signaling directly off of the ICs to the back end and allowing the host computer in order to demodulate it as you go. Once again, the theme of The Village is kind of matrix-y some stuff in that. Well, if you remember when Neo learned Kung Fu, he was dynamically uploaded on the fly, he learned a new thing. Same thing with software-defined radios. You have to tell them how to interpret the signaling that's coming in. Fortunately, there's a lot of tools already built to do that, so you can then reverse-engineer those tools, read the documentation on them. But then you can start going a little bit nuts with GNU Radio and start exploring some of the fewer documented protocols that are out there, like some of the SCADA system water gates, flood gates, other forms of broadcasted communications, things along those lines. So the hardware to get into this, the whole reason why you're all here is what hardware is out there to do it, probably. It used to be the realm of academics. It used to be ungodly expensive, $40,000 and up. Then a couple years ago, Atis Research came out with the USRP, dropped it to being about a $2,000 price, and it's been cycling downhill from there. You have the cheapy little RTL-SDRs, which are actually meant to demodulate DVB-T radio transmissions, which is a form of high-def TV in Europe and China and such. But it's software that's doing that for you. It's just receiving the signal, and then the software is taking care of the rest. So with some hackery, with some software drivers, you're able to actually get them to be the cheapest, stupidest receivers that you can get. Dude, it's totally because I got trousered last night. Then you also have the HackRF and the BladeRF, which are the next series of really amazing tools, mostly because of price. So you can start dealing with various more frequencies, but they do fundamentally very different things. So be cautious and cognizant of what their capabilities are. One is half-duplex, one allows full-duplex. One is 30 MHz to 6 GHz, the other one's 300 MHz to just around 5 or 4 GHz, something along those lines. Three hours of sleep, I don't care anymore. But know which tool you're going to pick for the job that you're going to research. The radio signal that you're going to want to look into. Your antennas are your physical layer into this realm. If you don't have the right antenna or don't understand basic radio theory of antenna design, you're going to have bad times. If you end up trying to transmit with an improperly attenuated antenna, you're going to get a sad panda face on your reflected mirror screen from your monitor after you figure out, fuck, I just burned this thing up. So there's a great book called Antenna Theory. So I suggest going out, picking it up, just flip through it. You'll be able to understand, you know, resonance and all that sort of stuff to tune to the right frequency. Actually, it's even just better to understand so that you actually can... If your antenna is way too big, you're going to pick up more noise for the signal that you're not intentionally trying to receive. So by having the right height, or length rather, of your antenna, you're going to be able to better filter out what it is you're going to be looking for. You also have filters, now that I mentioned it, that can bandpass filters that help you whittle out even more noise and all that, but I'll get to that in a moment. I'm getting ahead of myself. So compared to things like Kismet and anything else along those lines, Kismet gives you raw packets. Software-defined radio capturing tools give you just raw data. Sometimes they store that data in a proprietary format, otherwise they don't. And what they give you is representations of IQ data. Imaginary and quotient components of a signal. I'm not going to get into the fancy math, just recognize the terms. There's a lot of fun math behind it, and it also explains the DC spike and all that stuff. But what they're actively doing is comparing the signals in order to come up with a representation of something that you'll be able to use in order to apply software to, then to convert it to audio, take a look at the audio stream, or be able to demodulate it into a bit stream. And I'll have some examples of that in a moment. Like I said, it used to be really difficult to get into this. Commercially, you're paying a lot of money. Academically, you're paying a lot of money. The software and the papers that were out there in regards to it, having been an academic, I call it gradware, meaning the software only works for graduate students for the exact experiment that they're working on right then and there. If you try to download it, it comes with no documentation. If you try to run it, good frickin' luck. If you need help with it, good frickin' luck. But fortunately, thanks to folks like Dominic, Mike Osman, and the rest of the folks in the community, I don't see anyone else here right off the bat that I'm thanking for helping me with these various things. But anyways, yeah! Round of applause. So Mike Osman threw out the HackRF as a very easy-to-use tool, and now more and more people are getting into it, such as yourselves. So because they are software-defined and not limited to just one function, your ability to observe and examine radio communications is limited to your own skill sets and who you work with, or what your knowledge base is. Travis Goodspeed, who is not here just yet, has used software-defined radios for his SASA, where he's tracking low-Earth-orbiting satellites and then capturing their radio communications in order to figure out what it is they're saying and what it is they're doing. I highly recommend you corner this neighborly individual in order to have him explain to you what SASA is and how it works. That's an application of these cheap devices being able to allow individuals to do more thorough research on all these other protocols that may or may not have really awful problems. So for your own edification, the majority of the main points that you need to pay attention to is what your sampling bit rate is. Let me slow down. Red, leather, yellow... Wow, I can't even do that. Anyways, drink. You need to be able to understand how much bandwidth you're actually recording at a time. You never record at the center of the frequency that you want to record at. You always record off-center of it because of the DC spike. I'll show you what that looks like in a minute. But like I said, pay attention to the tool that you're using for the radio frequency that you're going to examine. The tools that are out there for folks who want to just get into this and also start messing with the SDR challenges here. If you got PIN2, you've solved like 99% of your problems and Nubuntu ain't one. The program GQRX is a magnificent program to be able to just see what's out there from a radio communication standpoint. You get a line chart of peaks and valleys of signal strengths and then you get a waterfall display so you can see how it communicates over time. In addition to that, you'll be able to more clearly identify what your center frequency is. Now keep in mind, these cheap little devices, they have drift as to what they report their receiving signal is. Because as they warm up or as they cool down, the clocks in them cause what they're representing to shift. So a couple times during the day, either unplug it, let it cool down, or I'll show you some other things you can do. But you need to find a reference frequency. Yes sir? Cheap ones. Cheap ones. The other devices can drift, do drift. The HackRF... Yeah, the HackRF is flawless. I haven't seen the HackRF drift. I haven't seen my BladeRF drift. The RTLs drift. The best way to find out what your center frequency drift is, is to go to the National Weather Service transmissions. And then you'll see, if you select it and hit center, you'll be off by a couple kilohertz. So you'll be... Yes, you can do that as well. Absolutely. But, so all these things are your initial tools in order to see kind of what's out there, see the light, how bright the light is. And then you take that and run it through other programs like your new radio or other pre-compiled applications in order to demodulate more cleanly and directly. If you have Windows, SDR-Sharp works pretty well. There's been drama surrounding that. Not going to get into that at the moment. But it's still out there. It's available probably every two weeks or so. I see another plug-in written for it and it's for added capabilities and all that sort of stuff. The biggest thing that you need to understand with software-defined radio. Alright, you see a signal. What the heck is that signal? Well, there's a great wiki that is the signal identification guide. What they have for their information is what frequency it is, has someone identified it before, a description of what they've identified it as. A picture of the waterfall display of it, like a really clean, crisp waterfall of it so you can see what it looks like as it's transmitting. And most importantly, an audio sample of it so you can hear it. So your software-defined radio being your brain is the best thing that you can use to identify other radio communications. An example was when we were at B-Sides Vegas earlier this week giving a two-day class on this stuff. Justin and I were observing a POCSAG communication, but it was nowhere near any pager frequency. But what we were able to then identify as being is like those restaurant hockey pucks that light up and vibrate whenever someone's table is ready. So just by being able to listen to it, identify it, and then doing some other querying out of radio reference and some FCC lookup stuff, it was very plainly and easily identified as that being the device without even having to demodulate it. So the other things that you can use in order to analyze your captured signals is a fantastic tool called Bodline. Bodline has some quirks. It doesn't like large files. And there is, according to Dragorn, a push to have an open-source version, a complete and total open-source version of Bodline, in order to address some of these quirks and also to get them rolled into Pentoo and other open-source distros. But really the big thing that you need to be able to do with Bodline, and you can either use DD or Split, but you need to break up your IQ capture files into 50 meg chunks. Now, as you can imagine, what if you chop the file where the transmission is like right at that middle point, so in that 49 to 51 meg barrier, you chop the file right there and you cut your signal in half? Well, use DD in order to trim and skew, in order to whittle down on that IQ file to actually get a good handle as to what it is you're seeing. So, the... Wow, I am that jerk. Voicemail. The way that you run Bodline, download it, extract it, execute it. It's pre-compiled. You're good to go. So, when you open up Bodline, this is kind of what it starts with. It's got some fun little quirks because of the UI. You right-click for your menus. You'll be able to navigate to your capture.bin or capture.iq file from whatever it is you're using to record the raw IQ samples from. You need to select that it is a raw file format. Then the few other things that you need to remember to do is to, whatever your sample rate for your capture was, remember to put in the sample rate as well so your cadence for the demodulation is going to be able to display cleanly. You're going to select two channels because you have both I and Q in these files. Quadrature and 8-bit unsigned data. And once you do that, this is an example of a recording of a key fob for a car. Specifically, drag horns. So you'll see it displays these bursts. And since we, for this example from the class, recorded offset from the center frequency, you'll see these little groupings of data bursts. Well, you can enhance, like in CSI. And what you very plainly see is stuff like this. What do you think this on-off-on-off-on-off-on-off at the top is? Preamble. Very good. And then right after that, you have a series of on's and off's. So what do they mean? What is their significance? Well, that's up to you to determine. How do you go from this in order to put it into an actual reverse bit stream or byte stream? Well, that's when time and experience is going to come into play. I'll show you a few more examples of this, but when I was working on demodulating something with Mike Ostman, I shot him a screen cap of one of my baud line captures, and he immediately responded back with what the bit stream was. And I was like, dude, how the hell did you do that? How did you demodulate too quickly? What new radio widget do you have kicking out? I just looked at it. Okay, clearly I'm not there yet. But if you get in a whole lot, you can zoom in very, very plainly into seeing this one capture. And you also then need to identify whether it's OOK, AFSK, or any other form of modulation. So like OOK on off is like this. It's like Morse code. AFSK, you'll see, I'm not sure if I have an example on the screenshot, but it alternates between two frequencies. Now the other thing to keep in mind when looking at this stuff, when you see something is on and something is off, we typically think of that as a binary representation of a 1 or a 0. That may or may not be true. Because there's really neat things out there like other modulation schemas like Manchester encoding, where you actually have symbols, and depending on how those symbols match up, they pair up to actually being a representation of a 1 or a 0. That really screwed with me for a while when I started getting into this. So in this case, I gave you an example of OOK data. Transmitter's on, it's off. And the things that you can do that can go wrong. I'm just going to ramble at this point. So for those who are going to do the contest, or anyone who's going to bot those little RTLs, you may notice once you put two RTLs side by side, what it is you're receiving looks like shit. Or is very different from the other person. This is why. Sometimes when you pop off the bottom tin plate, maybe it's connected, maybe it's not, maybe the ground plane is connected to the element feed, who the F knows. So really, some of the best stuff that you can do in order to ensure that you get a good clean signal is to go out on Amazon and buy little pigtails. So you can actually connect real antennas with SMA or PL239 or whatever connector head is necessary for what it is you're looking into. I can't stress that enough. It starts with the physical layer, your actual hardware of the wire. So if you have that, bad times. Now, Lightning definitely wants to be your friend. Do not be Lightning's friend. If you're going to set up a ground station, a base station at your house, make sure, please, please, please, please, please, make sure that you do Lightning suppression and grounding properly. Have a licensed electrician, if you're not familiar with it, have a licensed electrician come out and help you with it. Or find another ham radio operator in your area. They'll be more than happy to come out, I'm sure. This is an example of an Ethernet plug from an Ethernet based radio that I manage. The radio survived. A six foot section of that Ethernet cable baked and fried. But the Lightning suppression system worked. The radio survived. It's working now. Everything else south of the Lightning arrestor worked. The grounding straps and everything else worked. Make sure you get that right. Because otherwise, I've blown radios. I've had almost fires. Dragorn, just recently at his house, Lightning hit one tree, jumped out of the tree, hit another tree, said, fuck you tree, you're too small, and then jumped to a third tree, and then went down to earth ground. It will do whatever it wants. It's the honey badger of nature. Lightning doesn't give a fuck. So, the other thing to keep in mind is just general static. Taking these cheaper ones, and you'll notice that the connector heads of them are kind of barreled and very loose. I've seen some where if you just twist it a little bit, it causes the receiver in it to freak out and reboot the actual device. So, whatever it is you're monitoring stops, you'll take a look at DMessage, and you'll see that it disconnected and reconnected. So, be wary. You get what you pay for. A lot like training. But the thing, if you're going to set up a base station at your house, you're probably going to have the antenna outside. Be very, very careful of wind and static built up on your elements with wind. Like I said, any time something rubs against something else, you're going to generate some level of static. These devices sometimes don't have static protection built into them. It's a crap shoot. I've bought the exact same device out of the exact same batch queue. Some have ESD protection, some don't. You don't know until you open it up. And you can fry your radio receiver and these things with a little tiny shock. And I have done that. So, the other things, if you're going to set up a base station, are stuff to... these two documents to read. The mitigation of radio noise from external sources at radio receiving sites and the Enable RFI Handbook. You don't have to be a crazy person like me and build a skiff in your basement that has a Faraday cage and all that stuff. But eliminating common radio signal sources, like noise sources, in your environment helps a ton. It really, really helps clean up some of the signals that you're going to be receiving. So, some of the best examples inside these guides are the computer power supplies. Not in accordance with barrier feed and ground principles like BFG. So, what that means is that this electrical outlet, this plug right here, is plastic. It's not grounded to the actual power supply itself. So, any signal source coming in is now going inside the computer and can possibly cause a source of interference. Also from this same guide is another great example where someone thought it was a brilliant idea to take a copper braid... to a copper braid and use brass and just paint over it. So, what ended up happening is the connector had expanded and contracted over time due to the elements. It created a fracture in the cap. The issue with this device was it was a grounding point for a cellular communication tower. It brought the cellular communication tower down to its knees. Just that, from improper grounding. So, if you're going to go this level of insanity, make sure you just read those guides and cover your basics. The clocks, as I mentioned earlier, they tend to drift as they warm up and cool down. So, some of the things that you can do in order to manage that drift is cooling your RTLs, or keeping them cool for longer periods of time, or cycling them around for their usage. The stupidest thing that I've seen someone do is take a fan and put it on top of their RTL. Because a fan is just a noise generator for RF. And you're putting a bright flashlight next to your eyeball as you're receiving these radio communications. It's just saturating out everything else. So, I'm getting ahead of myself. But, in regards to managing your clocks, if you want to capture more bandwidth simultaneously, there's some hacks that you can do where you can take the crystal off and stitch them together using a common real-time source. This is a website where I was reading about multi-channel receivers. I think they can output up to 8, so that means you can theoretically stitch up to 8 RTLs at the same time and start capturing more bandwidth at the same time of a particular signal. But, once again, you're going to be soldering these signal feeds back onto the board. If you have a bad solder joint, it's going to be sad panda. Now, as I was mentioning earlier, the clock will drift as it warms up. So, you need to check reference radio frequencies all the time, depending on where you are. Hey, I'm in the U.S., so I use the National Weather Service. So, in regards to the cooling, a really clever thing that I've seen is, you know, you just put it in a tin can with vegetable oil or mineral oil without vitamin K. E, sorry, vitamin E. Thank you. Wow, drink. Vitamin E will lead to corrosion. Mineral oil, if you have pets, is great because if the can tips over and spills out, the pets will clean it up. Then you take your pet and put them outside and the mess will take care of itself in a few hours. Easiest set of napkins ever. But, keeping it cool is absolutely important, but if you also put it inside of a tin can, you've also started to isolate additional noise sources. Fantastic. Now, some of the dev random stuff. And when I started getting into this, I started recording various radio communications. In particular, my alarm system at my house. Now, I grabbed a copy of the waveform and I sent it off to Mike Osman, and he responded with this quote immediately. The best way to nerd snipe me is to send me a waveform. So that is your secret key to get his help. So this is what, when you start going into this stuff, this is what your desktop is going to end up looking like. You're going to be running multiple sessions of GQRX side by side. You're going to have GIMP or some sort of screenshot utility open, because you'll want to be able to translate those bitstream patterns into something usable. Like Jared was using Audacity as well as the open source version of Excel in order to mark above the boxes which symbol pairs were ones or zeros. With these, I just printed them out, put graph paper on them, and then just did it by hand for the very first time. So over time, what you'll end up seeing... Oh, I do have an example of Manchester encoding. As well as AFSK. So these are like sensors from my alarm system in my house that like to burp activity every once in a while. At the top you get the preamble and then data. What do they mean? Beats the hell out of me as of yet. I'm still working on it, and I have some up here if anyone wants to mess with them with me. But similarly, all the way on the right is AFSK example along with Manchester encoding. So you'll end up seeing the preamble on this is very clearly on-off-on-off-on-off. Well, this almost looks like it starts with off and then goes to on-off-on-off, or maybe it's the other way around. Well, actually it's read up on Manchester encoding. It'll explain it because of the interest of time that I'm in. Now I also mentioned being able to drop this stuff into Audacity in order to get waveforms out. You could also drop them into GNU Radio and you'll be able to generate scope plots. So this is an example of a scope plot of my alarm system. It wakes up, it farts out this like bass band noise as it's waking up, and then it goes on-off-on-off-on-off-on-off. And then you'll then be able to figure out exactly what bits are meaningful and all that sort of stuff. Now the other thing to... wow, that was really annoying. The other thing to keep in mind is when you're doing this stuff, jamming is illegal. You've got to watch yourself because you might do it by accident. And for the challenge, I'm using Raspberry Pis as FM transmitters. And if you don't tell them to stop being FM transmitters, they turn into FM jammers. So this is an example of my proof of that for a very short period of time, where I overpowered for a period of time a commercial FM radio station at my house. I stopped the transmission, but the center spike on this was still so strong that it bled over and just saturated the actual bandwidth of that legitimate radio station. That was a mistake. I recorded it so that you can see what you can do wrong. Don't do this, or at least if you're doing this, be very careful to make sure that you stop doing this. So that was a lesson learned. The other cool things that you can do with RTLs and other software-defined radio stuff is radio astronomy. So if you do this stuff, if you're monitoring at night, you might start seeing these neat little streaks like this. It almost looks like a Doppler shift. Well, that's actually a meteor shooting across the atmosphere. As it interacts with the atmosphere, it also interacts with the ionosphere and it generates radio signals. Ham radio operators are known to use those as well in order to reflect radio communications around the world at various places. You'll start seeing all this stuff, especially in the signal identification guide. And there's just like this really awesome world of things that communicate that are out there. So the rest of the sources of information, the places that I go to, rtl-sdr.com on a daily basis. Radio reference is a bookmark in order to take a look at what is immediately there. Dangerous Prototypes occasionally has SDR stuff, but when they do, it's really amazing and poignant. My shameless plug, I'm throwing together a website to kind of be like, hey, not just RTL stuff, but HackRF, BladeRF, USRP. If you want to get into this, here's all the knowledge as opposed to going to these one individual one-off sites. And last but not least, Dragorn, Kismet Wireless. He's put together a handful of how-tos. I'm scraping his how-tos. Some of the ones that I've done to just toss them into SDR Ninja for the purpose of one-on-one processes as to how to learn how to do these things. So I think I almost got us caught back up to time. Any questions? Did I embarrass myself? No? Yes, sir, in the back. Oh, yes, yes. Absolutely. I did forget to throw in, I'm also on that subreddit. I'm a lurker, not a poster. But on reddit.com slash r slash RTL SDR, there is a very active community there. It's almost like it's a Reddit version of IRC. Well, so what Reddit is really great for in this case is being able to submit like, what is this signal? And someone helping you out. Whereas if you try to do that in an IRC chat room for like HackerRef or BladerRef or Pentoo or anything else, that's not exactly the right form for that sort of question. So yeah, highly, highly recommend that as well. Thank you, sir. All righty. Well, in the interest of time and getting things moving, thanks again. Hope you got something out of this other than seeing this cat like that. And have fun. We got the challenge running now. Feel free to ask any questions. Thank you very kindly. Oh, yeah, I did forget one other thing. The portable pack stuff. So sometimes your signal sources are going to be a problem. A great way to isolate it is to put your SDR on a battery pack. So it's not going to generate any noise source. So that's essentially what this is, and it's rebroadcasting it over Wi-Fi in a radio frequency range that this RTL just doesn't work with. And if anyone has an SDR with them that they want to play with, this little set of key finder stuff, Dragor and I were able to do a replay attack on. So if you want to see an actual demonstration of a replay attack, come tomorrow. We'll teach you and show you how to do it, because we can make these things sing without pressing the button whatsoever. That was a demonstration that we gave in the class as well. Sorry, ADHD. Go forth and conquer. I'm done. I'm tired.