And so it begins. Welcome to the Packet Hacking Village at DEF CON 23. It is now the top of the hour. Good afternoon, everyone. And so we have a very, very, very special guest speaker today. He is a manager of Threat Services, Threat Systems at Fidelis. He will be here to talk about ICU. Yes. He sees you, ICU, everyone sees you. Ladies and gentlemen, Andrew Beard. All right, we got audio? Cool. So I'm Andrew Beard. I work for Fidelis Cybersecurity. A bunch of us over there in the corner. I totally can't see any of you guys because there's a giant bright light just in my face. But, you know, I'm trusted over there. So originally I was supposed to... I was supposed to co-present with one of my co-workers, Brian Woolwinder. He couldn't make it here today. He had some pretty severe back issues right before the convention. So he's the guy that is normally the public speaking guy. I was going to be the one kind of standing off here in the corner, nodding and, you know, silent. So just so you know, I'm picturing all you guys in your underwear right now because I'm nervous as hell. So in memory of Brian, since he couldn't... I just wanted to say a couple words. When you've been down to lift shit, you know, lift with your legs, not your back. Always kind of pull in your ab muscles there, even if you're just kind of bending, not lifting a lot. And avoid twisting your trunk. All of those things can, you know, help you avoid a long and painful recovery process and bailing on your co-presenter at DEF CON. So I wanted to talk a little bit here today about DEF CON 22, specifically a wall of sheep. You know, our kind of what we did last year, a couple of very basic and very, very stupid ways to pass credentials in the clear. And a couple of weird things we kind of found when we were running our setup out there. So last year, DEF CON 22, we were a sponsor, sponsored this year. And, you know, as part of that, we thought it would be fun to park a couple of our guys on a network tap, same traffic everybody else is seeing, and kind of see what we could find. So I don't want to get too much into what we actually use, but just so you guys got an idea of what our capabilities are. We have a commercial, off-the-shelf network visibility appliance, nothing really special. We have a common data tap, same one that anybody over there in the packet hacking village can just plug into, take a look at the traffic. And we, you know, our system, it's kind of rules-based. We had some general purpose rules, same things that anybody who uses the product can use. And some that we specifically customized for Wallace Sheave to kind of flag on interesting things and capture content that we thought was particularly fun. We also did kind of a metadata capture for the duration of the event. You know, we would capture things like IP addresses, URLs, nothing in the content side, but just stuff that kind of let us describe what was going on and do a kind of gross estimation of the traffic. That metadata comprised about 500 megs of stuff. And that's what we did for the three days between August 8th and August 10th. And that represents a little over 6 million transactions. Transaction to us is, it's not a TCP session, it's a transfer. So if you've got like an HTTP transaction going on, that's one particular file that came down. You go three files in one particular HTTP session, three different transactions. So that's just a sampling of what we had, but that's the stuff that we were concentrating on for the announcement. So, you know, a couple rules of engagement that we had going in and stuff I'll talk about. We're completely passive listener, right? The tap over there is, you know, it's one way. We're not doing any packet injection back out. We're not trying to man in the middle anything. We're not able to, you know, affect the transfers going on. We just watch and see what happens. We also, anything content-wise in an SSL or TLS transaction, we pretty much do the same thing. much ignored right we would capture metadata on it just so we know where it was coming from you know some light certificate information but if you were using ssl or tls you were safe you know we weren't doing anything that was particularly high level all these are very very very basic techniques and all the credentials i'll talk about here are partially redacted same thing you'll see up there with the wall of sheep um you know i'm not going to be giving away anything here that uh you know is going to be sensitive at all now granted this all happened a year ago if these guys guys got pwned and they're still using the password a year later they probably deserve it but you know that's somebody else's domain so a little bit about just overall what we were looking at right over the course of those three days um we were seeing a bunch of different uh protocols but you know the vast majority of it these two uh you know this is all normal, unencrypted HTTP traffic. Total bulk of it. This is anything SSL, TLS, and that can be HTTPS, email over a TLS session, you know, everything. You know, this is the everything else. Obviously, you know, HTTP, vast majority of what's going on. People browsing normal websites, people, you know, using mobile apps that are communicating back to their web app. You know, nothing particularly special going on. One thing to note, though, so this other is pretty small. It's like about 7%, right? One of the things that we really expected to see out of all this was way more VPN traffic. We figured, all right, it's DEF CON. You know, everybody's going to be encrypting the shit out of everything, right? There's absolutely no reason that somebody's going to be sending stuff in the clear. Apparently, that totally was not the case. There were a couple encrypted tunnels, you know, a kind of token presence. But nowhere, anywhere near what we were expecting. So, you know, it's pretty small. It's like about 7%, right? One of the things that we were expecting. There are actually more Torito IPv6 tunnels, which are, you know, still in the clear, but IPv6 encapsulation over IPv4 than there were actual VPN stuff. You know, almost all the VPNs we're seeing were open VPN, a little bit of IPSec, a little bit of, you know, proprietary stuff, PAs, those kind of things. You know, the best guess we have for why that's true is that anybody paranoid enough to use a VPN, they're going to be able to use it. So, you know, who knows what they were doing, didn't use the Wi-Fi. You know, keep it on cellular, what have you. You know, just because, you know, they're, you're paranoid, sorry, just because, yeah, sorry, just because you're paranoid doesn't mean that they aren't actually, you know, trying to watch you, which obviously we are. So, you know, I want to talk a little bit about, you know, the passwords, right? Wall of sheep, completely all about the passwords. Credentials, you know, all that good stuff. You know, there's a lot of other stuff going on, but pretty much credentials is the reason, you know, this whole thing exists. And, you know, the vast majority of the plain text credentials we were seeing were over, you know, a couple distinct protocols, mail protocols. I group all of these three together just because they tend to work very hand in hand. You know, you have POP3 and SMTT together. You have, you know, you have, you know, you have, you know, you have, you know, you have a lot of different protocols. You can go incoming, outgoing. IMAP. All of them tend to be configured very much the same way. You're talking the same clients. And, you know, in most cases you're talking the same back-end servers, just different ports and different protocols. FTP, you know, IRC. So, IRC is a little bit of a weird one, right? On a normal enterprise environment, you're not really expecting to see a lot of IRC traffic. DEF CON obviously is not your normal enterprise network. The fact that it was up there on that protocol call graph at all is kind of a testament for the group here as opposed to, you know, the Internet at large. But so Telnet, there's also the occasional HTTP completely in the clear. I'll get over into some more common ways for encoding passwords and HTTP traffic later. But just from the standpoint of this is the stuff that if you're looking at a TCP dump, Wireshark, you know, you're just going to completely read it off the bat. There's absolutely nothing involved here that, you know, your average eight-year-old couldn't do if he could figure out, you know, how to read the word password. So these are what we consider the fish in a barrel protocols, right? There are so many of them. They're so easy. You know, there's absolutely nothing involved here that is particularly special. You know, and a couple of these, these are all examples that we pulled out from last year, right? POP3 transactions, just a little bit of convention here that I'm using. All the blue circles, all the blue circles, all the blue circles, all the blue circles, all the blue stuff is the server side. All the red stuff is the client side. You know, if you're familiar with the Wireshark follow stream stuff, should look kind of similar. Anything in this weird gray is just stuff that I obfuscated out because I don't want, you know, to piss off anyone too badly. But, you know, it's, again, server puts up his banner. Client says, hey, I want your capabilities. You know, says, nope, can't do it. Needs some authorization. Username, password, that's it, right? Totally in the clear. If you can go through and just say, I want to look at POP3 sessions, you can find these. The great thing about all of these plain text credential ones is they're all in the beginning of the sessions, too, right? You're not going to do anything useful with any of these until you actually log in. You're not going to have giant mail dumps without the server identifying who you are. So this is all within maybe the first one, two packets of a transaction once you've set up your TCP and SYN and ACK and everything. So, you know, if you're going through looking at just basic packet dumps, you can pretty much just say, give me the first beginning of this stuff and throw everything else out and, you know, you can still get the credentials in the clear. So, you know, IMAP, even stupider, you know, you've just got username, password, same line, one, that's it. This is a real, real easy one to search for if you've just got a plain text dump of all this stuff, right? FTP transactions, you know, big old banner saying, welcome to my server. Fun part here, this server actually says that he's doing TLS. He isn't completely in the clear. Port 21, normal stuff. You know, login banner, username, password, that's it. Again, all this stuff, this is all going to fit within the first packet. So, as I said before, this is all stuff that we copy. We're looking at content. We also did a fair amount of metadata capture, right? We were trying to, in our metadata capture, one of the attributes that pulls out is URLs, particularly in HTTP traffic. So, even though I don't have a complete dump of them, you know, say that you're just an incredibly, you know, first web app you've ever done and you're saying, all right, I want to put username and password info up. I need to do some kind of credential exchange. So, you say, wow. Okay, I know about this trick where I'm going to, you know, put a key and value pair truncated together and I'm just going to, you know, use that. So, if you dump all of these URLs into a file, which is very, very easy to do with, you know, plenty of good tools out there. Bro in particular is one of my favorites. Bro is a very, very powerful, not basically network analyzer. That's completely scriptable. You can say, all right, I just, with its default configuration, dump all of the URLs that I'm seeing in the clear to a file, to a log file. And then just grep through that for, you know, something like this, this sequence. You know, all of a sudden, all the usernames and passwords just completely fall out of here. One other fun point. The word for password in almost every language is password. So, it doesn't. It doesn't really matter if the guy is talking in Spanish or what have you. You know, just for giggles, go ahead and you can look up all the different translations for password. Search for them, too. You end up finding plenty of stuff that you wouldn't think of. Defcon, especially, being a pretty international event, a lot of people come from a lot of different places with a lot, a lot of misconfigured web servers. So, you know, those are all kind of individual examples. But when it comes to all of these plain text protocols, email is the absolute king, right? These three, POP3, IMAP, and SMTP, make up about 75% of all the credentials that we pulled there. And that's, you know, a little bit weird. Because if you remember the previous slide, the vast majority of all the traffic we were seeing was HTTP. By far. The mail didn't even make it on the board, right? Those were all stuck in that other category that was about 7%. So, 7% of our traffic is responsible for 75% of our credentials. Yeah, that might be a little bit of a problem. So, you know, there are a lot of things going on. One of the big ones is that mail is kind of a given by now, right? The vast majority of these mail sessions that we were seeing were coming from mobile devices. I don't know about you guys, but I update the mail settings on my phone maybe about once every two years when I get a new one. You know, I put it in and I forget about it. It's also, from then on, it's just talking out. It's beaconing. And it's doing it every 10, 15 minutes for the next two years. When that kind of thing happens in the background, people just don't think about it anymore. People don't consider it. And it's really easy to completely misconfigure. It's really easy to misconfigure it in those first, you know, week when you've got a new phone and you've got all these shiny new buttons and, you know, look, the camera's awesome and, hey, I got a shiny new case for it. This is completely a problem of almost of the users on making. You know, a lot of the mobile devices we were seeing, the vast majority of them were iPhones. And we told that based on the MIME headers for outgoing mail, IMAP ID responses. And from what we could tell, most of the major providers were actually supported. They were supported SSL, things like mail.163.com, very, very big Chinese supplier. In iOS, there's really just these two fields that separate you from, you know, happy, blissful email and being up on that wall over there. If your provider doesn't support SSL, if you can't check this box because it won't work otherwise, find another provider who isn't complete crap. It's 25. 15, we've got SSL figured out by now. One other thing worth noting, none of the major providers, you know, the Googles, the Yahoos, all those guys, actually seem to have credentials up on the board for the mail protocols. The big reason that we're seeing for that is that the major mail providers, you know, if they have, especially in iOS, I'm using iOS as an example here just because, you know, iPhones. But, you know. Even for Outlook, even for Apple Mail, almost every mail client out there, if you select one of these guys, they already know what's going on. They automatically enable SSL. Most of these providers don't even support unencrypted mail anymore. You know, if you go to Outlook or Thunderbird, it'll auto probe and say, all right, your provider supports SSL. You aren't doing plain text because, you know, I'm going to give you a little bit of a safety net here. This seems to work pretty well for the mass majority of people. Just because, like I said, there wasn't a single Gmail credential up there that was actually scraped from somebody doing Gmail. Same thing with Yahoo. Same thing with Outlook.com. Same thing with AOL. Any of these guys. Almost everyone was some, you know, some of them were rather large providers, but none of them had those commercial relationships with, you know, Android handset manufacturers, Apple, whoever. So, you know, the easy button. It seems to help out a lot here. So that's, you know, one class of, again, the fish in the barrel credentials. Stuff straight on the wire, straight plain text. You know, if you're just looking through them, you can optically just say, all right, there's something bad here. There's a whole other category of things, and I'm really only going to talk about one of them as an example, that I call encoded credentials. You know, some people call them obfuscated credentials, but obfuscation kind of implies that there's... There's an intent to actually hide something, and if you actually had an intent to hide it, you'd try a heck of a lot harder. So, you know, one of the big ones is just HTTP basic authentication, and I'm showing the credentials here, but I blanked out the password. So there's one particular field here that's kind of interesting. It's that authorization basic, right? And if anybody's looking at this, you know, is thinking in their head, God, that looks a whole lot like Base64. Right? Right? Right? You are completely right, sir. So you decode that, and, you know, you just have this nice little colon separated. That's your username. That's your password. If you're looking at this in Wireshark, obviously, you aren't going to see it. Even if you're doing your little follow stream thing, you're going to have to do a little bit of manual decoding. Again, this is where a tool like Bro that's a little more content aware really comes in handy, because all that stuff can be scripted very, very easily, just so it pops the passwords out the other end. So this is... And, you know, I really shouldn't have used the word okay, because okay implies some kind of, you know, did I agree with it? It still sucks. But it's not as much of a problem if your transport layer is providing confidentiality. Things like HTTPS, where you've got a TLS layer. You know, most of the time there, you know, just the fact that you're sending it in the clear, all right, you think you've got a pretty good safety net there. Obviously, that's not the case if you have a misconfigured web server, which... A bunch of them seem to be. But, you know, if you're doing straight HTTP, this is a problem. So if you've ever seen the syntax where you've got a URL and a username and password kind of tacked on the front, this is what your HTTP client is sending out the other side. It's taking this info, base64 encoding it, and putting it into that header up there. So, you know, that's okay. You know, in a case like this, this is somebody actually logging into a website, right? They try to go somewhere, password prompt stuff, they put in their info, you know, there it is. But, you know, there's a whole other set of things where stuff goes on in the background you're not aware of. You know, this is a kind of one where... This is something we found last year. And it seemed to be a seller of ink cartridges, toner, office supplies, all sorts of good stuff like that. There was a user login that was completely, you know, it actually was HTTPS. We couldn't see the original login. Cool, you know, they seem to be doing pretty well. But then it switches over to HTTP for everything else. And when it does that, it has this funny little thing here. Now, this is, you know, this isn't the credentials. Cool. This isn't the username and password that somebody logged into the site with. But what it has actually... What it actually is, is a key that's actually, it says API, but this is actually a session key. So, I'm playing around with this a little bit and there's a timeout on it. But for the duration of that timeout, if you keep making requests, this little key here will get you access to the user session. So, if you happen to see something like this going across the wire, and then, you know, really quickly start sending some requests to that site with this particular... You know, these credentials here, forging your own HTTP authorization basic, and honestly, you don't even need to decode it for that. You could just copy and paste this guy into the same one, use the same header that he's got here. You could pretty much, well, ship as much toner you want anywhere on the face of the planet. And in this case, it actually, from what we could tell, again, we didn't do any actual logging in with these credentials. But from the traffic, we got... This guy had a saved credit card number. They didn't, from the quick test we did, they didn't seem to ask for a lot of info once all that was in. They really prided themselves on that one-click ordering. And, you know, being able to deliver everything speedy. Whether you were the guy that actually wanted to do this stuff or the guy who was sitting on the console over there who just saw his credentials go across. So, again, all this stuff, really basic, right? We were here for three days or so. It was a lot of work. It's pretty easy just pulling this stuff out for, you know, two days, maybe a day and a half. Then you start getting bored. Again, fish in a barrel. There's not a lot of challenge to this. A bunch of bored guys looking at your network traffic really isn't a good thing. Especially when you start doing dumb stuff in the clear. So then we started looking at, all right, what else can we find, right? And even if it's not credentials, it isn't even high impact. What fun stuff is going on? We started seeing blobs like this. You know, a lot of info encoded in the URL. All this is URL encoding, right? There are only certain characters allotted in URLs. So there's a system for encoding the ones that aren't. And, you know, this is, you know, some fun stuff here. And we're seeing some keywords. All right. That's interesting. You know, talking about JSON content. So we URL decode this whole blob. That blob, right? And, you know, we see some interesting stuff. Mainly all this. So, you know, this was going to, and I'm probably going to completely slaughter the pronunciation of this, sorry. Taobao. My understanding is this is kind of a Chinese eBay kind of Craigslist kind of thing. And it seems like their mobile app, when you install it, you set some kind of default location. And you said, okay, this is my home area. Well, it really doesn't. Until it acquires a GPS lock and can tell where you are now, it always kind of pulls down that default location. And says, all right, hey, I'm here. What's going on in this particular area? So in this case, that particular area seems to be, you know, right around probably where this guy came from. You know, mobile apps are fun because they have pretty much complete access to your phone and your network traffic. So if you install this thing and don't think about it, you know. There's a possibility that it's just beaconing your home location out to everyone around you, whether you're thinking about it or not. So, okay, that's not too bad. Right? That could be, you know, if somebody came up and asked me, hey, where are you from, I'd probably tell them. I'd, you know, like to know that, you know, who I was talking to. But that's not that bad. And, you know, there's nothing really important in my email. Right? Nothing's going on. So I'll tell you a little story. There was a woman last year who, she was actually a teacher from Texas, who kind of sat down at our booth and said, hey, you know, I teach technology students. Teach me something. What are you guys doing? Tell me what's going on. And one of our guys, Dave Chirico, who's probably around here somewhere, but I can't see any of you because of this giant blinding light again. He sits down with her and he starts showing her, you know, what we're doing, the stuff going across the network, you know, what's going on. Starts, you know, talking about some of the same stuff here. And about five minutes later, she comes up and says, hey, this is kind of weird. Is this important? So she's looking through and she sees some email traffic going back and forth between these two people. And from their domain, we can tell that these guys seem to be a recruiting firm. Pretty small one. Actually family owned. You know, explains the names going back and forth. So, okay. You know, you've got some email. So the subject of this particular email was Megan's W4. Okay. Getting a little more interesting. Yeah. So there's an attachment to this email. It's called 2014w4.pdf. Okay. Yeah. So, you know, we open it up and say, hey, what's going on? So I will say that this is not the W4 we saw. Good news. There were two differences between the W4 that we saw and this one. So I'm lazy and I suck at Google foo. This is a 2015 W4. It was a 2014. The other difference was that it had Megan's name, home address, all this stuff, signature, and her social security number. So, you know, this kind of sucks. Because Megan is, of course, not the one at DEF CON. She's not the one passing her stuff in the clear. Her stuff is just in the email address of, you know, her boss, whatever. And, you know, now her social security number is probably, you know, on the hard drive of, well, us. And, you know, a whole bunch of people sitting over there. Why the hell would you put W4 forms in an unsecured account? Why the hell would you put W4 in an unsecured email box? So it's bad enough that this is going in transit across the network, right? But, you know, the implication here is it doesn't really matter if it went in the clear across the network. You've got their username and password. You can just log into their email. Even if they weren't looking at the time, it's still sitting there in their email box. And this is kind of where a concept called defense in depth comes in. And this is a very, very simple application of defense in depth, right? Protect your stuff in transit. And then also protect your stuff at rest. There's no good reason to have an unencrypted W4 form with social security numbers sitting in your email box. This is a problem that's been solved many, many, many times. You know, PGP, pretty good privacy. If you were to encrypt the mail on the client side, send it. The recipient could decrypt it. It's not sitting on your provider's email box. S-MIME certificates, they're cheap. You know, some of them are free. They're supported by pretty much every mail client out there. Encrypted. Including iOS. Most Android device manufacturers. Apple Mail, Exchange. Pretty much every mail client that doesn't support S-MIME by now is crap. And, you know, even just at the most basic level, put it in an AES encrypted zip file. Document-based encryption is better than just having it sit there for anybody to see. Don't let one password be what separates you from total financial loss. Or, you know, damaging someone else. So, yeah. Megan is probably going to be getting, I guess, one of those offers for one year of credit monitoring. So, you know, one other... We thought, okay, this is pretty good. From the find weird stuff perspective, you win. We thought that until one other funny little thing happened. If anybody remembers DEF CON 22, the band The Orb was playing. You know, 90s electronic band. Really good set. So, they were playing, I want to say, late, you know, 1 a.m., 2 a.m., something like that. Seems like after the set, one of the people affiliated with the band logged into the DEF CON wireless network. Yeah. That's going really well for those guys over there. And, you know, there's this whole email exchange going back and forth. But this is one of the last ones in the thread. And there's somebody with the band. This seems to be a domain that was configured by somebody who, you know, could have done a little bit better job. Didn't have SSL encryption enabled. Seems like SSL probably wasn't even an option at the time. And, you know, this particular person affiliated with the band, again, iPhone, configured, pulling down mail. So, this is the last one in this particular exchange. And he's saying, hey, can you pick up the balance of $6,500 for tonight's performance at Vegas? So, think about this for a sec. You have, you know the details of this transaction. Right? You know what it's for. You know who it's getting picked up from. You know, you know, who it's expecting to see. You can pretty much, you know, know enough to kind of figure your way through it. Right? You have unrestricted access to this guy's email address. Think really hard about how, what you could do within about a month. Or, I don't know, 30 seconds to try to get your hands on that check. So, you know, there are little transactions like this that people think aren't terribly important. But, you know, when it comes down to it, when you have info like this, you don't really need to spend much time over there at the social engineering village to, you know, use something like this to possibly cause a significant amount of damage financially. So, that's something. That's pretty much it. Just a quick recap. You know, through a misconfiguration, lack of controls, you know, poor choice of providers, it's pretty easy for some of this info to make its way across the network. Right? And, you know, again, one checkbox. That's the difference between everything's good and being up there on the wall. Consider descents in depth. The stuff that you, you know, if it's sitting in your email inbox, assume for a second that somebody has access to it. Anything that you're worried about losing probably shouldn't be there. At least not in the clear. Don't trust your email password as like the only source of security. Or at least, you know, trying to keep you from harm. And treat absolutely every network as untrusted. Especially the ones that put up a giant banner when you log in saying, holy crap, people may be monitoring your network traffic. That's pretty much it. Take questions. Anything?