Okay, I'll start now then. I'm Ian Peters, I'm going to be talking about Rubicon, an extensive IDS. First about a bit about me and a look at what we're going to be doing. I until very recently was studying in London at Bureau College, now graduated, and this project was my final year degree project. It sort of started with Thomas Munn's presentation in DEFCON 9, in which he mentioned the idea of active IDS, basically an IDS which can route an integration of a firewall and an IDS. Now some of the problems I came across were, well, academia. They don't seem to like products. They like algorithms, that's cool, but actually trying to even let them do this was a bit of an arse. Now in about seven hours before I was due to leave, I was told that I was going to be studying at the University of London. I was due to present it, I had a head crash, and all my backups were screwed, so that was a bit of an issue, and test your backups if there's one thing you're going to learn today. So I rewrote it, and this presentation is primarily on version 2.8, as it were. There's a very bit, a little bit of background. Most of you can probably sleep through this bit. Firewalls, well, we all know what it does. Simple example, allow stuff out and replies, but stop the hackers coming in. There's stateless and stateful. You all know this. A couple of shortcomings, though. You can't understand upper-level traffic data, you know, things like HTTP. You can't filter on that most of the time. And similarly, you have issues with encrypted or tunneled traffic. And some of that I'm trying to address. A bit about proxies, that's, you know, firewalls which can handle it. They do a lot of work just via middle type effort. Now there's no such thing as 100% secure network, so you want to know when there's problems, you know, what's going on. And I know people say lots of the hackers are on the inside. I guess you guys will know that. So you want to know about what's going on. So you use an intrusion detection which gives you the information, which allows a human to look into it, respond, whatever. Host-based, running on the server. Network-based, looking at network traffic. This is primarily a network-based solution that I'm dealing with. A couple of patterns and a couple of different types and techniques mentioned in the previous, so I'll miss that. Two things which we've got to remember, false positives and false negatives. They do happen, and there's nothing we can do with it. RBSs currently can't stop an attack. That's a big problem with it. It's all right knowing about it six hours later, but by then your web server's down, half your systems have been rooted, so on and so forth. A lot of the traditional signature-based stuff can't detect a whole new attack. Now, if you're looking for a buffer overflow, somebody changes the shell code or the specific bit of the signature, you're screwed. And as mentioned, you can't have no false positives and negatives. So, one of the solutions, integrate a firewall and an RDS to our firewall-style filtering of RDS results. Packet comes in, you run your signature analysis, and it says, oh, buffer overflow. So, drop it. Or reroute it. Or whatever. By doing this, it means humans aren't involved, so it can happen straight away. And additionally, you can have some quite funky functionality. Hopefully, I'll cover that in a minute. Now, ways you could integrate, forging control packets, like TCP resets. Now, Snort does that. Quite a few RDSs are doing that. You could react based on the log outputs of the RDS, you know, using swatch, syslog, whatever. You could wrap firewalls. All outputs around RDS code, for example, hogwash, with Snort, basically does that. You can insert RDS facilities into a firewall. For example, NetFilter, you can take packets off into user space, do your RDS stuff there, return it back up to NetFilter IP tables, and it can then deal with the drop-in forwarding. Or, and this is what I did, fully integrate a bespoke solution. Current state of the art. Well, as I said, academia don't seem to be interested in products, especially not in the UK. That's a real shortfall in their part, I think. Hogwash already mentioned. A few others. Recently, GID's functionality has been added by several vendors. I started this project about October last year. A lot has changed since then, and that's one of the things I've really learned. RDS is a fast-moving area. Now, anyway, originally, it was all firewalls. Problems with integration, false positives. You don't want to go dropping everything from your upstream router. That would be a bad thing. Denial of service, same sort of thing. Or just hitting it with so much traffic, because don't forget, RDS stuff takes a lot of processing power. And finally, processing power and bandwidth. So, what am I going to do, or what have I done, daily art? The design was very modular, or supposed to be. Because the idea was, things change. We get new protocols all the time. We need to be able to modify quickly. For example, how hard is it to add IPX support to Snort? I've looked at it, and it looks quite hard. I don't know Snort that well on the inside. I'm sure some of you will correct me on that. I always start with an example of where this would be useful. And that helps me design it. So, basic firewall-type functionality. But how about, instead of blocking, just blocking straight away, based on, say, source IP address, or port, or whatever. How about we run the RDS on the input? Say it contains a buffer overflow, which we know from one of the different analyses which you could do. For example, the power matching. But you could easily do statistical, you could do protocol anomalies, so on and so forth. If there's a buffer overflow, or an attack, we reroute it transparently. To a honey-net. Rubicon can map to bridging, so the only thing which changes is delay time, or something. And then the hacker could then use your box to attack someone else, which you might get sued for. So how about we RDS the outbound, as well? And then, if it contains an attack, which we recognize, how about we then modify the packet to kill that attack? For example, standard buffer overflow. Your payload is shellcode and that. How about just... Changing the payload, just to nulls. It means that the attacker just thinks, oh, crap, it didn't work. Unless they're trying to hack their own box to test whether you've got Rubicon in place. There's nothing I can do about that. But they might just think, oh, it didn't work. Next. Meanwhile, you're getting information on who they're attacking, and what they're attacking with. And similarly, coming back. So from that, a few requirements. It must itself be secure. You don't want your box, your Rubicon box, getting hacked. And then everything falls apart at that point. It must be stable. Otherwise, I mean, it'll fail safe. But if you're on a really high bandwidth, important network, you don't want it to fail and block everything. Well, you don't want it to fail, full stop. And it must be able to handle the load. So a quick high-level design. Basically, on the left here, you've got all the different types of plug-in currently supported. Now, these are all connected via a central network. This is the root process. And on the right is the policy subsystem. That's actually run as a separate thread, for reasons I'll go into in a bit. Each of the dark black lines can be thought of as an interface between each part. Interfaces need APIs or similar to be designed. So the core loops contains a packet structure, which just wraps the packet and all the other data that's attached to it. One of those is a linked list of protocols. A protocol. A protocol is basically the decoded protocol header or whatever with a name. For example, Ethernet will point to the start of the Ethernet header, the length of the Ethernet header, and so on, and the payload. Normally, that's just a pointer into the actual packet itself. Otherwise, you'd copy and stuff, which is a bad thing. However, you might want to do RDS on decrypted SSL traffic. Now, just a quick digression here about SSL. Because I didn't know about this. Maybe that's just me. SSL works, you know, client-server, exchange a key, mess around with it a bit, and then use that from now on. A couple of different methods for that. RSA, where the client encrypts the session key with the service public, sends it off to the server, server decrypts, and then that's sorted. Or Diffie-Hellman, which uses combining logs. But I won't go into that. Now, if RSA is used, which you can normally set up, and the RDS has a copy of the server's public-private key pair, and what you can do is use, on your RDS, you can use a combination of a hacked-up version of SSLdom and OpenSSL to actually decrypt the traffic as it's going through, not performing the man-in-middle, anything like that. So that means that, say, for example, one thing which is being done a lot at the moment is hiding web attacks using SSL. Well, this would totally circumvent that. Quick look at the plug-ins. Everything has the plug-in interface, basically registration, initialization, and cleaning up at the end of the day. Four types of plug-in. Input, funnily enough, is input. Output's obvious. Analysis. And protocol. Rubicon, by default, does not have any support for any protocols. Instead, everything, Ethernet, IP, ATM, IPX, SONET, whatever, has a protocol plug-in. With a few different things. Decode, basically, is the one which produces the protocol linked list. Test is used for special tests, for example, to check whether checksums are valid. Print, for printing out, obviously, and make tests, whatever. Policy interface. On the internal, you've got a mutex shared pointer for the threads. Because compiling the policy from an intermediate language to the low-level representation is potentially processor-intensive. And you don't want that to affect your system. So, hence, a separate thread. On the external side, well, I haven't really written much that way, so I can't be arsed. High-level policy hasn't been implemented. I'm not interested in doing it. If anybody does, get in touch. Intermediate-level is XML. It's used, basically, to get around, well, some of the problems which occur with lower-level, you know, binary-type things. And the low-level is what's actually used. It's actually on the box, which I'll get into now. Intermediate. By ordering, et cetera, you don't have to worry about. It's human-readable and writable, which is good, because I haven't written a high-level policy, so I need to write the intermediate level by hand. I certainly don't want to be writing this by hand. And we want fast translation. So there's a one-to-one mapping, realistically, between the XML structure and the low-level structure. An example, XML. The low-level is a linked list, which I'm going to show you in a moment. Basically, a very large tree, which your process descends down and potentially back it up. Nodes are tests. Leaves are the outputs or whatever. For example, that's the, you know, generic linked list. So you'll start the policy head, go down to the first relevant protocol that you've decoded. Say, well, say Ethernet or whatever. Go along the matches, looking for the match on source address, that sort of thing. And if a match is made, it descends down the output chain. So test, test results, so on and so forth. More accurate example. Following this along, you go down, you hit Ethernet. So your source address is that one. Then you won't go down that drop EOF. EOF is basically, well, it's end of processing, so it should be EOP. And then you go back up, down, in. Into IP and through. Quick look at the plugins which have sort of been written. Because it's version two, they haven't totally been written. I've just been moving house. So that wiped out my Internet connection for two weeks. It's so hard to live without the Internet these days. LibPCAP, standard, everyone knows that. LibIPQ, that's for user space handling of packets from net filter, IP tables. So say you want to just phase your product in on a live network. Well, you could just have the odd packet or the odd set of rules sending into Rubicon from your net filter. So your network wouldn't really be affected if Rubicon screws up. One thing to notice about LibIPQ is it exports both the input and output plugin interfaces. Input to get the packet, output to tell LibIPQ or net filter what to do with it. Protocol, well, mentioned. Analysis. Basically, I pulled out the Snort matching. It was an old version of Snort. I think they've updated it recently. Basically, that gets initialized. In the XML policy, you can actually include Snort rules. So that gives some of the cross-platform compatibility I was looking for. It gets initialized with a load of rules and names. So, for example, you could use IIS and all the rules that you want to do IIS. And then any traffic sent to your web server. I'm not a Microsoft fan, by the way. I'm just using Windows for the hell of it. You could just run the IIS rules against the packet rather than having to run everything. Another nice one, well, personally, I think, Counter. So you can increment, decrement, set whatever values for as many user-defined variables as you want. And then you can test them. Always test them. So, say, for example, you only want so many FTP connections per hour. One thing, I'm trying to modify Counter so that you can do stuff on time as well. So reset every hour. Defrag, well, what can be said is defragmentation. Output, you've got the network outputs, same as any firewall. And you've got your log outputs, same as any IDS. The network, all provided by LibNet. It doesn't do masquerading yet. But you can do drop etc. It doesn't reject. Netmangling is the term I use for the modification of packets in LINE. You can modify any packet you want. Any header or payload is specifiable. You can't resize, though. Well, this isn't strictly true. You can't resize on anything which uses sequence numbering. If it's not using sequence numbering, then you've got nothing to worry about. And you can resize your packet. But currently, it just doesn't allow you to resize. All it allows you to do is just replace. Logging, well, all the standard stuff. I have a quick look at IDXP, which is an ID MEF. They're sort of cross-platform ideas for common logging formats or whatever. Doesn't really work yet. And that's not my fault. That's theirs. Right, now, conclusions. God, I'm racing through this. We'll always be on time. Well, because of the code review, there aren't any benchmarks available yet. But the old version of the code, basically, I only had a crap network at home. So I just banged away with a full, every single snort rule I could find. And it didn't drop anything at 8 megabits. And that was log into file. Just to make sure that everything was working correctly, I used both Rubicon and snort with identical rules to pass the sans 2000 log. Rubicon, a bit slow, but the output was identical. So I haven't screwed up too much there. Problems and limitations. Well, because of the way I've written it, accessing tunnel traffic is a real issue. I'm trying to say, when you're referring to IP, you know, IP source address, which IP source address? The one at the bottom or the one being tunneled? Bugs obviously need loads of work. The big thing. And this is one of the reasons I'm here, is there needs to be uptake. You need people testing any product. You know, every year at DEF CON, products are talked about. Some of them are quite good, some of them less so. I'll leave you to decide which this is. The fact of the matter is, if no one uses it, then good or bad, it'll just fall flat on its face. There have been some successes. It is very modular. It took me about two hours to write the TCP plugin. That's most of that. It's copy and pasting for printing and that sort of thing. It's very fast and very easy. It does do everything I always wanted to. At the time, it was unique functionality, the mangling. I believe Hogwash, I don't know if anybody can agree or disagree, Hogwash apparently can do this. Does it? Can you mangle packets now? I think that was a yes. Yeah. Okay. So, it wasn't that unique. But still. In theory, using automake and libtool and that, it's relatively cross-platform, although I haven't tested it that much. And as I said, it is very easy to develop for. Further work, as you can see, loads of different possibilities. This doesn't have to just be a security tool. Now, this is primarily for non-production use, although maybe it will scale up. But say, for example, you want to add quality of service to your network or load balance it. But because of the whole modular design. Then you can do that as well. A few conclusions on intrusion detection systems that I've come across, or made in my time. That we have to reduce false positives. We have to come up with new ways to do that. Now, academia is working on it. They are coming up with algorithms. I'm not that impressed most of the time. But I don't work that close in the area. We also need to pick up new attacks. Now, false positives picking up new attacks. They're working against each other here. We're starting to distribute analysis in that. I think 3Com is it? Produce NICs with firewalling capabilities. And apparently they can do IDS stuff in as well. I've heard today that that's quite crap though. Better correlation of the previous presentation actually covered that. Standardization. How are we supposed to communicate between different intrusion detection, firewall, etc. There's no standardization. There's so many vendors in the area now. And each of them seem to want to follow the Microsoft route. Yeah, let's follow the RFC. But change it. So, we need to sort that out. We're going to have to have more host-based juicer encryption. Okay, I can handle SSL. Maybe. Sometimes. And finally. I'm not sure about Snort. But I know certain of the IDSs out there have themselves got security flaws. And exploits their auth. And just because you've not got a portal open doesn't mean you can't be broken into. That's basically it. It was a very quick run-through. Hopefully there'll be questions. Otherwise, you've got enough time to go and get a drink. Yes? Sorry, I couldn't quite catch that. Do you want to grab the mic for a minute? Sorry, my hearing shot after a flight yesterday. Any plans to move it over to packet filter or IPF on FreeBSD and OpenBSD? Not especially. Most of the effort and plans at the moment are basically on just expanding what's here. Partly because I haven't got that much BSD experience. I'm primarily a sort of Linux person. However, if anyone's interested, then I would definitely be interested in doing that. Anyone else? Louise? Ah, yes, Louise. You were talking about the integration of IDS and firewall. Yeah. It sounds like you have one or two problems. Either you are doing pretty simply a fragment. And so, for anything other than email, you can produce, you know, unacceptable amount of latency. Yeah. And if you don't pull on the packet to fragment, by the time IDS ceases to pull apart and come out of the firewall, then people will do the other thing. Okay. And the question was, or comment, basically to do with defragmentation. What do we defragment? If we defrag everything, then we're going to do something else. If we don't have problems with latency, if we don't, then by the time we see stuff, it's already gone through. The answer is, that was the question pretty much here. The answer is, it's a configuration issue, surely. You defrag stuff which you don't think is an issue, and you allow frags through otherwise. This is, normally I'd say defrag everything. This isn't set for production sort of quality code. So, the latency introduced shouldn't be too much of an issue. Although, that's a potential denial of service problem. But that's the same with anything. There's very, there's realistically nothing you can do to get around that. One thing that just, well, it occurred to me a while back, but you could do protocol and packet shaping as it comes through. For example, fragments, okay, common way to get around intrusion section systems, overlapping fragments. Well, what we could do is remove that overlap. Because overlapping fragments, it's breaking the RCs anyway. So, by removing that overlap and resizing one or the other, and that, again, is a configuration issue. Then you can get rid of that particular problem. Yes, sir? . Right, again, that's currently, although I'm thinking about involving some sort of stop list. Sorry, the question was, how does Rubicon handle, like, spoof attacks and things like that, yeah? Again, it's a configuration issue. I'm considering looking into stop lists. So, you know, do not ever drop these IP addresses. However, if you think about it, you can involve that in your rules. So, that's more of a configuration issue than anything. Anyone else? No? Okay. Thank you for listening, and go and get a drink.