Welcome to DEF CON. Let's do something crazy. Okay, that's the name of the talk. I was feeling really ballsy the first time I wrote it, and then I backed off. Here's our agenda. Here's what we're going to do. We're going to start very simple. We're going to cover some basics. So if you're really advanced and it's too easy, sit tight, because we're going to get some cool stuff on the third bullet. By the way, I don't read the slides to you, so I kind of assume everybody reads as well as I talk. So this is the story of a project that I did, because I was really interested in it. I spent about two and a half years on it. I got really interested in DNS tunnels, and what fascinated me about them is that you can look at a DNS tunnel and immediately pick it out. If you know that there's one there, you can immediately pick it out of DNS traffic. There's no mystery to it, and yet they work amazingly well everywhere because no one can find them. So what I wanted to do was automate that, that ability to just look at traffic and pick out a DNS tunnel. As I said, this is the story of that project. So this talks about a lot more than that, hopefully. So first of all, when I'm talking about AI, I'm not talking about anything fantastic. I'm talking about real AI, like what you see in video games, what you see in spam filters. Spam filters are an amazing application of AI. They work tremendously. They work tremendously well. And that's the kind of AI I'm talking about. I'm talking about getting a machine to make a sophisticated decision. So the decision in particular that we're going to try to make to pick out a DNS tunnel is classification. So to get our minds on how this AI works, we're actually going to talk about how your brain works a little bit. We're not going to talk about the internals, we're going to talk about the AI. Because that stuff's boring, and you don't need to know it to write AI applications. Okay, so if you see this picture, and I said, which is the apple, which is the orange, and which is the banana, most normal people would look at the red globe there and assign apple to that. Most people would look at the orange globe and assign an orange to that. They'd look at the yellow and assign a banana to that. So what did your brain do there? Here's kind of how your brain works. You looked at... I'm sorry. Let me start over. You thought about the real objects, like an apple, and you said, well, an apple's red, and it's delicious, and it's sweet, and it's crunchy, and it's round, okay? And then you thought, uh, three of those don't even matter, so you threw those three away, right? For that classification decision, we don't care what the apple tastes like, we don't care that it's crunchy, so you discarded those, and you took two traits, you took color and shape, and you assigned a weight to those, right? You said one of those is much more important than the other. So even if you didn't realize it, that's how your brain works. You took an abstract concept, right? And you pulled the weights and traits out of it. So we're going to talk about traits and weights a lot. So that was a really easy example, right? You only had a couple traits. Color, right? But here's actually one trait, we're still talking about color, but it's much more complex. Because what if we ask you to just tell me, um, when does green end, and when does blue start? Now that's a lot harder, right? Because everyone has a different opinion on that. So that's where thresholding comes in. So thresholds would be your personal threshold of when it turned, when it, when green becomes blue, right? So the whole point of this slide is really so I could, like, get a naked dude up on the screen at DEF CON, but it worked. So here's a really complicated class, classification decision, all right? When, which one is modern man? Well, people just debate this all the time, and we still can't decide, because there's, you know, hundreds or thousands of traits, right? And everyone assigns weights to those traits differently, and we still can't figure it out. Okay, so let's talk about neural nets for a minute. So there's a few key terms, and if you grasp these key terms, then you're good to go. Okay, nonlinear statistics. Statistical data modeling. Okay, so for our purposes in this room, nonlinear statistical, just think math, okay? Numbers. Data modeling. Okay, we're going to take something from real life, and we're going to model it. Pretty simple, right? So we're going to model something in math. Adaptive. So this is key. This is, this is really the point of the whole IDS project, is that it should learn. It has this ability to learn. It makes a mistake, you can tell it that was a mistake, it should go back and not make the same mistake again, okay? It can be used to model concept relationships between inputs and outputs. So it's got inputs, it's got to give outputs. Our inputs are going to be DNS packets. Our outputs will be, hey, I think this might be a DNS channel. So don't be scared of AI, because for whatever reason, if you're going to do firewalls, you go to the bookstore and you pick up a book on firewalls, and it's how to use firewalls. But if you want to use AI and you go to the bookstore and you pick up a book on AI, it's how to write your own AI. So if you're going to do firewalls, you go to the which is not useful for anyone, right? We're not going to do that. We're going to go use someone else's AI code. We're not going to do everything from scratch. So I used FAN, which is Fast Artificial Neural Network. It's fairly popular. It's C. So at that point, all the AI stuff's pretty much done, right? What I'm going to do at that point on is, is I'm going to pick my inputs, which are the traits. Remember we talked about traits? We're going to give them some values, right? Weights. Some traits are worth more than others. Then we're going to adapt our decisions until they give us the output that we want, right? So basically what that means is we're going to tell this neural network, learn to do what I want. And supervised learning is actually the AI term for what we're doing there. That means that we're going to give the neural network some answers so that it can crunch its numbers and know when it's right. That's how it's going to learn. So again, we're not going to go into the nuts and bolts of our artificial neural networks. That's boring. I hated it. So. And again, you don't need to know how they work. Go get someone else's artificial neural network package. The reason why the slides are so repetitive and verbose is because I tried to write slides that you could come back to later and learn the whole thing over again if you forget. So we're clicking along on the agenda. That's neural network basics. That's all you really need to know to write a neural network application. Okay. What's a DNS tunnel? So DNS is the domain name system. Its primary purpose is to assign IP addresses or to relate IP addresses to domain names. Okay. And DNS tunnels are such a problem because they're a covert channel that works anywhere. And even though this project is really about DNS tunnels, I'm hoping that audience members will see that there's a little bit more here than that. So let's walk through a real basic DNS tunnel. I don't know if anybody's... can see this from where you're at. But in the lower left-hand corner, we've got a host, and he makes a request. Who is data.badguy.com? And that request goes to his DNS server, and the DNS server says, I don't know who data.badguy.com is. Let me ask a root server. So that same request then gets passed to the root server. Root server says, I don't know either. Let me go ask badguy.com. Who's authoritative for that? So he goes to the actual authoritative badguy.com server. He sends a packet data.badguy.com. Badguy.com takes data off, right? That was the actual request. And then he can either just eat it if it's data exfiltration, or he can respond back with an IP address or a CNAME record or whatever for command and control tunnels. But as far as exfiltration goes, that's the gist of it. Everybody clear on that? Because we just explained that really fast. And if you've never heard it before, I want to make sure you get it. Okay. So key points are this. It basically gives you a high level way out of a network, right? We're just requesting things in an application layer, and they're magically delivered across the globe. We don't have to worry about routing. We don't really have to worry about firewalls. We don't have to worry about ports, IP addressing, none of it. It's all application layer, and it just magically happens. And then, of course, DNS requests that are not cached get routed. That seems pretty obvious. So this is just another verbose explanation of how to turn DNS requests into a tunnel. I'm not going to repeat it, unless you want me to. Okay. So now that we know what a tunnel is, here's a little bit of a takeaway. Like I said, there's a little bit more to this talk than just catching DNS tunnels. So IDS and IPS are signature-based almost everywhere, right? And I'm not saying that's broken, because we use it and it works. But it's not enough. And it hasn't been enough for a long time, and the returns it's giving are less and less every year, right? So almost everybody I know who does a lot of IDS or IPS work ends up looking at egress traffic. They spend a lot of time looking at egress traffic. What's leaving your network, right? Where are the tools to do that? I'll take your silence to me, and you can't find them either. Okay. So we spend a lot of time looking for DNS. We spend a lot of time looking for DNS. We spend a lot of time looking for egress command and control tunnels. We spend a lot of time looking for data exfiltration, right? And the reason for that is if someone gets into a network, they have to have a way to get out. Okay? So all we want to do for this specific project is block off one pathway out. Okay. So we've covered neural network basics. We've covered DNS tunnel basics. Let's do some fun stuff. So why use an artificial neural network to look for tunnels? I mean, what's the point, right? Why use AI? So I wanted to get away from packet counting, which is how most things work. Packet counting has very limited returns. It does work a little bit, but it doesn't give us really what we want. It doesn't give me what I wanted. I wanted to turn away from packets into traits, weights, and thresholds. And guess what? If you're using a neural network, all I have to worry about are traits. The neural network will self-adjust the weights. It will self-adjust thresholds during the learning phase. So all we have to do is come up with good traits, feed it to a neural network, give it an answer sheet so that it can learn what it's doing, right? Correctly. And it should do the rest itself. That's the adaptive abilities. So again, this is just to drive home the way it should work, right? Which is, let's say that we're feeding our neural network a bunch of DNS traffic, and it's not catching a DNS tunnel, okay? Well, when we discover it later, we pull the traits out of it, we refeed that to the neural network, and we say, hey, you missed one. It should automatically learn how to catch it the next time. It should not get fooled again. And we'll demo that here at the end. And of course, it's also to get us out of signature writing. Let's leave that to vendors. It's a chore. So this slide used to be really snotty. I was really fired up, and I was tearing into some vendors, and then I realized that may not be a very smart thing to do, so. This slide's been neutered quite a bit. All the IDS and IPS out there aren't very good at finding DNS tunnels. It's just not the vendor's fault. It's just how they work. And I don't see a fix to that. And then this last bullet is just something I wanted to address in the talk. And then this last bullet is just something I wanted to address in the talk. And that is, if you do searches on the web for artificially intelligent intrusion detection, you'll find a lot of papers and lots of projects. Okay. Those are mostly graduate school projects. They're terrible. They don't work. You'll find a lot of academics talking about it. But they make two big mistakes. Number one, they're too focused on packet counting. So they're packet counting, and then they're passing that to a neural network. But we don't need a neural network to do packet counting, right? We can do that with a bash script or a prl script or something like that. or something, right? So why involve artificial intelligence in that? And secondly on that matter, who cares if you get scanned? Who cares? Everybody gets scanned. The other thing that's wrong with their scheme is that they keep trying to come up with artificial intelligence schemes to look at the output of signature-based IDS. Well, again, if the signature-based IDS isn't catching what we're looking for, coming up with a new way to look at the output of the IDS box isn't going to help, right? There are some good research. There's one in particular where they came up with a neural network scheme to catch NUSHU. It's a pretty well-known paper. One of the problems with that is they don't release the details of their scheme, and they don't release their software, okay? So my scheme may be flawed, but I brought it to DEF CON, and I released it with software. Okay, so step one in our DNS IDS project. You've got to frame the question correctly, okay? So don't start out trying to tackle a big problem. You solve a little problem. And the problem that we want to get is, is this DNS request part of a tunnel, okay? That's pretty much all we care about. So if we were to take this and apply it to other exfiltration methods, like let's say we wanted to look at HTTP traffic. Is this HTTP? Is this HTTP? Is this HTTP traffic being used to exfiltrate data? That one's a lot harder. We're going to have to break that down into lots of different decisions. So we're probably going to have multiple neural networks making multiple decisions about the destination and about the content and all that kind of stuff. That one's hard. I chose DNS because it's fairly cut and dry. There's not a whole lot we have to consider. So again, all we care about, all we're asking this neural network to decide is, is this part of a tunnel or not? So we're going to pull traits, because we already talked about what traits. These are pretty straightforward for the most part to begin with, right? We're going to pull every domain name that goes past this. We're going to count how many packets to that domain. I know I just ripped packet counting and now I'm doing it. Let it go. Let it go. We're going to count the average length of the packets. So we're still just packet counting. That's not terribly useful. Average number of distinct characters in the lowest level domain. So let me address the lowest level domain right now. I use this term a lot because I like it and I think it's descriptive. I have been, I've been corrected on it before. I'm still going to keep using it. What I mean by lowest level domain is the piece of the domain name that is the furthest to the left. The opposite of the top level domain. I like the term lowest level domain to describe that. And there's still something missing, right? I mean, we're still, we're not doing a whole lot better than packet counting. We don't have enough. We've got to do better than that. I would bring a packet counter to DEF CON anyway, right? And so I was told there'd be no math. This is where it starts to get bad. So my original plan was that words have a lower entropy than data. And I was going to figure out a scheme to measure this entropy. And then we were going to feed that to a neural network and let it make some decision based on this computer science equation of entropy. And I spent a long time on that. And the slide exists because I think there's some value there, but I couldn't get it to work. So that's pretty much there for historical reasons. It is not in the proof of concept. Okay, so this is a money slide. If we have two groups of DNS requests, like we do here, a top and a bottom, okay? And I told you one of those is being used to exfiltrate data from a network. Which would you think it is? I mean, you would intuitively think it's the bottom one, right? . . It's not the top one. Why? I mean, what is your brain doing there? And why can't we get a machine to make that same decision? It shouldn't be that hard, right? So I thought about this for a long, long time. And you'll see what I came up with. By the way, why would you think that the top one is legitimate and the bottom one is not? It's rhetorical. You don't have to answer. And furthermore, if I give you a fourth, if I give you a fourth domain, request in the top group, okay? And it is also www.meanypants.com. You're going to be even more sure that that's not a DNS tunnel, right? Why are you more sure? What happened in your brain? If I give you a fourth request on the bottom, that is some random string, .meanypants.com, you become more sure that those are not legitimate. Why? Why? So what I really wanted, was some way to compare LLDs in the same domain to each other. I want to see the difference between the LLDs, right? Here, the first two requests are exactly the same, and so that's probably not being used to smuggle data. I mean, it could, right? Probably not, though. The bottom ones? Hmm, different call. They're very different. They could be used for lots of things, right? So how much is the first request, like the second request, like the third request? That's what you're... I think that's what your brain, is doing when you immediately look at that, and make a decision there. And if data is moving via a DNS tunnel, you should see the LLDs change a great deal. There should be a great deal of change between requests that were crossed. So let's stop thinking of them as LLDs, right? Let's stop thinking of them as strings, and let's start thinking of them as geometric structures, okay? So here's a two-dimensional graph of dog and cat, right? You can see that they're different, and we can measure the difference between the two words, okay? Everybody with me now? We can measure how different they are. The problem with this is that we're measuring the difference between letters. This has no concept of a set. It has no concept of words, right? We're just simply measuring the difference between letters. So that wasn't good enough. I tried this, by the way. Everything I've talked about in here, I tried until I got it to work. That failed. So we need something more complex. So we're going to skip ahead a slide. So we end up with this. This is what we're going to use, right? So half the room just got nauseous, and the other half just got horny. And whichever half you're in, that says a lot about you. But don't be scared of that, because that's actually pretty straightforward once we get there. Okay. So LLDs can only have a limited number of characters anyway. So says the RFC, right? Everybody follows RFCs, or most people try. So that really breaks it down to about 36 possible values, right? A through Z, 0 through 9, null, and then a few oddball characters. I'm actually throwing all the oddball characters out, because I don't need them. And we're actually going to do some multi-ordinal vector math. Okay. So this is simply a slide to explain how we're breaking down the LLDs letters into numbers. Okay? Because we're taking characters, and we're going to do math on them. And I found it difficult to understand that if you don't understand how we're turning them into numbers. We're basically going to normalize all the characters into a numeric scheme, and then apply this. Okay? So I didn't make this up. I didn't come up with this. This is Euclidean geometry. And I stumbled across this reading a college professor's web page on statistics. Okay? And what he was doing is he was giving surveys and then measuring the difference in responses. Right? How different are these two groups of people, and how do they respond? I was like, ah, that might work for what I want to do, because I want to measure the distance between words. Right? So what we have here is actually a comprehension of set. We're actually measuring the distance between sets of words or sets of letters, not just characters. So we're going to turn each character into a number. Okay? We're going to subtract the position of one string from the other. We're going to square that. We're going to sum all those up for every character in the request. And then we're going to take the square root of that. And that was hideous. Right? Anybody understand that? If you meditate on that for a while, it will make perfect sense. This is the textual explanation of what I just said. Again, it's the summed squared subtraction of each letter's numeric value. So we're comparing strings. This allows us to measure the distance between LLDs. So in Euclidean geometry, another word for distance is similarity and dissimilarity. So we're actually measuring how similar different DNS regions are. So let's go back to our DNS request slide for a second. Okay. So, WWW and WWW2 are not the same, but they're not that different. Right? Compared to the bottom three, which are radically different. We need to be able to capture that. Okay. Power of cheese. Here we go. So now we're measuring the difference between two LLDs. How different are they? How different is LLD1 from LLD3? We're measuring the difference of these domains as they roll past. And hopefully some white bulbs are going off. So that's our list of traits. Right? We're doing some packet counting. And then we're coming up with this numeric representation of how different each of the domain requests are from each other. We're going to train the neural network to do what we want. Define what we want. We're going to give it positive and negative examples. Then we're going to run it on real data, see what it finds. The beauty of using a neural network is any time we have a false negative, which IDS always has false negatives, right? We can data mine our traits out, add it to our configuration file, let the artificial neural network know that it's a false, false false, false positive, and say, relearn this so that you don't give me that bad answer again. There's a, if, if you get real into AI, there's some concepts called overfitting and underfitting. And basically what those mean is you've over, you've over-trained the neural network until it can't make very clear decisions. Okay? And I reached that point during the testing several times. And so when you do that, you just have to eat some false positives. And that's just, until a better AI guy comes along, which there's lots of them out there, we're just going to eat false positives. Okay. So here's the tool. DNS Tunnel Trap 0.9. It is proof of concept only. So don't email me and tell me how it didn't save your enterprise or whatever. It's POC only. But it is real code. It exists on the web. Right now you can go download it. I'm not speaking at a conference about something theoretical that you can't get your hands on. It does not sniff off the wire. Right? It's not real time. That's because it's proof of concept. So you go out with your T-speed dump and you capture some big chunks of DNS traffic. And then you're going to run it on that. Incidentally, while I'm thinking about it, um, and we'll address this later when we talk about Heyoka, um, it is asymmetrical. I only care about your outgoing DNS requests. I don't pay any attention to responses. We don't need them. Right? All we're doing is measuring the difference in outgoing DNS requests along with some packet counting. It has three major functions. Uh, find tunnels. Basically here's a PCAP file I captured. Tell me if there's any tunnels in it. Uh, new data creates a new training file entry. Training file is what the neural network learns off of. And train, which is to train or retrain the neural network. I'm going to push the demo until the end. We have plenty of time. I'm excited and I'm talking too fast. Okay. So how's it work? Um, it works. I didn't crunch, I didn't crunch stats. That's like the first thing a lot of hardcore guys ask me. They're like, oh, what are the stats? Like how old does it work? I, I don't know. It works. Um, right off the bat, it catches iDyne, Ozyman, and T-Speedy DNS. Those are what we're going to demo today. It's going to catch all three of those. Um, easy. Those, those are easy. And, and we'll talk about why. Um, to test this, I wrote my own, um, DNS exfiltration. And, I tried to make it a little bit harder to catch. All it did was grab, um, eight bytes of data, encode them, and then ship them out in a DNS request. It was exfiltration only. Didn't care about response. And I was able to tune the neural network down until it caught that every time without a false positive. That's on a small network, by the way. Because remember, we're, scalability's an issue here. Again, it only works on TCP dump files. And it only works on up to X domains at a time. I don't have any experience in real time programming if you hadn't figured that out by now. So that's why it's not real time. It doesn't sniff off the line. And it only works on X domains at a time. And that's because the programmer sucks. Okay, so, so I just listed the three DNS tunnels that it catches without problem. What about Heyoka? So if you don't know what Heyoka is, Heyoka was a DNS tunnel tool released this year. I think it's ShmooCon. I'm not really sure. And the authors of Heyoka did not release the tool. So I can't stand up here and say, oh, we put them head to head and here's how they did. We don't know. We have to guess. Um, the real feature, the two real features of Heyoka was that they figured out how to, how to smuggle some data out, additional data out. I'm not sure that matters for what I'm doing. And they're spoofing source addresses to get more data out and make it harder to catch. but again, remember that I don't even care about source address. We're not, this tool doesn't look at that. I'm looking at actual data, right? And we're comparing the difference in data. You can spoof all the source addresses you want. So my guess is that we would still be able to catch it. That's a guess. And again, um, what we're doing is completely asymmetrical. Um, we don't care about the data coming back in. So it works as well as you can tune it. And that's just the way of neural networks, right? So a good example of a pretty well tuned neural network would be, um, Gmail, spam filter. Not bad. Um, this is nowhere near that sophistication. I want to make sure everybody understands that. Um, you're able to tune, uh, super low false positive on a small network, right? Um, overfitting results and false negatives. That's the way of it. Um, so you can tune it down. Uh, you just have to accept some false positives. Um, hopefully, hopefully you can tune it better than I did. Lots of AI guys are better than me. So it does have a few weaknesses. There are some ways to defeat it. Uh, number one is don't use the LLD. Right? Because that's all I'm looking at. That's actually kind of crappy, because you're actually attacking my programming ability more than the theory. so I, I don't really give you any points for that one. Uh, and the other one is you can make tons of requests to multiple domains. So you can go register thousands of domains, and send each one, one request, and you get a thousand packets out, and obviously there's no way for me to measure the difference in different packets to, to the same domain, because you never made, uh, a request more than once to its same domain. That's not much of a victory, though, because DNS tunnels are bandwidth limited, and you'd be splitting it up into something even slower, I think. So this used to be just a complete jerk slide, and I lost my nerve and changed that too. Um, so the slides and the source can be found at minipants.com. Uh, don't call me minipants. You don't need to email me to tell me things that are wrong with it. I mean, unless you fixed them. Um, so I have no idea what I'm going to do with this. Um, I, I have no illusions of, of grandeur with it. Um, I'm not interested in patents. Everything I've done is public domain. You can take it. You can mess around with it. You can experiment on your own network. Um, improve it, hopefully. And then, uh, these are a list of, of folks who, who gave me some help along the way. Uh, just because their names here doesn't mean they endorsed the project. It just means they were, uh, helpful. And it does need a complete code rewrite. Of all the projects I've ever released, it, it is ironic that the one I am, the, the one that has code I am most ashamed of is the one I'm presenting at DEF CON. But, I don't think I'm alone in that. And then the last slide, um, is really just, you can, you can pull the slides online. This is, if you, if you saw this talk and you're like, wow, AI is not that hard and it's not beyond me because it's not, you can go write AI applications right now. Um, these are some good places to start. Um, Neurosolutions in particular makes a GUI on a neural network that allows you to see things and move it around. You'll really get to understand the guts of how a neural network works. And that is available on a trial like this. Um, Fuzzy Thinking should be required reading by Bart Cosco. Um, WEC is pretty useful too. So let's do a demo real quick. Show you that the tool does what I, what I, what I tell you it does. So when I practice with no audience, that was 45 minutes talk. And we just did it in 30 minutes. It's probably not too good. Okay. Do you guys see this decently well? It's just a command line tool. Sorry, there's, there's no cool GUI. I don't really even know how to do a GUI. I've never done one. Nor do I intend to. Okay. So, this is our configuration file. The first line is the number of examples we're going to give the neural network. Right? We're going to delete these to start with. And we're going to train our neural network on that initial data set. So it's trained. Now I'm going to say, show me, show me if there's any DNS tunnels in this sample off of, off of a small private network of iodine, which is a DNS tunnel. Example3.com might be a tunnel. It is in fact iodine. Okay. So that's not very impressive. Now let's say, show me, um, if this sample of Ozyman has a DNS tunnel in it. Oh, oh geez, it didn't find it. That's okay. So, the next step, is we're going to data mine out the correct values that we want of this example of Ozyman. And we're going to put that in our training file. We're going to adjust the training file a little bit. And we're going to give it a one because that is in fact a positive positive. We're going to retrain the neural networks. Hang with me here guys. That is boring, but hang with me. We're going to retrain the neural network. And we're going to say, okay, so I just gave you the answers. Now I'm going to show you the exact same network traffic. Now can you find a DNS tunnel in it? And it finds it right away. Well, that's not very impressive, right? Because we just gave it the answers. What if I show you a second example of Ozyman? You should be able to find it, right? I mean, the numbers should match up fairly well. You should be able to catch it. And it still does. So, that's an Ozyman sample. It's never seen before. But you can see how it learned. It adjusted. And it can catch stuff it hasn't seen before. Okay? So, what about a DNS tunnel that's never seen before entirely, right? Because we're going to, two examples of what a DNS tunnel looks like. From this point, it should be able to infer some things. Can you catch DNS to TCP without seeing it? Yes, we can. Right? So we've never seen it before. But it doesn't matter. Because we've adjusted our weights and thresholds to the limit where even stuff we've never seen before is going to trip it. Okay? Let's talk about false negatives for just a minute. So I've got a, I've got a, I've got a file here. And we're going to, we're going to tell it to go look at this file and see if there's any DNS tunnels in it. It comes up with two. It comes up with comcast.net and verizon.net. So we've looked at those and we've determined those are in fact not DNS tunnels. So it made a mistake. Right? False positives. We're going to do the same thing. We're going to data mine out what we want. And we're going to stick it in our configuration file. And we're going to give it a negative one for a false positive. This is all documented in the project by the way. We're going to retrain the DNS, the neural network. Not good. Live demos. There we go. That's what I wanted. That was not my fault by the way. Fan has its own bit of weirdness. So let's start to find it on the false positive file. Bang. Our false positives are gone. So what did it do? It readjusted its traits, it readjusted its weights and thresholds until those two domains are no longer tripping them. Okay. So there's one more thing I want to address here before we go. So if you go play around with the tool, sampling becomes very important. Okay. And the reason for that is because each of these is taken from a sample that was approximately as long as my attention span. Right? I'm doing a TZB dump and when I get bored I do a control C. And that's the sample that this came from. Right? Your results may vary. You should be building your own training file when you mess around with the project based on your own network and what you're trying to accomplish. So it comes with a stock default one. Don't expect much from that because it's not the same. So we blazed through that way fast. Any questions? Go ahead. . So the distance equation, . The distance equation is the third number in these series. So you can see the tunnels often have a much higher distance. However, these false positives also had a very high distance. Did I answer your question? . Right. No. So what that is, is we give our neural network all these inputs. Right? And it gives us a single numeric output, which is a likelihood of how close it matches. Okay? So inside my C source code, there's a judgment call where I said, okay, anything greater than .4. Anything greater than .4 is probably a tunnel. So output that. Right? So this example of Ozyman, it gave a likelihood of .89. It's over the threshold. You may have to adjust that as needed. Any other questions? . Can somebody up here shout his question up to me? I can't hear him. . Okay. Now let me just... . . . . . . . . . . . . . . . . . . artificial neural network internals. Okay, I got you. So this is actually done with a straight stock default fan configuration file, right? Fan is the neural network that I'm using. I'm using straight defaults. And at one point I got in there and messed around with those and I discovered I really didn't make the situation better. That's why I went back to just the straight stock fan configuration file. And it seems to work. Is that what you're looking for? Go ahead. Yes, it does, absolutely. Because it's adjusting thresholds. That's right. So at one point I took a lot of network dumps off of a really busy internet server and I started intermixing the output of that in with stuff off small networks and I ended up with kind of a kludge. So I really don't like to say that a neural network is learning your network because that sounds, right? But you do end up with some strange results by intermixing those types of things. Go ahead. Oh. He asked if we could run through the Euclidean equation real quick. Oh, his question was, can we run through the Euclidean equation really quick? By far that is like the most, I never imagined someone would ask like that kind of question. I got my life so much better now. My faith in humanity is restored. So we glossed over that pretty fast. I don't have an example ready, but so we've turned, we've turned every character into a number, right? So Comcast, or actually it's going to be, let's say apple.comcast versus orange.comcast. And we want to know how different they are, right? So we're going to take the numeric A and the numeric O and we're going to subtract the O from the A. We're going to square that. And then we're going to go on down the line, right? Substituting nulls for length mismatches. We're going to square that. We're going to sum all those and take the square root of it. That's the Euclidean. That's the Euclidean equation for similarity. That's, that's, that's probably the best I can do on the spot. So, okay. Yeah. Okay. Right. So here, here's one of the reasons why it's not real time. So you can only compare as many domains as you've saved, right? So every time I say, if I want to save a domain, if I want to do a comparison against it, I have to keep it. So, in the proof of concept, I'm only comparing against the last one I saw. I'm only keeping one and I'm comparing the one I have now to the last one I saw, right? It would work better if we kept more. But then we start to get into windowing issues and memory issues and I was not, at the time, I was not as interested in that. So, like if we're to make this a more fuller in your time, you know, do you think about putting all your requests that you've seen into some sort of database, like you could later do some sort of feature or something to reduce all the similarities for you and then come up with a better score? I don't know. I haven't got that far. Thanks for asking it. Yeah, it's a good question. I'm kind of hoping that, to me, this is, I've convinced myself this is clearly a better way to do IDS than signatures. And I'm kind of hoping that other people will ask these kinds of questions and then maybe we'll code that in the next version and it'll improve. Go ahead. In your comparison, the way you're looking at, for example, WWW versus WWW2, if, for example, I had bind and bind comparison, it's not going to seem very similar because you're doing it letter by letter. Is there any way you could perhaps get some sort of string within that? You should code that. Was that a volunteer? Go ahead. So unequal length, I just substituted in nulls. And at first I was like, oh, this will never work. But it actually seemed to work okay, so I went with it. You're only comparing it to the data itself. Is there any? I don't think so. We're comparing these two domains and I, you know, I worked on different schemes. And I don't think there's a lot of value in comparing domains against each other. It's mostly the same packets to the same domains. That's what we want to look at. I think that's what we want to look at. Go ahead. . are you a math guy it's awesome no it's awesome um um so the question was it was about why are we adding why are we doing the um comparison letter by letter right um the best answer i can give you is that this equation is supposed to take into account the entire set that's like the point of the equation so even though we're doing a letter by letter uh subtraction the equation is supposed to take into account the set if that's an insufficient answer i'm sorry um no those will come out as um different so we're just going to stick a null value at the end of apple right so those are going to come out um so so those are actually going to be the same until it gets to the last character and then it'll be different but the difference will be a small amount compared to apple and orange there will be a smaller amount of difference let me answer that agreed agreed um i didn't think of it go ahead no i didn't take case into account these are a lot of good questions good job oh i'm done they're kicking me thanks you guys