Good afternoon, everyone. It is now the top of the hour. It is 4 p.m. Thank you so much for being here at the Packet Hacking Village. I hope that you've enjoyed everything that, all of our talks, all of our events here. Now we have a fantastic, fantastic duo of speakers, our guest speakers. Okay. One of them, you know, one of the speakers, well, he presented this morning, Mike Rago, the Director of Security Research at MobileIron. And also, we are very, very honored to have, we are very, very honored to have Chet Hosmer. He's an instructor and also the founder of Whetstone Technologies. So without much ado. It is my absolute pleasure to give to you both Mike Rago and Chet Hosmer. You guys hear me okay? So we're going to be passing the mic back and forth a little bit towards the beginning. So bear with us. Title of this particular talk is, Remaining Covert in an Overt World. Stems from a lot of research Chet and I have been doing over the years. And hope you guys enjoy it. It includes some of the latest research that goes above and beyond our own data hiding book, which we'll be raffling off at the end. If you want to throw your name in the little basket up here, we'll pull one at the end and raffle that off. And without further ado, I'll let Chet go ahead and introduce himself. Then I'll do the same and then Chet will kind of kick things off. Thanks, Mike. Hi, everybody. We're going to kind of do an interesting talk today. We're going to kind of pass this back and forth. Just a little background on me. I'm the founder of Whetstone Technologies and now the founder of Python Forensics that I founded about a year ago. We're going to talk a little bit about Python today and how we're going to use it to mask our behavior on the net. Published several books on the subject of data hiding, as Mike mentioned, that we co-authored together. Mike was nice enough to offer me a spot on that book. And I think it came out really, really well. I published a book called Python Forensics about a year ago. And just a couple months ago, the Passive Python Network Macking book came out, all available from Singers. I also teach in the Cybersecurity Graduate Program at Utica College. And I teach in the Digital Forensic Graduate Program at Champlain College. So both great programs. If you're interested in any of those areas, I welcome you to join us. Thanks, Chet. So I don't usually like to talk too much about myself. But as Chet mentioned, we spent a lot of time doing a ton of organic research, kind of cutting-edge, leading-edge type research to incorporate into our data hiding book. We really didn't want to regurgitate stuff other people had done in steganography books and data hiding. Some of that we'll kind of enumerate today. For example, I'll revisit some of the Wi-Fi data hiding techniques that I did in the book. And then a little bit about Python. Both beyond that. And then extend that into smartwatch security and research, which has extended into hiding data on a smartwatch. So I'll cover that as well. And I do have another book coming out this fall around mobile security. So with that, I'll let Chet kind of take it from here. He's going to kind of cover what the agenda is. And then after that, he'll kind of get into a little background. We'll just set the backdrop for all the research that we're going to outline. Thanks, Mike. So this talk is about remaining covert. And obviously, we're all concerned about privacy. And I'm going to talk really briefly and quickly and give you an overview of covert communications. Some covert communications that was done in the past with art. And talk about why that was done. Talk about secret writing. Some micro dots, steganography, and jamming. And then I'm going to transition back to Mike. And then I'm going to come back and talk a little bit about the haystacking app that I built in Python. And then Mike's going to take off with the smartwatch stuff and the Wi-Fi protocol data hiding. So that's kind of just a quick agenda of what we're going to cover in this, you know, quick 45 minutes. So just a definition. I took this from the Orange Book. Covert communication is any communication channel that can be exploited by a process to transfer information in a manner that violates the system security policy. So basically, we all know what covert communication is. But it's kind of a formal definition defined by the DOD that we all kind of have lived by over the last 30 or 40 years. So I wanted to kind of give you an example of art. This is a drawing that was done back in World War II. And when our folks were deployed, they always wanted to get information back to their folks that were here. And based on that, they had to come up with a way to basically communicate that. So the U.S. Postal Inspection Service, actually set up a way to be able to stop this in order to not give away the position of troops, et cetera, as they were deployed. This is actually a piece of art that actually has data hidden in it. Anybody in the audience can quickly tell me where the data is hidden in this drawing? You got five seconds. Anybody? You didn't know you were going to have to participate, right? Okay. In the water? Is that what you said? Okay, good guess, no. Anybody else? On the bridge? On the bridge? Nope. So the – I'm going to walk out of the thing. The reeds on the bank of the river are actually Morse code. And this was a piece of art that was developed for the person that was in charge of protecting this information, Colonel Shaw. So you can actually read about this in the book. And this actually came from David Kahn's book, The Code Breakers, where he disclosed this information so you can actually detect the Morse code. So information can be hidden in anything. Not just the way we think about it today in audio files and videos, et cetera. So moving back even farther in history, this is where we actually think where the word steganography came from. This is a writing tablet of the day. So it kind of looks like an iPad or an Android tablet, right? But it's actually a wax tablet that they used to engrave the messages in the wax of the tablet. Well, Demartus, when he was exiled in Persia, actually used this tablet in order to engrave a message in the wood underneath the wax. And then sneak the tablet past the centuries. Because certainly if he got caught doing that, it would be probably a fate worse than death. So kind of moving forward a couple thousand years. In the modern day, we looked at micro dots. And micro dots were used in World War II. This is a modern-day micro dot. It's basically using synthetic information. And it's used in automotive and manufacturing. As a matter of fact, the MH370 that had crashed in the Indian Ocean has used this technology in order to encode it. To encode information on the parts of that particular aircraft. It's also encoded in parts that are associated with automotive design. So you can actually pull this information out with these micro dots. So it's no longer this big long number that they punch into it. They can actually place these micro dots. So another way to hide information. Just to blow that up a little bit for you. Obviously, moving to the modern day, we have steganography and the hiding of information in images, audio files, videos, data streams, all of that. We talk about that in the book. But this is evolving. Every time a new medium for communication is established, the hackers, like you guys, come up with new ways in order to hide information in those data streams. And it's getting more and more sophisticated. Not only is it getting more sophisticated, the amount of information we can hide within those media is increasing significantly. Now I'll move back in time a little bit to talk about jamming. One way to covertly communicate is to use some of the techniques that I mentioned already. But another way to be covert is to make sure that whoever is trying to listen to what you're doing is jammed. This is actually an ALQ-187 device that the Air Force uses. I had the privilege of working on this about 20 years ago. And this is a great device because you put this on the bottom of an aircraft and you fly it over the area that you're going to perform operations. And nobody can see anything. It basically blinds everything on the ground. And not only does it blind them, but it makes them so they can't communicate. There's good news and bad news. It works extremely well. The bad news is, in the meantime, between failures and failures, there's a lot going on. It takes about 20 minutes. Because the power and the amount of energy that is necessary in order to do this is enormous. So they have to get in and get out when they're using this kind of device. I'm going to come back in a couple of minutes and talk about some modern-day techniques of being covert. But I'm going to turn it over to Michael now and have him talk a little bit about smartwatch. Thanks, Chad. So I've been doing a lot of research around smartwatches and how secure or insecure they are in terms of your data living and breathing on those devices. And tomorrow I'll be doing a demo lab on a tool that I wrote in Python called SWATAC, a smartwatch attack tool. But due to the fact that Chad and I have been dorking around with steganography and data hiding techniques upwards for 20-plus years, especially in Chad's case, we're always looking for new and different ways to hide data. So as I've been poking around with my research and kind of pen testing smartwatches, I've also been poking around in the directories and other things on the device to see if there's new and different ways to hide data. So this kind of stems from some research resulting in a vulnerability that I found in one of the Samsung smartwatches. And let me start off by saying it was disclosed to Samsung, and they did a fantastic job of promptly patching it. But in terms of the research, one of the things about the newer Samsung smartwatches is that they actually run Tizen instead of Android Wear. And therefore, if you want to use something similar to the Android debug bridge, you can download the Tizen SDK and then use the, I believe it's smartwatch debug bridge, which is what SDV is, to actually access the device. So although you could use keys like you do with maybe the Samsung device, smartphone, tablet that you have today, you can use the same thing for pairing your smartwatch and copying data to and from the device. The vulnerability stemmed from the fact that the pin, although it protects the UI interface and the ability to transfer the data, if you connect to it over the smartwatch debug bridge, you can bypass the pin. And that was where the vulnerability lied. But like I said, that's been patched by Samsung, assuming that you've updated your smartwatch. Okay, so fast forward to hiding data. So if you go about using the smartwatch debug bridge, SDV, you can shell into the device. And there's no password required, by the way. And this gives you access to what you would believe to be just the media folder where you could copy and paste videos, pictures, forms of media, files, things like that. But you can navigate around the rest of the directories on the smartwatch. And this kind of enumerated some ways in which you could hide data, much in the way that you might do it on a Linux or legacy Unix platform. So I just took a very simplistic technique of just inserting some data in a log file that I was able to download from the smartwatch and then send it back up to the smartwatch, back into a subsequent same directory to make it look very innocuous. In fact, prepending a dot to the front of it to further hide it, if you were doing a forensic acquisition in native mode, it actually wouldn't suck this file down and you would completely overlook it. And then using the SDV push command, actually upload this to the smartwatch. So it gives you a lot of interesting manipulation capabilities. And as a result, I was able to upload it. You can see it here, but there are other system directories that I tried, and you can upload and hide data in those relevant directories, too. So I think there's a lot of possibilities. And I just wanted to share a little bit of that, because it was definitely fun poking around on that. So I'm going to pass it back over to Chet. He's going to go through an interesting technique called haystacking and some of his code through Python forensics. And then following that, if time permits, I'll get into beacon stuffing, which is related to injection and Wi-Fi packets. Thanks, Mike. So what's new? We talked about a lot of things going on. Obviously, the smartwatch stuff and the embedding in the watch is really interesting. Mike and I got a chance to talk about that today at lunch quite a bit. Quite interesting. But I wanted to come up with something a little bit different and talk a little bit about haystacking. And let me tell you where this came from. A number of years ago, when I was being interviewed about steganography and being used in 9-11, I made kind of a little bit of a gaffe. Not a Donald Trump-level gaffe, but a gaffe nonetheless. And the gaffe was, I referred to steganography and the difficulty of finding it is like finding a needle in a haystack. I immediately got a message from a couple of my colleagues, specifically Neil Johnson from George Mason University at the time. And he said, no, you're completely wrong. And I said, okay, Neil, I probably am, but why am I wrong? He said, because it's like trying to find a piece of straw in a haystack. The needle would be really easy in this particular case. So I wanted to talk a little bit about haystacking and how we can evolve it and use it in order to be able to be, um, private. So I came up with this really simple definition. Haystacking is the production of extraneous information, network traffic or communication, um, streams, in order to provide cover or obscure the real content of the message. Okay? That make sense to everybody? Thanks, I need two hands to do this. Anyway, um, I wanted to create a, uh, a simple, um, haystacking application. There's a lot of different things you could do. So one simple thing is you could create large numbers of staggoed images, audio files, movies that contain just simply random content. This is one of the things that we've always been concerned with. Um, if you look at an application like OpenPuff, um, it actually does some of this. It'll actually create fake staggoed images or fake staggoed audio files. So you gotta be able to now decipher which ones actually contain real content and which ones are just simply random data. So we want to be able to, uh, to do this. I wanted to do this a little bit differently, um, versus what you would traditionally think about doing this with an image or an audio file or a data stream. So what I wanted to do was use the new Raspberry Pi. And so what I wanted to be able to do was to, um, use the Raspberry Pi to, um, create extraneous network traffic when I was in a hotel room. Just to kind of play with the people at the Marriott because they're just kind of fun to play with. Anyway, so what I wanted to do was to generate randomly timed MAC address modifications. So I wanted to transition the Raspberry Pi's MAC address to represent a Raspberry Pi or a, um, an Apple computer or an HP computer or whatever I wanted it to be. And then I wanted to, um, identify, the identification of as many manufacturers as possible. And I would change that, um, MAC address on the device and then access a predefined set of websites mimicking human behavior. So somebody that was watching this network traffic would believe that actually these different devices were actually doing it. And I wanted to develop it in Python for obvious reasons. Um, so quick overview, um, randomly select from a predefined list of known, um, OUI MAC addresses. So we wanted it to be real. So we wanted this to actually come from the real standard list. Um, after each transition, I want to perform several randomly selected and randomly timed Google searches. And then change the interval of the searches and transition types to look again more like human behavior. So, um, this is the legal stuff. I will, um, Mike and I talked at lunch and the stuff that we've done, we'll post on the Python forensic website probably on Monday. So everything you're going to see here today, you'll be able to get, source code, et cetera, if you want it. Um, so don't have to try to copy down the code or take pictures of it. Um, it's here. So, um, just a few things you've got to import in Python in order to do this. Uh, some of the standard libraries that I'm using are SysOS, Logging, RandomTime, and JSON. That's it, very simple set. And then I'm using a couple of other libraries. A couple of third-party libraries. If anybody's used third-party libraries in Python, there's good news and bad news. There's thousands of them. And out of the thousands that you're looking for to do a particular thing, only a couple of them actually work. Um, so, um, some of the stuff that I have here actually works. So if you want to, uh, figure that out. So the first is I'm using a, um, a library called SpoofMac. It's a cross-platform library, so it'll run on Mac, Windows, and Linux. Um, so you can actually use it. And I'm only using, SpoofMac does a lot of different things. But again, with these third-party libraries, what you want to do is focus on the things you actually need, right? So I'm only going to use FindInterface and SetInterfaceMac. So I'm only going to do two things using that particular library. So then what I did was I created a list in Python. If you're not familiar with Python, Python is lists, dictionaries, and some of the built-in structures are just absolutely awesome. So I'm using a list to basically create a list of, um, Mac addresses. You can go into the code later and you could add hundreds or thousands of additional Mac addresses if you wanted to. I just wanted to create a small list that you could do. Second list that I wanted to create was the searches that I wanted to be able to do. Golf store stock quotes, MH-70 update, Donald Trump's latest gaffe, Hillary Clinton's emails. I wanted to be non-political. The Black Hat 2015, whatever. So those are the different strings I wanted to search for. One tip, if you're going to actually do this, I would suggest that you misspell some of the, uh, some of the Google searches to make it look more human. I thought of that after I put the brief together. So, um, just kind of the setup of the code is really simple. What I do is going to set up logging because I didn't want any user interface, right, to this. So I'm not having the user type anything or do anything or see anything, but I do throw everything to a log file. So I actually create a log file so that we can actually do it. Then what I do is I make sure that we're running as root here because you have to be, um, actually have root to do this. Actually, the first thing I'm doing is to make sure that I have an Ethernet port that I can use. Just so you know, the library will work with both wireless or wired networks. So again, I didn't need to get anything from the user. Um, so I set that up. Make sure that, uh, all of that is functioning and working so that we can do that. And now I'm going to actually loop through and perform the operations that I wanted to. So what I want to do first is to set the interface. So I've highlighted the important code in, uh, in yellow there or green, whatever that is. I'm color blind, by the way. I'm the only known steganographer that can't see color. Anyway, some color. Um, and, uh, so what I'm going to do is I'm going to do something really cool in Python, and I'm going to say, give me a MAC value, and I'm going to pick a random choice from the MAC list. So you don't have to write a lot of code in Python to do stuff, so it's just going to pull a random value out of the list and use that as the next MAC address. Then I'm going to go ahead and set the interface to that MAC address, and then I'm going to, um, do that. Actually, what I'm going to do first, if you notice that first line of code, it actually sets it to hardware address. So what I found with this video library is if you set the MAC address back to the original hardware, and then, wait a minute, wait a few seconds, and then set it to the new one, it works better. So just something I found in the debugging. So then I actually set the interface, and we're off. Finally, what I want to do now is actually go out and randomly Google a bunch of, um, addresses. And I'm actually doing that with the second library that I mentioned, um, that we're using. So, and again, all I'm going to do is pull a search value again from that set of search strings. I'm going to log that information, and then what I'm going to do is I'm going to go ahead and use the Ajax library in order to get a response. I don't care what the response is. I'm not going to do anything with it. I just want to actually create the network traffic to look like I actually did a Google request. Then I'm going to, um, go ahead and sleep for a random period of time. You can make that code more sophisticated. I just said two to nine seconds between searches, so it looks like it's not something that studies state. And, uh, and that's it. And then it's going to go back and do the next MAC address and do that. So now you can have this hotel room, and it'll just go out and bang away at these different MAC addresses, dozens of computers in your hotel room that are doing different things. So this is, um, just some of the MAC addresses. This is what you actually get displayed. And then this is just kind of an excerpt out of the log file so you can actually see that this actually worked. Um, what MAC addresses we set, the request that we made to Google, and then the response that we got. We had a couple of those that were there. So that will actually give you some cover in order to be able to, um, provide some privacy for you by being able to, um, obscure. There's no security in this, right? This is obscurity to basically add traffic so you can't identify a particular computer that was generating it because it would have an invalid MAC address. It'd have a valid MAC address but not the MAC address that was actually generating the traffic. Okay? Some of this thought process came from last year's DEF CON where, um, folks were looking at Bluetooth addresses that were on the highway that were calculating the distance and how long it was taking cars to go from one location to the other by trapping those MAC address... Bluetooth addresses of those devices. And people were concerned about the privacy of what else were they conducting. So, with that, I'm going to turn it back over to Mike and, uh, let him go into the, uh... Alright, I'm going to go a little cyborg here. Okay. So, um, continue to do research, uh, around covert wireless communications. This kind of stems from a lot of the research that we actually did in the book. And, uh, because this has extended into Windows 10, uh, I feel it'll be even more prominent. So, the foundation for this is, uh, Windows virtual Wi-Fi. Um, not to be confused with an ad hoc network, not to be confused with internet connection sharing. Uh, when Windows 7 was introduced, uh, provided the ability to create, um, virtual Wi-Fi. So, it lives and breathes just like a physical access point and has all the attributes and characteristics of a physical AP. And then, um, further into the content, I'll talk a little bit about, uh, injection into, uh, wireless frames so that you can communicate data over a covert channel. Which I refer to as beacon stuffing. Couple other things to keep in mind, um, you know, Wi-Fi is predominantly layer 2. Management frames, uh, typically include clear text. And, uh, does provide for a nice covert channel. So, just to kind of revisit virtual Wi-Fi, this actually came out in Windows 7. You can go to the Microsoft research site and download, um, the code, uh, and put it on your Windows XP machine. And it's in Windows 7, 8, and now 10 as well. So, in doing this, as I mentioned, you can create an actual virtual, um, access point. Well, why would you want to do that? Well, it can provide you the ability for a back-end covert channel. If you're on an enterprise network and you're connected to the Wi-Fi using the same physical, uh, wireless card, you can also have that behave like an access point and have somebody else come in, connect to that virtual Wi-Fi and into the corporate network and use that as a really nice mechanism to exfiltrate data. We cover that in a lot more detail in the data hiding book with a nice use case. But, setting this up is fairly trivial. Um, you can do it right from the command line. Um, this is a screenshot of that with, uh, simply three commands. You can set this up. You can define how you want this virtual Wi-Fi configured in terms of the SSID, um, if you want to hide that, if you want to, uh, use encryption or not, and basically how you want to set that up. In terms of the threat to the network, it could be on the wireless or the wired side. So let's say that you're physically connected to an enterprise network on the wired side. You fire up your wireless card, you set up the virtual Wi-Fi, and you now have your back channel. Certainly this might be a little bit more in line with internet connection sharing or a bridge, if you will, from wired to wireless. But what really gets interesting is that when you're connected to your secure Wi-Fi network, you can also, as a client, you can also use that same physical network card, wireless card, to actually set up this virtual Wi-Fi and allow other devices to connect in with no authentication whatsoever, if that's how you set it up, into your encrypted and secure Wi-Fi network. Very, very easy to do, supported on all versions of Windows 7, 8, and Windows 10. Identifying this is commonly an oversight for most organizations. It'll actually appear as if, you know, you have a client and there's an AP, but it doesn't appear that it's coming from the same device. At least, you know, from a surface level perspective. So it's kind of difficult to determine that, hey, is this one of our PCs that's actually got a virtual Wi-Fi or virtual access point on it that has people connecting to it and exfiltrating data out of my network? But identifying it, you can really start to peel the onion back if you fire up Wireshark and you look at the Wi-Fi packets. In this case, you can see the beacon frames, but you can see the probe responses and the probe requests coming from the same physical wireless card. And that's a sure fuck-tail sign that, why is this device behaving both like an access point and as a client? Certainly shouldn't be doing that, right? So you would have the laptop send a probe request, the virtual Wi-Fi, Windows 7, 8 or 10 respond to the probe response, and it does provide for network access channelation, so therefore it will give you an IP address and then allow you Layer 3 access and into the network. Makes for a nice covert channel. And now you can do it in Macs as well. So taking a step further, kind of peeled the onion back and took a look at a lot of the different types of Wi-Fi frames. Some of this kind of stemmed from research that Microsoft actually did, which I think a lot of people would be surprised to actually do some pretty good research. The idea behind it, which actually predated Apple and what they do with some of the Bluetooth and stuff, actually predates them by, think about six or seven years, was the ability to kind of send ads via Wi-Fi. So if you had your Wi-Fi card on, on whatever type of device you had, you wandered into your local retail store, they would detect you're there, you might have their app that you downloaded, and that would allow them to determine, hey, Mike's in the store, I'm going to send him a one-time use ad or discount for the next hour. And then boom, you would get some kind of notification or something else on your phone to use that coupon. But it can also be used in a covert way. So what we're talking about here is if you take a look at the actual frame, there's a lot of fields here. And one of them is the information, some people call it informational element, which consists of 256 bytes. This is actually provided optionally to the vendor if they want to use it. And in many cases, it's either not used or the full extent of the 256 bytes are not used. So realistically, you have about 256 bytes on your phone. And you can actually inject data in it and have this communicated out. So kind of automated this in a lab, had a DDWRT wireless access point and kind of some automated code that was persistently injecting this into each one of these beacons. And each one contained a partial of the actual message, such that when you received all the relevant beacon packets, you could piecemeal together that actual message. So while most people are wandering by, they see an access point, they connect to it, it seems very innocuous, to the right person in the know, they would be collecting the beacon packets and obtaining a hidden message from it. Furthermore, by doing this, we kind of also created like a PCAP file, we're able to replay using AirPlay NG and transmit it from one device to another. And then this breaks down for you kind of what those packets look like and you can see here in the IE field some hidden data as it's broadcasting or sending these beacon frames. So I kind of refer to this as stego stuffing and I cover it in more detail in the book, but it provides for a nice wireless medium for hidden messages and even maybe smaller things, such as combination or other interesting data. So if somebody's coming by, you could just be repeating that same beacon over and over or that same message hidden in the information element field and then they could obtain that information. So, was there anything else you wanted to comment on, Chet? Okay. So yeah, we'll go ahead and open it up for Q&A. If you want to bring up a piece of paper with your name or something on it and throw it in the basket, we'll do a raffle in a few minutes for the data hiding book. Within the book itself, we cover a lot more details around hiding in VMs or virtual machines, how to hide in mobile apps, and a lot of other techniques as well. Anybody have any questions? Getting any good gold nuggets out of that? Cool. Well, we'll hang out for a few minutes if you guys have any questions and then we'll go ahead and raffle off a copy of the book. But thanks for coming by. Hope you guys enjoyed it.