All right, and this is the network defense room, in case any of you guys are lost. All right, I'll wait a couple minutes and let everyone filter on in. All right, I'll go ahead and get started. I'm Drew Hintz. I'm going to be presenting on covert channels and TCP and IP headers. My email address is up there. Feel free to email me with any questions. My website is up there, pretty easy to move. It's go.new, like the pronunciation for GNU. So go ahead and get started. A brief overview of what I'm going to be talking about today. First of all, who are you? Why might you have a need for covert channels now or at some point in the future? Who are they? Who are your adversaries? Who are you trying to avoid by using them? I'm going to give a few quick definitions, talk about... a couple different classifications of covert channels. Then I'm going to go into an analysis of a few covert channels in TCP and IP headers. Then I'm going to talk briefly about an attack against a timestamp covert channel and how you can detect that it's being used. Then I'm going to talk briefly about detecting and preventing covert channels, as if you're someone that didn't want this hidden path of communication in your network. And then I'm going to go ahead and talk a little bit about a tool that I'm going to be releasing today. That lets you, using Linux, use all of these, or use some of these covert channels to actually communicate and send data. So first of all, who are you? Why might you actually care about covert channels? Why might you actually use them at some point? So you say, well, I need to communicate securely. I'll just encrypt everything. You know, you just sort of apply cryptography. Everything's great. But sometimes that's not the complete solution. Maybe encryption's either outlawed or maybe there's mandatory key escrow. And if you don't know what that is, you don't know what it is. What a mandatory key escrow is, it's where you have to give a third party or give someone a copy of your private keys so that they can encrypt your information if they have to do an investigation of some sort. There was some talk of this in the U.S. with Clipper and Forteza and all sorts of fun stuff. In the U.K., even, I guess a few years ago, voted down some mandatory key escrow stuff. But even still to this day, if, for example, the police were to capture your hard drive, they could subpoena your keys from you in order to make you turn them over so that they could see what was on there. And also in other situations, in other form of covert channels, you might not want to let anyone know that you're communicating with someone. For example, if you're in jail and you, if you're in China and you want to communicate with some known dissidents and you knew the government was watching these dissidents and looking for who they're communicating with or who they wanted to watch, then you probably wouldn't want to let them know that you wanted to communicate with them. Other things, your employer might not want you going to certain websites or might not want you talking to certain people. And also, say you were some sort of evil hacksaw and you wanted to maliciously control some Trojans or some DDoS tools or something like that, you wouldn't want to let people know that you were the one controlling it, so you'd want to obscure your path of communication with them somehow. And so now, what are you up against? Well, first of all, probably just a casual observer. Maybe someone who's trying to watch everyone, someone who has some sort of IDS. Maybe this is your network admin at work. Maybe it's the government watching everyone's traffic out there. Who knows? But probably the system that they would use is some sort of automated system that would look for keywords, similar to maybe a signature-based intrusion detection system, something like that, looking for sort of weird behavior traffic that was easy to detect. In this sort of scenario, they would probably only be able to keep a very minimal state on what was going on. They might be able to keep state on your individual TCP connection, but not your past thousand TCP connections, and probably not even that much information on you individually. However, maybe you're up against a dedicated observer. Maybe someone is honing in on you, and they're watching you specifically. Maybe, as an example before, you are one of these dissidents that's being watched by a government or something, and they want to see everything that you're doing and recording every packet that you're sending out, every bit, and they're analyzing as much as they can. They have a team of people looking at it, and yet you still want to be able to evade them. To evade them. In this sort of scenario, they have a lot of resources, and they can watch everything. So... So, going along with the two ideas, or with the idea of what you're up against, is how much protection do you actually need? You could perhaps probably be semi-covert and try to fool a casual observer. You could use unusual traffic that, if they looked at it, they would notice it was weird, but hopefully they're not going to look at it. Hopefully they're only going to look at what's pre-dyed and some real secure that they go and buy. And doing this would require just a low to moderate amount of work on the behalf of someone trying to find out if you're using the right data. At that point, they just wanna do it. And maybe they just wanna go off and do it, because you're using this channel. And so now a truly . Theoretically, it would have been really difficult for anyone to detect that you were using it. Now, this is a model you might be using, even if they had read all the covert channel papers out there and had implementations of all the . You're asking it, can be pretty much theoretical underlying cryptography below it. And hopefully they're able to understand what's going on. they can't do that, and say they could even break the cryptography, they would have to know where to look for the cryptography to throw it through their big cracking machines and try to crack it. So, all of this, so wait, what is it? It's dropping a microphone. Alright, so... Can you guys still hear me? No. Probably because it got turned off. Is that better? A little bit? No? Something like that? Does that mean better? Better? Alright. So, what is a covert channel exactly? I'm talking about why you might need them, but what are they? So, kind of two ways that I've kind of classified them is communicating extra information to a host when you're allowed to communicate with that host. Say you're allowed to go to, you're allowed to talk to your friend by but everything has to be in plain text and people are allowed to watch you, but you want to send them something secret. Another type is hiding the fact that you're even communicating with a host. This would be examples like if you were controlling a group of distributed Trojans or something like that and you didn't want anyone to be able to trace you back to that communication. So now first we'll get extra communication to a host. This is when you want to hide the fact perhaps that you're encrypting data because if you're allowed to communicate with them, you could just send them the encrypted data. But let's say you're not allowed to. If you don't want Kioskro to come into play or it's outlawed or it would raise too many eyebrows. So basically what you do is you send them some sort of normal data. Like you would normally send Bob some FTP file or something, but then you subtly alter it or you subtly alter parts of it so that there's some sort of covert message going outbound in the traffic. The receiver then grabs the traffic as normal. It looks like normal traffic. You can even use it as he normally would. And then analyzes the traffic and then pulls the message out of there. So in this case, if someone were looking at it, hopefully a casual observer or some sort of observer would just see a normal communication going on, some sort of daily thing you were doing anyways. And so they wouldn't think anything of it. This draws a lot of ties to steganography. They're kind of the same sort of thing. Steganography is simply the art of hiding information or something like that. So you could send someone, in a classic example, send someone a JPEG or something and then you would simply modulate your message in the world. So that it wouldn't actually alter the picture that you were seeing, at least significantly, but your message would still be encoded in there. So how can you find a good covert channel that you actually want to use in this manner for tacking on extra information? In everything that we do, there's always some sort of randomness that's going on. And you need to try to find this randomness and then replace it with your own carefully chosen randomness. For example, some random places you would look could find initial sequence numbers. If they're good and secure against hijacking and TCP spoofing and all that stuff, then they should be generated randomly, or at least pretty randomly. Also, complex timing of network transmissions. It'd be pretty hard to analyze and see exactly when your kernel is going to spew out certain packets or when it's going to do things. And so you could use that as a source of randomness that you want to replace with your own data. And in this, the random data that you see, you're replacing with your own quote random data. And the random data, you can call it your own random data because it's encrypted. And a good property of encrypted data is that it's random, at least with typical encryption. So a simple example that I've kind of described. Say you're Alice and you want to send a secret message to Bob. Say periodically, say you just went on a vacation or something and you took a whole bunch of pictures and say you want to send them to Bob. So you hop on Bob's FTP server and you send him the pictures and Bob gets them and looks at them. And that's what sort of an attacker might see. But let's say also subtly in there is that for each TCP segment that you threw out there, that you threw to Bob's FTP server, is that you start encoding your hidden message in the padding of the TCP header. And an observer looking at this hopefully wouldn't notice that the padding wasn't zero as it normally is in a communication, but it was actually some sort of data. But Bob would know, hopefully you already communicated to him to record all this traffic, and to look at it. And then he would know to look for the secret message hidden in the padding. And so now let's talk a little bit about unseen path of communication, kind of traceability if you want to. And you use this when you don't want your association with the node to be known. You don't want it to be known that you're actually communicating with this host out there. For example, things you've already mentioned, if you want to communicate with a closely scrutinized node, someone that you don't really want to be associated with, if you're going to be accessing forbidden material, for example, say you're in some country that considers certain things dissident, like if you were in China during certain periods when they considered cnn.com to be dissident material, and so they blocked it at their firewalls, and they wouldn't want you to access it. But let's say you wanted to access it now, even though they still might consider it dissident, but they're not going to flat out block it, then you would want to be able to not show that there's any communication between you and CNN. And of course you could also use this for malicious activity and preventing law enforcement from doing it. Tracing you back or whatever you would want. Not that I'm advocating it or anything. In order to do this, you would pretty much use another node or another set of nodes to relay information for you. Perhaps these nodes know that they're relaying information for you, perhaps they don't. Perhaps they've been set up beforehand and purposely designed to relay information for you in a good and secure manner. So how would you look for a channel like this? Or what would you look for in a good channel? Something like this. If you're using a node to forward your traffic on, you would want to make that node pretty hard to monitor. For example, say you were... Say like a real life example or something. Say you were someone in the US and you wanted to communicate with some mafia boss in the US. You might send your message off to someone in Romania who would then hold onto it for a while where perhaps the police aren't as vigilant in Romania. They're not watching as much stuff. So they wouldn't be watching this guy's mail. Then he would take it and eventually send it back to some mafia boss in the US. And if the US was just able to watch the US mail, then they wouldn't notice that you sent some message to the mafia boss. And so in this case, the node would be hard to monitor and that the US government, it would be much harder for them to go and monitor this Romanian node. Another attribute you'd want is that you have to kind of trust this node that you're using. You trust that this person in Romania isn't going to go blab out to the US government that they're forwarding messages for you. And that's something that you need to be concerned with in the electronic world also. Because trust is even harder to establish there. And it is possible, though, even if all networks are being watched, to actually afford yourself protection. Not necessarily if all nodes are corrupt. That's another story. But if everything is being watched. And there are methods that you could do this using mixes. And basically a mix is where you have a whole bunch of, say, middlemen or Romanian people. You send it off to one of them and then they forward it on to someone else and they forward it on to someone else. But each time they get a letter from you, you also provide this service to a lot of people. So they receive a lot of different letters from people. Perhaps they build up and they wait until they have 100 letters in their hand. Then they take those letters, they mix them up, and then they send them out in a random order to where they're supposed to go. So if someone were watching that node, they would see that you communicated with this person, this middleman, this mix, along with 99 other people, and then eventually this mix communicated with 100 other people. And so they would be able to say, someone in this 100 person group is trying to communicate with someone else in this 100 target group. And if you had several layers of this, it would grow exponentially as to your space of different possible communications. If you just had five layers with 100 people entering each layer, it would get pretty complex pretty fast. Another idea, or another method that's out there, and by the way, the mix thing, this sort of thing has been implemented with re-mailers such as MixMinion. And I think Roger presented here, I guess yesterday or the day before, talking about MixMinion. So hopefully you went to that and you know what I'm talking about already and I'm just boring you. But onion routing is another method where basically you use encryption to wrap your data in multiple layers. And that's where the onion term comes from. And so you basically get a list. Say you have five nodes that you want to relay your information for. The final node that's going to get the data, you first encrypt it with their public key. So only they can open it. Then you go up one node before that, encrypt it, with that node's public key, and so on and so forth, until you have sort of these five shells of encryption in there. And each node can only remove one shell. And so first of all, you send it off to the node that has the key for the outermost shell. They then rip it off, and then they forward it on to the next person. And so on and so forth. And no one can actually, no one that gets it early on can tell what data you're transmitting or who your eventual target is. Whereas people towards the end are very far away from you as the originator of the information. So they can't trace it back if they're corrupt. And there's an actual project out there called the Onion Writing Project. I think it was started at some naval research labs. At some point it's going on. And also on top of sort of using nodes just to forward information for you, you could also use some of the earlier methods and earlier classification to obscure the fact that this node was even getting information to pass on or passing on information. In any respect. So an example of this, we kind of talked about a few real world ones. This is kind of a timing one. So say Alice and Bob are allowed to make, both make requests to some web server. Say they're in some country where they're heavily scrutinized and Alice doesn't want it to be known that she's communicating with Bob. Let's say they're both allowed to access some local news site which doesn't have very much bandwidth, a small server that's not very powerful. So what Alice does is whenever she wants to transmit a one to Bob, is she makes tons and tons of requests to the web server. Hits it really hard so that this performance will degrade. If Bob made a request also to that web server, he would notice that it lagged a lot or several requests would notice that it tended to have a high latency and he slowed this, the plan with this information. Then whenever Alice wanted to transmit a zero, she would simply not make heavy requests to this web server. And then whenever Bob made a request to this web server, it would come back much faster. And of course this assumes that, at least, Alice and Bob have enough bandwidth to significantly alter the state of the web server. So you're probably not going to have any luck doing it to CNN.com. But you might to some little local server that's close to you. So now, if you have a covert channel, what are the sort of properties that you want to look at? What do you actually want to evaluate in it? First of all, you probably want to look at the bandwidth. Because that's kind of the whole purpose of it, is to transmit information in a certain amount of time in a certain amount of things. I know some of you here don't know about bandwidth in terms of bits per second or something like that. But in covert channels, you often run into things like bits per TCP connection or bits per packet, things like that. Another thing you want to look at is ease of detection. We've already talked about this some, with how easy to detect, how much prevention do you need. And there's always sort of a trade-off here between bandwidth and how covert you're going to be. Another thing is permissibility. How often will it actually go through your network? If you start sending out illegal stuff, stuff that's just random and weird, sometimes networks will filter it or rewrite it and destroy your covert channel. Another thing is how hard is it to prevent? Say this stuff starts becoming commonplace and everyone starts using it, how hard would it be for network administrators, how costly would it be for them to restrict these covert channels, to limit their bandwidth significantly so that they became unusable? Another issue is how hard is it to implement? You have all these great ideas and all these covert channels which people have known about, but up until this point, there haven't really been good implementations that kind of brought all of them together in a usable package. Except for some of the end-to-end communication where you obscure the path you're actually communicating. And what special cases or restrictions are there that are out there that you have to keep in mind when you're using the channel so that you don't misuse it and get yourself killed or something? So what are we going to look at today? I'm going to look at extra communication covert channels because they might be useful in case encryption is restricted or outlawed or you don't want to get your keys subpoenaed by some court somewhere. I'm not going to look too much at hidden path communication because there's been a lot of good work in there with onion writing mixes and things like that. And we're going to focus on TCP IP headers because they're pretty universal. TCP IP is flowing out all around there. And also, by just using the headers, you're able to piggyback onto legitimate traffic. As in the FTP example, you don't have to somehow magically make up pictures to send. You simply use traffic that you're sending anyways and piggyback on top of that in the header. So the first one to look at, a very simple example, is using the TCP urgent pointer. And the urgent pointer is a thing, is a part of the TCP header. There are kind of two components to it. One is a TCP urgent pointer control bit. And right there next to and . And this says, hey, look, there's an urgent pointer that you should pay attention to. What the urgent pointer itself is is it's a sequence pointer of this number, which points just beyond the last bit of urgent data. And this isn't actually used too often anymore, or, I don't know, maybe not at all. But the urgent pointer is only supposed to be interpreted if that urgent control bit is set. So what you could do is simply not set the urgent control bit, yet stuff data into the urgent pointer. Pretty easy to do. However, someone might, you know, one thing you could also keep in mind is to, the urgent pointer actually has to point to some data. So it has to be somewhere near the sequence numbers that you're using. So perhaps you want to make sure that the urgent pointer could be pointing or could be near data and sequence numbers that are actually in the TCP session. So now let's look at some of the properties of it. It's kind of an exercise. Really good bandwidth for a covert channel. 16 bits per TCP segment. It might not sound like a lot, but it's quite a bit for a covert channel. And it'd be much less if you tried to restrict what the urgent pointer could be, so it looked a little bit more reasonable. How hard is this to detect? It's pretty easy to detect. The urgent pointer is rarely used, and it should especially never be set or used if the control bit isn't set. It's just supposed to be all zeros and not even supposed to be paid attention to. And also you could start to look at and make sure the urgent pointer actually was somewhere pointing to some sequence data if you actually started setting the urgent control bit to try to make it appear a little bit more stealthy. How hard would this be to prevent? Moderately easy. You can make it moderately easy if you just examine each urgent bit, each urgent control bit, and whenever there wasn't one, rewrite the urgent filter, rewrite the urgent pointer so that it was all nulls. If you want to just flat out rewrite it, that would just make it easier, and you could just do that statically. A few other things. Permissibility. Currently this will pass through pretty much everything. Firewalls and normalizers will of course look at the urgent pointer and see that the control bit isn't set, see that there's something anomalous going on, rewrite it for you, back to all zeros and then it's gone. How hard is this to implement? It's really easy. You just stuff bits in there as it's going out. In a special case, you of course can't use the urgent pointer when you're using the urgent pointer legitimately, but this really doesn't happen too often. So it's not something you'd have to worry about. Going along with the urgent pointer, you have padding and reserved bits. Similar to the urgent example, they start to break protocol and they start to do things that no TCP stack would ever do. They're lower bandwidth simply because they're typically fewer bits, but you could of course combine this with the urgent pointer into one thing and use that. The padding would be easy to detect because it's almost always set to zeros, just as the reserved bits would be really easy to detect because they should always be zeros unless your TCP stack is misbehaving. And some routers may start to drop packets if the bits are set because they just see them and they see that they're just bogus and they should never be like that. And sometimes they also rewrite the padding for you, especially if they start messing around with some of the options and adding their own options or stripping on that. Another code channel that you could use in the header is just using the IP type of service. The IP type of service, in case you're not familiar with it, indicates sort of the quality of service that you're requesting from the network that your data is going to be flowing out on. Like precedence, delay, throughput, reliability, and then of course they have some reserved bits. So all you do is you just set the type of service byte to your data and send it on through. But if you want to be a little bit more stealthy, the delay bit in the type of service is actually used by, say, SSH whenever you're sending over keystrokes. So if someone were to shift through it, they couldn't just look for delay bits being set because they're actually used legitimately. So the bandwidth of this, if you're using the entire type of service field, then it's one byte per IP datagram, which is pretty good. If you don't and you only use the delay bit or you only maybe use the delay and reliability bit or something like that, then you would get one bit or two bits or however many bits of the type of service field you actually wanted to use. And detection would be really easy if you were using the entire type of service field because you're never supposed to use it all, especially the reserved bits. And very rarely are most of them actually used, especially the precedence ones. However, if you use the delay bit, it becomes moderately difficult to actually detect because someone couldn't simply shift through and look for delay bits being set. They'd have to keep track of you. They'd have to look for you using a lot of delay bits in your transmissions, perhaps in non-standard ports that the programs typically didn't use, the delay bits. And they could also look at it and see that if you're just stuffing encrypted data directly into the delay bit that you somehow had a perfectly even distribution of delay bits being set and delay bits being not beset. Because in this case, you're taking some not very random data and replacing it with really random data. And so that would be something that would be detectable. Also, provisibility. It'll pass through pretty much everything, especially if you just set the delay bit because that's something that is used and people pass on all the time. Prevention. It would be pretty easy to prevent. You could simply just write out the delay bits to zero whenever any packet came through you statically. This could slightly alter how you're actually providing service, but no one would probably notice, no one would probably complain. How hard would this be to implement? It'd be really easy. You just stuff the bits into the type of service field and you're done. Special cases, once again, it could simply alter the traffic, but probably not noticeably, or at least not enough to care about. Another type, the initial sequence number Sequence numbers are used as an index into the data that TCP is transmitting. There's a unique sequence number for every bit of data that's being transmitted out there. From some earlier security stuff, the initial sequence number should be randomly chosen to prevent TCP hijacking or TCP spoofing so you can't pretend that you're actually getting packets being sent back to a host. So you want to choose your initial sequence numbers to be the message that you want to send in order to transmit. So normally, your kernel or your TCP stack or whatever would somehow randomly choose a random value to throw and to use for the initial sequence number. So all you have to do is go in there and replace that function with your function that transmits the data for you and stuff your data into that field and have the receiver get it. So bandwidth. This is pretty low. It's only 32 bits per TCP connection. Of course, this is really dependent on what sort of you're piggybacking this on. If you're piggybacking it on one huge TCP transmission, you're only going to get 32 bytes or maybe 64, however many if you're just in an FTP session. You generally don't make that many separate TCP connections. Let's say we piggybacked it onto a web server request where you hit the page and you downloaded maybe 40 images. You typically make separate TCP sessions for each of those 40 images and all of a sudden you'd have 40 times 32 bits just for that one request, which isn't too bad. The solution for something like this would be quote impossible in that they would expect purely random data to be coming for initial sequence numbers and you'd be giving it purely random data. So just by looking at the network they wouldn't be able to tell. Preventing this would be fairly difficult. They'd have to start proxying all of your TCP connections and keeping state on every TCP connection which some proxy servers will do but that's more sort of a local thing rather than permissibility. It's typically passed on through except for some proxies like Ed said. Difficulty of implementing? Pretty easy. You just go and grab that function and replace it with the one that sends your data. Special cases. Some operating systems like Windows 95 definitely don't transmit random initial sequence numbers. They do sequential ones. Who would have thought? But as long as you're using a real operating system like some Unix variant then you should be pretty fine with doing that. There was even I think on Slash that a couple weeks ago someone put a paper up in a study analyzing the randomness in different initial sequence number generations and ended up working on improving the ones on Linux. And I think the BSD ones came out the best. Another technique is to modulate the TCP timestamp options a little bit. And the TCP timestamp is simply just a TCP option that marks the time that this packet was sent out. And this method was presented earlier this spring at Privacy Enhancing Technologies 2002 which was right before CFP. And at low bandwidths the low bit on a TCP timestamp is going to be random. So if you were just communicating with someone the timestamps that were flowing out through you if you had a slow connection like say a modem or something they'd appear pretty much random. If you had a high speed connection though they're definitely not going to be random because the timestamp counter gets incremented, I think in Linux it's once every millisecond or something like that. And so if you're sending out packets faster than once per millisecond then you're going to see lots of repeats. So the bandwidth for this sort of transmission would be pretty low, one bit per TCP segment. Not too bad. Detection for this sort of thing would be very difficult if you were on a low bandwidth connection. Because the bits are pretty random to begin with and granted you're placing them with really random data but there are things you can do to prevent that. Prevention from an administrator's point of view it'd be pretty easy to do this you could pretty much just disallow the TCP timestamp option and rewrite the header and just get rid of it. Permissibility pretty much everyone seems to allow TCP timestamps through. How hard is this for you to implement? It doesn't sound too difficult but there are a few subtle things to keep in mind. You're twiddling with the low bit the TCP timestamp time's chronological so your timestamps should be monotonically increasing. So in order to do this say your timestamp ended in a one but you wanted to flip it down to a zero you're kind of jumping back in time so instead what you have to do is you have to wait until the timestamp rolls up to a zero which in Linux is referred to as one jiffy so you have to wait one jiffy for the timestamp to roll up and doing that you delay the packets you delay that one packet by one jiffy in which case if you're on a high connection the packets would build up and this packet would be delayed as would all the ones behind it they would also be delayed if you're on a slow connection you wouldn't have that problem because you probably wouldn't have any packets sort of backed up waiting to go that would actually be affected by that. So how could you detect the timestamp on a fast connection? When you're on a fast connection you're going to have to the Cobra channel will slow the transmission of the TCP segments down to a fixed rate and it's fixed in that or it converges to a fixed rate because you're assuming that you're transmitting uniformly ones and zeros because you're transmitting encrypted information which doesn't seem to have any sort of pattern to it. So an algorithm you could use to detect this is to look at a host and start counting the number of different values of timestamps that he sends in a certain amount of time and while you're doing that also count the total number of timestamps. So you're essentially counting sort of the number of times that he repeats timestamps or doesn't repeat timestamps. Then you take the ratio of the total timestamps that were used over the different timestamps that were used and you get a ratio. And the ratio, if you're using this Cobra channel unmodified, will converge to about 1.94. That's not from any math or anything, just from actually going out there and doing it. So how could you actually and if you're doing it on a fast connection like, I guess as fast pretty fast as you could get, you know two or more machines communicating and hosting the networking, it'll reach up to about a ratio of 20 or something like that. However, if naturally your ratio is less than 1.94, then it's not going to be slowed down at all and therefore it becomes, you can't use this method to detect it. So how could you prevent someone from detecting you if you're using this method on a fast network? Well, since it's slowing it down to sort of a fixed rate, how about you slow it down a little bit more? And that little bit more make it a somewhat random value. So now you're slowing it down by a random amount, maybe every connection, maybe every once in a while you change it to sort of model your computer might be busy or something so it might be being a little bit slower than it normally would. And doing this prevents the attack. Of course it would still be detectable that you were slowing it down and that you were slowing down your transmission which would be something fairly anomalous to begin with but it could happen if your server was busy doing something else. So also, how could you detect the timestamp covert channel on a very slow connection? So in a slow connection, the low bit bits appear pretty much random. I said earlier. However, when you inject this encrypted data into the low bit it becomes more random than it normally is. So what you basically have to do is look for this increase in randomness in doing this. So what you could do is just get a whole bunch of TCP just record a whole bunch of TCP timestamp low bits from the person and then put it through a randomness test to see whether it was truly random or not truly random but, you know, really random as much as they could tell. And there are quite a few tests on the internet, you can just go and download and throw this up. And if the program comes back and spits it back and says yes, these bits are really random then the covert channel is most likely being used. However, if it comes back and spits it back and says these bits aren't very random, then you can probably guess that they're not using the covert channel based on its unmodified form. And so in order to prevent this you could try looking at transmitting some data that wouldn't appear to be completely random by using some sort of encoding schemes. And so now, detection and prevention of covert channels in general. So first of all, detection. For some of the semi-covert stuff try to just detect anomalous traffic. Snort has some of this stuff where you could look for invalid things like invalid checksums and things like that. I'm sort of working a little bit on just a Snort prepack that would look for bad things like bad-reserved bits and bad things in combination and try to correlate some of them together and keep state for TCP sessions. How could you prevent this? You could perform normalization in your traffic. If you think, and normalization is basically getting traffic in from somewhere, taking it, doing something to it, to make it the way you think it should look. Use often whenever people are worried about Fragout or something evading their IDSs so they want to take it and defragment all their data desegment all their data so they get to decide how the overlaps are handled and all that sort of stuff. And you could apply this in pretty much the same way. By taking it and stripping out type of service bits stripping out urgent bits, things like that that you know your network doesn't really need. And there's some programs out there that can do this. Norm is one I think it's written by Vern Paxson but I'm not sure. BSD's packet filter. And then there's also a more advanced method like with the timing channel stuff. If someone was attempting to communicate by using timing, like there was a whole bunch of requests and then not a few, not many and then a whole bunch and then not many. You could use a pump method where basically your router or something collects a whole bunch of data for a while and then sends it all out in a burst. Kind of like it fills it up and then empties out the queue right away. Granted this costs a lot of resources but it can help to prevent that sort of stuff but that's more of a theoretical type thing. And one thing to keep in mind is that you can't close all covert channels. If you're letting someone communicate data back and forth they can get covert data through. All you can hope to do is decrease the bandwidth and increase the difficulty of actually using covert channels to the point where it becomes infeasible. So now a few implementation issues if you actually were to try to go out and implement these covert channels. First of all, you need to have encryption in there at some level. Otherwise the quote randomness that you're stuffing back in aren't going to be very random. You need to have some way of telling whether the data is transmitted or not. You need to be able to index into the data and say what data is being transmitted. And then of course you have to consider the age-old issue of reliability versus bandwidth. So now first of all, encryption is a key component. You have to use good encryption in order to ensure that all these channels are secure. If your encryption is flawed somehow, say you're doing something like some shift cipher, then you're using the initial sequence number covert channel, then someone could look at the sequence numbers and tell that they weren't very random, see some sort of patterns emerging in them, and see that something is going on. And also if you want to use a secure covert channel, you need encryption because you have to assume that your covert channel is well known. Everything I'm talking about today is well known. It's been published in papers and discussed for ages. And I'm just kind of presenting it here. So you have to assume that your attackers, or the people monitoring you, also of course know about it. And probably have teams of people working on it. And another sort of side issue with encryption that you have to keep in mind is you have to ensure that you don't transmit the same ciphertext over and over again. Like say you just set up some sort of public key encryption system and you were just encrypting the data you were sending out with the recipient's public key. Say you sent out the same message repeatedly a few times. You know, a message like hi, do you want to go get lunch today or something like that. But you sent it out every couple days and there was no timestamp or anything in there like that. And so it was always the same message. And if you were sending out with the sequence number method, then they would see maybe, they would see this repetition of initial sequence numbers happen and they would know something was going on. So one sort of thing you could do to this is use some sort of cipher, maybe a stream cipher or something. And in addition to using a key with it, you could somehow add in a common time that you both share, maybe even just the day to help try to alleviate the problem of that. And so now how do you tell the person that you're sending data to if the data's really being transmitted? Because if you're just engaging in daily day-to-day conversation with this person or daily day-to-day network topic, you're probably not sending covert data the entire time. You probably don't have that much covert stuff to say. So one thing you could do is whenever you send a group of data, then send a checksum at the end. This also provides some reliability and things of that nature. And then all the receiver would do is shift through the data, look at the data, and look at the next little bit of data and see if that was a valid checksum from the previous data. In this case, you have to make sure that the checksum is securely keyed, because otherwise an attacker could do the same exact thing, shift through the data, look for the checksum, and find out if there was some sort of covert communication going on. Another thing you could do is some sort of magic flag that the receiver watches for, send it encrypted, do the same thing, and the receiver would examine the traffic repeatedly and look for this sort of, you know, maybe it's like a sin essentially in TCP that says, hey, I'm going to start giving you data. I want to set up a connection and everything. Another thing you could do is just constantly transmit covert data. And so they get the same data over and over again, which wouldn't make much sense for binaries or things like that, but are simple text messages could probably work, because then the receiver would know, oh, I'm getting the same message over and over again, but they really just send it once. So now how can you tell the receiver what data is actually being transmitted? You need to have some sort of index into the data, because you're probably not going to be able to send your entire covert message in one packet or one segment or one whatever. So one thing you could do is just transmit the data sequentially. Just go through and send it out bit by bit, and hopefully they get all this sequence that they get everything and they start listening at the same time that you start sending. However, another solution you could use is take an unmodified portion of the header and some of the data and use it as a nonce. And take this nonce and then take a hash of it and then modulate that hash with the total size of whatever the data you're transmitting to get an index into that data and transmit data beginning at that index. And that works, but the problem with that is that you don't get to choose the bits that you're transmitting. So you have to sort of transmit essentially random bits out of the data that you're sending. And eventually you'll probably transmit all of the bits. So can you guys hear me in the back still? Kind of? Alright. You could implement more advanced protocols over it. You could have some sort of TCP over the covert channels, whatever you want, that provides more reliability and robustness. And of course the age-old debate of reliability versus bandwidth. If you use a hash of the nonce you get pretty high reliability because you're sending the same data over and over again. They don't have to start listening at the same time. But you get much lower bandwidth because you're sending the same information over and over again. However, it is a pretty simple solution to implement. Another thing, if you did the transmitting data sequentially, it would provide high bandwidth, you know, perhaps the highest bandwidth you could achieve, but it would be lower reliability if you started listening at the same time and get everything in the right order. Another thing you could do is implement a more advanced protocol that would kind of trade off some of the bandwidth for more reliability and more, I guess, acknowledgement that it was actually received. Alright, now onto the get done with all the boring stuff I guess or all the sort of just introduction to TCP channels and talk a little bit about the tool that I wrote. This tool is just a kernel module useless proc that modifies outgoing TCP traffic by replacing the hard start transmit function. It's based off actually some code I got from the people that did the timestamp cover channel. It's all GPL and everything like that. The receiving component simply sniffs incoming traffic using libpcap and looks for the cover channels in the data and dumps it out to the user. Cover channels that I've implemented in it, I've implemented the initial sequence number TCP timestamp load modulation with high speed protection, which is optional so it'll drop it down to random amounts so that you're not vulnerable to the high speed attack. Urgent pointer channel IP type of service and using TCP reserved bits. And all these options, you can turn them on and off right now they're just with pound defines and you have to recompile it. But the interface isn't exactly the best thing. In the world, whenever you have to whenever you want to send data you also have to cat it out to slash proc cc. It goes out there. That's something I'm going to work on. Two different types of data indexing that I've implemented in there. Just straight up sequential transmission of the data takes the data, encodes it in there, sends it out. Other type is SHA of the unmodified portions of the header and the data uses an index into the data and the SHA can be keyed. And once again these are both options and for all the options both the sender and the receiver have to agree on what exact configuration you're using. They know where to look for the coverage channels. They know what sort of indexing you're using and things of that nature. So some work that still has to be done. Need to improve the user interface so that people might actually use it. Probably most people aren't willing to set up nice little shell scripts to send out their data off to the device. Maybe make an iSQL or something like that if anyone is looking to help with it and knows a bit about KDE or GNOME programming or something shoot me off an email. I'm more than happy to get some help with that. Want to build some encryption into it so that you can basically just send in a message and maybe give it a key or maybe you know with a symmetric key or public key or whatever and then it sends it off for you so that it once again becomes actually much more usable rather than having to have your own crypto layer on top of it. Adding a few more options for more coverage channels so that you can start to get even better bandwidth out of it if you're just worried about someone spotting what's going on. Also it would be nice to go out there and analyze how a variety of different routers and IDS's handle or detect this sometimes illegal data like setting the reserved bits maybe write a little program that would go out there and send it out send out bad traffic like send out reserved bits and see what the other end got and then do that in sort of a manner and then report back to the user exactly what sort of coverage channels they can use in that link and have a few little scripts that kind of do it but they're not very polished in any way and maybe build sort of a database of different sort of typical ones that work and typical backlinks that you can pass them through and different normalizers and how they treat it It'd also be good to implement some sort of more robust protocol for the data transmission that handles indexing and reliability and all that sort of stuff something similar to TCP or something like that Um so you can go ahead and jump on the web as soon as I actually get an internet connection The wireless connection has been flaky have people been able to get it to work today? Is there something magical you have to do like some magic word or something you have to say? In caps? I tried that and it still can't get IP Ah yeah I'm lazy Alright and before I let you guys all go kind of a shameless plug the open source vulnerability database is a project that's just starting up and it's going to be a vulnerability database that's run by the community and contains information on publicly known vulnerabilities out there in the wild Um different than CVE it'll be more than just a naming system but it'll also contain information on the vulnerabilities, perhaps exploits for them ways to detect the vulnerability what systems are affected, things like that and the website for that is www.openviosvdb.org and it's not quite operational yet but it's going up there Question? I had one question from back before Sure You said it doesn't pass through all routers will it actually disrupt SSH traffic? It won't actually disrupt it We'll still see that Right you'll still see this going on SSH just tries to set the delay bit for keystrokes so that it goes through faster And the second point is do you think something like this could be implemented on a peer GCP IP stack like 2000 or XP? I imagine it could I mean I have no idea how to but it would be really cool if it could be Maybe we've just got the source to Windows pretty easy to add that You have the source on your website? It will be as soon as I get a net connection All the source and the tool to detect the TCP timestamp channel and the presentation all that stuff It's supposed to be a peer GCP Hmm Cool