Hi everyone, thanks for coming. My name is Robert Deaton and I'm going to talk to you about a piece of software I've been working on for the past few months called DivaShark. But first, I want to warn you about the perils of trusting your friends to help you if you were to ask them to say, help proofread your abstract before you send it in. And this is the abstract that I believe is printed in the book. And the two highlighted lines were added by a friend of mine at the very last minute when I asked him to proofread it. It makes me look much more cocky than I actually am on this. So, make sure you proofread after you have someone proofread for you. Or things like this can happen. So, the inspiration for this project really came out of playing Capture the Packet last year and some other CTFs over the past few years. And so, if you're not familiar, Capture the Packet is a competition that's run at DEF CON every year. Or, I guess it ran last year and is this year again, too. And its focus is on live network traffic analysis. They give Jeopardy-style questions, about 10 or 15 questions. And you plug in an Ethernet cable and you watch the traffic and you have to try to find the various things that they're looking for on the network. But to make it difficult, they put lots and lots of noise on the wire. And you have an hour to answer all these questions. So, some of the example questions they have is a user at this IP address logged into Reddit. What was his username and password? Because he wasn't using HTTPS. Or, which email service did a user with this IP address visit? Or, two users had a Google Voice conversation and if you can find it, you can actually listen in on the conversation after the fact and find out what they were talking about. So, kind of the standard tool that everyone uses when playing Capture the Packet is Wireshark. And it's kind of the industry standard in doing network analysis. I think literally every team at Capture the Packet last year was seen using Wireshark. It was just kind of the thing that everyone used. But I argue that it's really kind of the wrong tool for the job. And I'm going to show you why. So, this is a screenshot of Wireshark some of the capture the packet traffic open last year. Thank you. As you can see, there's a lot of information. This is one view of the 146,000 packets and I think this is about a quarter of the traffic dump for the entire hour long. So there's tons and tons and tons and tons of noise. If you were to open up a view on any individual packet or look at the little pane that's usually down there that I have hidden, you get all kinds of information about every individual packet. Everything from the TCP sequence numbers, frame numbers on the Ethernet line, some analysis of like HTTP headers if it's that, but every little detail about every kind of layer of the information. When you're looking for a packet that's hidden, you're going to want to look at the TCP sequence numbers. When you're looking for something high level like a user logged into a website and it wasn't secure and I want his username and password, you don't really care about the TCP sequence numbers and whether the packets came in order or out of order or whether things had to be retransmitted. It doesn't really matter at all. So I'm going to use the example of finding the Reddit log in to show kind of what we ended up having to do last year to capture the packet. So one idea is first we're going to need to figure out which IP addresses are communicating here. You know the users because it's given to you, but you don't know Reddit's offhand. You can't really look it up on your own because DNS round robin or whatever could point you in the wrong direction. So we'll try to see if the DNS lookup happened in the network traffic that we captured. And so we can do a filter to try to get just DNS traffic and we still end up with a few hundred requests for this 15-minute session. So we're going to do a filter to try to get just DNS traffic. And you can do like a search on the string Reddit to maybe help you narrow it down and find it that way. And of course this time we couldn't be so lucky. It must have been cached. So instead we'll do a full text search for the string Reddit on all the traffic, which you can imagine takes a minute or two when you're looking through 146,000 packets. And you come up with this. It kind of just brings you to the point in where it finds Reddit for the first time. And the request that it found is a request for an advertisement that happened to be on Reddit's sidebar. So you can follow that TCP stream and it gives you a little bit more and actually shows that, yeah, that was pulling an ad and it's gzipping code and all that stuff. Don't really care. So you can keep searching again for Reddit and you'll get another packet that had the string Reddit. And you can follow that TCP stream and you can keep doing that. And in this case, if you do it about 40 times, you'll finally find the one place where the user tried to log in. Or you can try filtering by the IP address that they pulled the ads from and hope that that's the same one that the login server is on. Or you can just kind of keep on trying to filter out by various things and searching different strings. Filter by searching for the string Reddit and then filter again searching for the string login. And you can just keep on doing this and eventually you'll find it. But it took a whole lot of effort. So to make it better, do we really care about packet-level details? Do we really need to see all that stuff? And for something where we're looking at high-level stuff and looking through application protocols, it's really not important. We're not actually writing these protocols. We're not looking for bugs in the protocols. We really just care about the high-level stuff that was sent to us. We don't need to see every packet. We don't need to look at those individually. And even in some cases, we don't even need to look at one TCP connection individually. There's a lot of information that can be gathered that you can coalesce from a few different requests to the server. So this is where Divashark comes in. And it's a tool to kind of try to make this live network forensics easy. And in addition, it's also a framework that we can build kind of application-level protocol to sectors and classifiers, similar to Wireshark, but that don't care about the low-level details. So the idea is really to get you the information that you want as quickly as possible without getting bogged down in small details. So this is just kind of the analog to Wireshark's home view. We show source IPs and destination ports, packet counts, and protocols which the program detects for you, source ports and destination ports. So kind of the big picture is that Divashark will do the same sort of traffic analysis or capture that Wireshark does. You can load in from a PCAP. You can do live capture from a card if it's in promiscuous mode. And it sort of automatically tries to follow TCP streams and UDP streams even as they come in. And kind of group them together into individual streams. Afterwards, it runs the streams through a kind of port-independent protocol classifier because you never know if someone's hiding things by using different ports. It prioritizes common ports for common protocols, so it will look for HTTP running on port 80 or SH running on port 22 first. But if sort of those classifiers don't match, then it will start running through the other classifiers and once it's classified, there are protocol dissectors which can go along with the classifiers that are kind of designed to get you the information that you care about. And so the example is the HTTP dissector will show you information such as the user agent that was requested, the page that was requested, kind of give you a chart with all the get and post parameters, and give you the option to just download the file that was transferred or the page that was transferred. And save that out right off the bat. If you've ever tried to do this in Wireshark, you can follow the TCP stream in Wireshark and then you'll get the conversation going back and forth. And then you can save that whole conversation and kind of carve the file to get rid of the headers that were sent in the request that you don't care about. And then you have the file you're looking for. It's sort of that bit of tediousness that we want to get rid of. We really want to be able to just say, hey, this user downloaded a file. We want to get rid of it. Here it is. Don't worry about anything like that. And probably one of the most important part is sort of powerful abilities to filter traffic. So we don't want to be looking through every little stream trying to find the one that matches us. We want to be able to classify or we want to be able to filter by the protocol that you're running on. But even better than that, the protocol classifiers have the ability to give the program information that they can filter on at an application level. So one example is the HTTP classifier and dissector allow you to filter your HTTP traffic by user agent or by whatever URL they're requesting, by whether or not it had gzip encoding, anything like that. And It's sort of that ability to really narrow down on the type of traffic that you want that I think is kind of the most important and the big picture for the software. And unfortunately and embarrassingly for me, much of what I've told you is finished. The part that's not finished and was not ready to present to you today was the user interface, which is kind of the most important part, of course. But the sort of the sectors and the analysis and all that stuff, it works, it's done. It's all written in Python. It's still incredibly fast. I loaded up the screenshot from back here is actually the same PCAP from capture the packet last year that Wireshark did. And it was able to load it. And classify based on I have about six protocol classifiers in. And it loaded the whole file and classified it before I could time it. And I think it's kind of a great proof of concept that we don't need to worry about writing these in C or in low-level languages. Python has shown that it's fast enough. And it gives us the ability to very quickly and rapidly prototype and write new protocol classifiers and dissectors. And get them out so that for competitions like capture the packet, we have any kind of protocol classification and dissection that we need. And so the last bit of info that I have for you guys is that the slides will be up soon. Release is imminent. Probably within the next few days, I'm going to actually put up the first versions, even if they don't have the user interface. And the project is going to be open source. And I really love everyone's help. I spent a long time trying to think out and put together a great Python API so that the classifiers and the sectors can be written easily and without caring about the low-level details. And I would love if we could get as many people as possible involved and get really cool detectors. And make this a cool project that makes the competition like capture the packet look really easy and really simple. 1. 2. this kind of tedious hunt to see who can filter through Wireshark the fastest. We can do better. I think a tool like this has the ability to make Capture the Packet as a competition almost not a competition anymore because the playing field should have everyone be able to find every answer immediately. So that's what I have for you guys. I guess I have time for questions if people have questions. Why is it called Demon Shark? So if you're familiar with this well the shark part comes from Wireshark because it seems like a similar product and so I wanted to keep that around. And as I was trying to think of names for this I thought of the ability to kind of monitor network flow and DivaCup came to mind. And so I kind of combined the two of those into DivaShark. And that gentleman is also the gentleman who decided to insert things into my abstract when proofreading it. Yay! Thank you. Yeah. Right now I have I think six protocol classifiers just for HTTP, SSH, Samba, and a couple others. But there's also sort of a naive port-based classifier that it will fall back on. So I have a list of common, the most common services that are run on different ports. And if it fails to classify, it kind of defaults on showing you that information at the very least for the time being. There's a Python API that's available. You basically implement three or four functions that are going to take in different parts of the network traffic. You specify a few options. For instance, the classifiers say, I need N bytes before I can confidently say that this is the right kind of, or before I can confidently classify it. But you'll get that sort of information back. And the classifiers just return whether or not they've matched. Yeah. Sorry. What's that? Okay. So you asked how it's different from flow analysis and flow tools. And so there are tools like TCP flow, which kind of are supposed to take in network traffic, and they just spit back out the individual flows as PCAPs or whatever. And so there are tools like TCP flow, and really the difference here is bringing together that ability to do flow analysis, but also to do application level analysis on the flows. It's the best part is not that it is able to kind of put together the TCP and the UDP sessions. It's that we can have that information put together and pass it on to more powerful tools that are able to look at the application level and no longer care that it came from a TCP stream or a UDP stream. We care what's happening at the application level. Yeah. I'm not familiar with that, but it does remind me of one other thing that I wanted to mention and forgot to. And that's one other thing that we have the capability to do with the API is to kind of correlate data between more than one TCP session. So if I understood your question correctly, there's a piece of software which actually lets you bring in more than one network stream. And correlate data between those. I haven't thought about the capability of doing that. But what we can do is, for instance, in the main user interface, we don't often care about the IP address. We care what domain it's looking at. And we actually have the ability to monitor all the DNS queries and make a DNS database and show instead the host that that IP address is looking at. And that IP address belongs to in the network traffic, even if that request was made at a different time. And it could also get that information from an HTTP request because they have the host field. So there's a bunch of different ways to kind of take a bit of information that we probably don't care about, which is the IP address, and show you the information that we do care about, like the domain name that was being connected to. So, can you repeat the last part of that? Well, when you're analyzing traffic, if you can choose something to relate to, say a graphic interface, and you look at that, and it's going to be new, and it's going to work, and it's going to be grass, do you use any of the graphs that are in the work? Yes. So do you use any of them? Do any of the databases, do they have something to analyze the graph? So I think your question is, in Wireshark there's a feature where you can actually kind of view graphs of the traffic as it comes through, and that gives you sort of information on which protocols are more popular at the time. And you're asking if that information is used at all to help? Yes. I don't use anything from Wireshark at all. But what is done is sort of protocols, in the options you can actually specify which protocol analyzers you want to load. So by default it loads all of them, but if you say don't care about HTTP ever, you can go ahead and unload that so that it doesn't run. But it also lets you order the protocols in the priority that you want them to be checked. So if you care the most that, we're looking for HTTP traffic, you can put that protocol classifier and dissector as like the priority ones. So will you already build the built-ins? Yes. Okay. All right. It's going to be GUI only. So I feel like for a tool like this, the user interface is probably going to be one of the most important parts. And it's part of the reason that it wasn't done is I've tried to spend a lot of time making sure that everything kind of behaves as you would expect and that you can customize and change things and make sure that the information that you care about is what's being shown. Yeah. Two things. You've got the Wireshark board, the console, and so many other things. How do you build the source project on GitHub? I haven't decided where it's going to be hosted yet. I can tell you that it will be Git-based, but I'm not sure if I'm going to host it on GitHub or not. But at the very least, you're free to mirror it on GitHub and send pull requests through GitHub. I just want to say thank you for getting started on this. You can tell us what each of you is going to do. Thank you even more. Thanks. Yeah. Well, so it really is going to depend on the different protocol classifiers and dissectors because each one is kind of written as a plug-in and they can provide any sort of filters you want, including an interface to, like, design those filters. So for HTTP, the filters will support filtering on anything that comes in the HTTP headers. Or for other protocols, it's going to vary based on which protocol is available. But any information which a classifier and a dissector deems is important enough to filter on, they can provide the interface to filter. And so you really get the ability to, kind of, filter based on, if you're looking at the protocol based on what, or if you're looking at one application, you can really drill down and figure out which of those you want. But it really depends on which application and how much the classifier is exposed. Yeah. . Well, so in the example, his question was, how do you pull out the application-level data, like the username and password? And so the example that I used before about Reddit, the idea here is that you'd be able to filter and look for, say, a post request to Reddit.com because that's likely how the login details are going to be submitted. And once you've found that, if you open up the window with all the HTTP information, it will show you a table of all the parameters that were passed via post. And so you'll get a table that has username and the username and password and the password. But it's not... The goal isn't to provide, like, a way to look at all the traffic and say, oh, someone had username and, like, logged in with this username and password. But if you know what you're looking for, you should be able to find it immediately. Okay. I don't see anyone else. But if you have any other questions, feel free to email me or grab me afterwards.