Welcome to the annual DEF CON convention. This meeting was held in exciting Las Vegas, Nevada from July 9th through the 11th, 1999. This is video tape number 21, Introduction to TCP IP Exploits. Okay, next up is Pete Shipley. He's going to elaborate on what I just talked about. He's going to be talking about TCP IP and its weaknesses. Let's give him a round of applause. One down. And leave it. Yeah, it's not going anywhere. He's not melting. Nice keyboard, Mike. Okay, let's talk about other stuff. Let's see. There we go, we're back. Back on to review a little bit of what Puck has talked about. Then go on and explain the general exploits. You're seeing them every other day on bug tracks. If you're a security expert, I'm going to bore you to death. This is newbie track. The purpose of this newbie track is so you don't have to ask stupid questions. We'll answer them for you. Well, the basic cover here is what's TCP IP? Why do we need it? Basically, what are ports and sockets? Known problems. And basically, general attack methods. If you were awake during the last hour, you already know this. What TCP is. Set of protocols. ARPANET basically became the internet. All that fun stuff. And I'm going to skip over the first several slides, obviously, since it's kind of redundant from Pungus' talk. We have basically your... I'm stupid enough to try to call me during my talk. Basically, if you use the internet, you use TCP IP. That's just the way life is. What is IP? It's basically a collection of protocols that compromise a suite. This is... Well, you're at the last talk. Why don't I just skip this stuff? Okay. That's the ISO stack. The reasons up here, you should actually know the ISO stack. I think it's pretty good. It's a bunch of bullshit. It reminds me of a seven-layer burrito. But... In fact, layer one is your... Layer one is basically your physical. That's your physical. That's your actual wire. Layer two is the protocol on the wire to the ethernet. Three, we're talking about IP. On top of that, it's TCP. And then we jump up to six, which is probably application. Now, I want you to keep an eye on this, because as I talk about various exploits, I'm probably going to work from the top down. What I'm going to do is point out... Because everybody keeps saying, oh, but what is TCP? Well, what we're going to do is we're going to have a very secure program. Well, so I break its foundation, the transport layer. Well, I'm going to have a very secure transport layer, so I break the network layer. You go, well, we're going to use better IP authentication. Well, I'll just break your link layer. This is what's happening in security continuously, and that's what I'm going to try to point out in this talk while explaining things. But everybody understands this, right? Good. Now, one nice thing that TCP does... It provides a connectionless... Basically, it provides reliable connections over a connectionless protocol. As you know from this talk, it basically relies on three-way handshaking. I'm going over this again, because it's important that you understand this part. It's to ensure both sides agree that, hey, not only are we going to talk, but we're going to talk. Like, for example, I go, hey, Pankis. He goes, hey, Pete. We've established a communication. I've called him. He acknowledges my connection. I send my request to him, and we continue communication. That's exactly what a three-way handshake is. So we have a client and server. I send a SYN packet. That's basically SYN equals X. That is acknowledged with an... So the acknowledgment is a SYN plus one, and it also stops the sequence. Now, at this point, that second sequence is acknowledged. There's a point down here. I mean... Again, you send out this. Now, the sequence in this direction is X. The sequence in this direction is Y. Now that we understand that, this is how we establish that somebody asked me during the break, well, how do you... We have randomized sequences. How do you know which sequence to use? Well, what is the starting sequence? That's the important part. Questions? Interrupt me any time for the question. Okay. With three-way handshakes, we basically, again, I'm mutilating this so you understand so you don't get lost in five minutes. That we now all agree that we have a three-way handshake. We all agree that both sides are ready to exchange data, and we have fun. Now, how do connections fail? That's actually kind of simple. We are on a client and server. I send a SYN. It sends a reset. It basically says, no thanks. This is... Oh, mind you. This is an oversimplified case, but in general, that's hopefully the way it's going to work. Unfortunately, IPStack is susceptible to tons of errors. We're seeing tens and tons of possible attacks for an ongoing spoof, and that's what the remainder of this talk is about. If there are questions at all, please just interrupt. If I get ahead of you, just say so. Now, before we go on to attacks, we should talk about what kind of attacks exist. One frustration I see is like, oh, I've got a new exploit. It's a denial of service attack. One thing in security to classify your attacks. So in general, I find there's four types. There's disclosure information. that's theft of information you know getting your info file getting you know getting your credit report there's destruction of data we're erasing your files alteration of data changing your grades yeah well so this again will free disclosures attacks is confidentially data stealing it exposing things or recent quake before it's ready password sniffers email sniffers there's all disclosure information destructors wiping alteration is basic modification data doesn't have to happen on disk you actually happen on a network while you're logged into a key while you're logged in from a client to a server for example is so might insert data that's alteration of data and the most common is denial of service these really script kiddies things are hackers because they could just flood your network no that is not a break-in that's denial of service that's the fourth type now what types of DOS attacks exist well we have ping flooding then there's modification echo apply flooding I'll explain these terms next slide or two TCP looping ping at death send fragment overflow I'm going to explain all these talks and all these exploits to you ping flooding is the most simple one that's when you just basically send lots and lots and lots of pings just run ping dash f from the unix shell give it an IP host name and the machine that you're on sends as many packets as possible to a remote site effectively allows it basically allows the attacker to possibly inhibit network connectivity mind you this is not going to work and get dial-up to my home t1 they will look for my t1 to your dial-up and those that other than OC48 don't take out my t1 history I've been with these low bandwidth and a friend who works at a large web development company they've got several OC 48 since kind of humorous because people try and get more power with a lot of everything in to flood them out on IRC all the time. It's a waste of time. Okay, and, well, another method is setting ping packets. Basically, you can set any kind of packet. But the ping program comes with Unix as, you know, why write code where you just type ping-f? If you really wanted to flood people out, you wouldn't use ping because routers are going to filter that. Now, how does it work? Simple. I'm sending packets to the Internet. It's flooding your machine. No-brainer. To be effective, again, I want to reiterate, you need greater bandwidth. I reiterate this because I don't know how many kiddies in their dial-ups try to flood my home T1. It just doesn't work. One common trick is if you're being flooded a lot, you will modify your firewall to say, for example, to block ICMP echo packets. Well, in that case, the person can start setting reply packets. If that doesn't work, they can literally start spawning you a whole bunch of other, you know, host-unreachable packets, just random UDP packets. Now, one of the main problems with low-power bandwidth, that you have a small bandwidth and I have greater bandwidth, well, how do we abuse this? Well, we can abuse other people's bandwidth. As you know, ping is a simple program where you send in a packet and you get a reply back. Well, it comes back to you because you send it from your address. Here's the situation. There's another notebook on the bottom. There's a bunch of badly set up machines on the right and, of course, a nice little victim they want to take out. Now, Smurf Attack is simple. I send a single spoofed packet to that network. This is tested to a broadcast address. I don't know if that was covered, but when you transmit IP addresses, you transmit to a single host and you also transmit to all hosts on a network. If you're dumb enough to leave your gateway open to allow inbound broadcast address, you're going to have problems. And also, not only you have problems, but other people will have problems from you. So when the government starts calling you up on why you're flooding their network, somebody's probably using you as that group of hosts on the right. Now, I send one packet to that group of systems. What do all those hosts do? They reply. A lot. Now, again, I iterate. One packet? Three packets. This is a classic Smurf Attack. So this is where your 14.4 modem can wipe out somebody's large net connection. Again, float attacks are easy to do. You should do it by filtering ICMP echo apply packets. The annoying part is you start filtering those, you can't ping people from your site. Other forms. Well, we have UDP echo spoofing. I'll explain this. You all know what UDP is now. Well, we have echo spoofing. There's a nice little port. There's a whole bunch of little ports called internal services that come with your Unix machines and NT machines. One of which is echo. You tell it to that port, and whatever you type gets typed back at you. If you send a UDP packet, it'll transmit the packet back to you. Kind of a ping-like thing, but it's a different layer of service. I don't know why it's there anymore. It's more of a legacy service. If it brings it all, you automatically turn this off. But we can have fun. Like, there's a little NT box over on the right-hand side. They installed all the network services, including UDP echo. So, me being a nice person on the left, I send a UDP packet with a from address and to address of my victim. So where does my victim send the reply? Thus. What is that machine busy doing with all of its CPU time? This can go on for quite a while. Eventually, CPU time maxes out, you drop a packet, and it goes away. Another method I can send is I can use a source address of localhost, which is, again, kind of a unique host that always refers to yourself. And, uh, you send multiple packets. The machine keeps quite busy. Variations include transmitting to a broadcast address. We get a lot of machines broadcasting at each other and such. But it's kind of simple. There are patched versions of iNetD. That's the demon that spawns most of your internet network services under UNIX. There are patched versions that will block these attacks, as in, I'm not talking to myself. Screw this. Ignore it. That type of thing. IP filtering helps unprotected systems. I hope you all have a firewall. Cyber, who flaked out in his early morning talk, is rescheduled. He's going to drop his PKI talk, and he's going to talk about how to build a firewall out of BSD. That's going to be at 5 o'clock in this room. And, uh, if you do attend that talk, ask him where he was this morning. He's out shooting his guns instead of talking to you. So, give him lots of hell for that. Now, SYN flooding. We all read the paper a few years ago. SYN flooding's actually been around for, I don't know, about 15 years. Although, a couple years ago, Route actually released a public program, and, um, all of a sudden, all the script kitties can do it. And all the script kitties think it's new technology. Read a paper from 10 years ago. It's all talked about. In fact, all the attacks were talked about 15 years ago. Uh, here we are. Basically, SYN flooding allows an attacker to deny a system. Attacks a purport basis. You can read. Now, the way this simply works, again, we have my attacker system, non-existent, legitimate client. Uh, it used to be that most implements of IP could only allow a certain number of starting connections. Now, they could have an infinite amount of current connections, but only a small amount of pending connections. So, if I were to end any connections, I could pick somebody, and I go, Hi! And this person says hi back to me, but I don't respond to that. Third person does it, fourth person does it. Now his buffer is full of pending inbound connections, and anybody else says hello to him, he won't respond, because he's too busy waiting for acknowledgement from me and the other people. Understand? Hello? So, I SYN flood that system. Now, remember 3D Handshake. It sends all the acts to a non-existent into a black hole, a non-existent system. Now, that victim system is waiting for the acknowledgement to its acts. Are they gonna come? No, we have to time out first. So, since nobody can establish a new connection, a legitimate client cannot connect. Now, if you're logged in the victim system, everything's just fine and dandy. Your shell's working, you're typing away, your machine's load is nothing, but nobody else can establish any new connections. What's the typical host? It varies per host. It's usually, I believe, 45 seconds, I guess. The average. It pretty much varies a lot per host. There's a lot of software out there, actually. More advanced firewalls these days will detect this, and in the middle of an attack of a victim system, an intelligent firewall, or perhaps certain type of secure utilities, will start transmitting the resets, causing all the acts to be reset. Destination host and reachable, it depends on your firewall. Some firewall types, by default, just say host and reachable for any packet they reject. Some firewalls don't apply anything. Other firewalls say network and reachable. It really depends on what product or whose security company you bought into. Will that reset the connection, though? Hopefully the firewall that will reset will actually re-transmit the connection. Again, it really depends on the product. I can't say what will what happen. In most of my examples here, we're assuming there's no firewall involved. Of course, you can't make the connection. In this, remote action victim systems block takes very little bandwidth. You and your little dial-up or your ricochet modem can take out entire corporations this way. This assumes that you're running an old-version virus or some OS. Any modern system that was released in the last year or two has listened to this. Again, strong filtering helps. Send sniping. This is a fun one. Ever, like, be on a network and want to, like, shut people down? Well, this is how you do it. Here's that layout again. Here's that send packet again. Now, remember how the three-way handshake, you remember how normally a connection fails? Now, you'd assume the reset would come from the person receiving the connection, the server on the right. Instead, I fake the reset. The legitimate client doesn't know any better. Send, reset, okay. Port not open. Now, when the act does come along, the legitimate client sees the send part of that and says, Reset. Reset. Both machines did not establish TCP connection and there are no errors in your logs. Actually, if you run a program with ARP Watch, it's kind of fun, because ARP Watch would notice that your, effectively, that your spoofed reset came from the wrong MAC address, but that could be fooled also. Yes? How do you use the time? How do you use the time? These old machines are on the same physical wire, on the same unswitched dumb hub, and the attacker sniffed, you know, sift the packet and said, Oh, here it is, reset. Now, the sequence number of the reset is zero. Your sequence number by default is zero unless you've established a sequence. So, in theory, the attacker can stream resets of sequence zero at the legitimate client. And a connection can never be established. Again, the victim system can be selectively blocked. It requires, as I pointed out, local or intermediate network access. In other words, it has to be on one of the physical wires that this packet is traveling over to see the packets going back and forth. And it's pretty hard to detect, because you can basically spoof your MAC address, spoof the IP address, obviously. It's kind of a barrier to track down. Smart hubs help. Buy your Cisco Catalyst. Nice little VPN networks. Spoof, you know, spoof protection. That'll help a lot. But then, of course, I'd rather buy a nice car than a decent, you know, 5500. Where a fully loaded Catalyst 2500 is like 110,000. Yeah. Security's expensive sometimes. Ping of Death. We all know about this one. It's really simple. This is a commonly implemented it could be any type of IP packet, but it's commonly implemented as a ping. It implements a bug in layer 3. Now, in all protocols, or most packet protocols, there's this concept of maximum size packet. In Ping of Death, the error was we would allocate a packet size, that's 65K, and then I would transmit a ping packet, which was fragmented. When you reassembled all the parts of that packet, it was larger than a buffer. So you receive your first fragment, you write it to the buffer. You receive your second fragment, write it to the buffer. You receive your third, write it to the buffer. You receive your fourth, over the edge. And you overwrite parts of your system or kernel memory. AKA, Blue Screen of Death. This worked on about every machine out there for a while. Again, this has been known for about a decade, only really came to public light about a year or two ago. Basically, if you have a firewall you have control of, filter fragmented packets. There's no reason to allow a fragmented packet through your network. You might say, why? Well, why should a packet be fragmented? If you have a healthy network, going over a healthy internet, into your healthy network, fragmentation should not happen. The only time fragmentation can possibly happen is if you have a large packet network, for example FTDI, being retransmitted over ethernet, which has smaller packets, at which point they'll fragment. But if you configure your network to do that, you should suffer. Again, so just filter fragmented packets. I think on the average, if you run a website, you can lose up to 10% of I think that's maximum 10% of the people trying to connect to you, sometimes as low as 2%. As far as I'm concerned, tough. They have a broken network. Now, permutations of this. Teardrop attack. This and IP fragment flooding, that is micro-fragments overlapping, is fun stuff. Overlapping fragments are fun. Effectively, Teardrop is a widely available tool. Anybody could download it. Root Shell, I kind of hate Root Shell for this, because they have umpteen versions of Teardrop, yet they don't say what the Teardrop attack is. Wouldn't it be nice for those hacker websites out there to actually bother to write even a paragraph to say what it is, so I don't have to come up here and explain them to you? No. That might take effort. This is mostly Linux, NNT, basically Linux and Windows are mostly vulnerable to this. Linux should be upgraded to perhaps FreeBSD. And if you want FreeBSD, we have free CDs in the conference area. Unlike Linux, FreeBSD is free. How much is Red Hat? They jacked up the prices, actually. And by the way, they wouldn't make any available for free at DEF CON. I'm not going to rank on them too much. I'll do that in a bar later. Okay, IP filtering helps. Generally what happens is you have a badly formed fragment, so one fragment comes in, you have a badly formed packet that comes in that tries to process the packet, the machine burps. In other words, it wasn't analyzing the fragments as it came in. Maybe the assumption that the offset in the packet was correct. It would, well, inside the packet in the fragment, effectively, I kind of skipped that and Punx was talking after breakfast, so in case he explains to you, I'm sorry. But effectively, in a packet, if you're fragmented, there's an offset reference. Well, if that offset reference doesn't match the content of the packet, your program might be tricked into doing something wrong and blowing up. Another fun thing, this is not in my slides, but one great way I used to be able to take out Cisco routers about eight years ago, is, and I have lots of variable options, and the way the header assembles is there's a byte offset to next option. And the way the computer works is, you know, take current address, add offset, and process current option. If you set that byte to zero, what does the machine do? Reprocess that option until power goes out. On a single-threaded TCPIP stack like Linux, you can really your machine really just literally stops. If you're multi-threaded, you know, multi-threaded like any Solaris or BSD machine, it's not a problem. It'll just eat up a thread which will eventually die. Again, fragment flooding is another fun one. When fragments come in, as you realize, you need to deal with these things. Sometimes fragments don't show up in order. So you're getting snippets of articles coming in, snippets of packets. So you've got to store them in memory somewhere until the other part comes up, you connect them together and then pass it on to the upper layer. to the application layer. What if I send lots and lots of random fragments to your machine? What happens to your RAM space? It fills up with useless garbage. NT, really vulnerable to this. Linux and BSDs are actually pretty good about this. When they begin to run out of memory, they start just dumping the packets. Because what happens is, if the packet wasn't properly acknowledged, it would be retransmitted, resent. It's not a problem. But there's a good way of eating up lots of CPU resources and running out of RAM real fast. In other words, micro-fragments. Let's make fragments so small you don't recognize what they are. So if I fragment, now mind you, we had, you know, Ethernet, IP, TCP. If you're filtering at the TCP layer, it's assumed you could read the entire TCP packet. At least the header part. But what if I fragment my packet so small you can't read the header as a full part? Can you still filter? No. What do you do? Well, you probably pass it through. So what you do is you just fragment your packet so small, each one is not identified as a problem. Simple. Yes? A firewall policy of dropping all fragments would help a lot. Certain firewalls actually do reassembly I mean, the Cisco had a firewall that Cisco discontinued. The NT-based one. Sentry was pretty good because the Sentry actually had a fragment packet policy that would reassemble fragments before passing them on. Actually pretty good. It was a bit memory intensive, but it worked. Most other firewalls will simply forward the fragments. The Pix firewalls option is only pass fragments when they come in order. So obviously the micro-fragments may or may not work. Actually, I think it just drops those. The overlapping fragments and the fragment flooding would not work because it only allows fragments in order. Mind you, this breaks Linux because when Linux fragments it breaks a packet, maybe three parts. It says the last part first and the first part last. So the Pix firewall simply drops the packet because it gets fragments four, then three, then two, then one. When it gets packet four it goes, where's three, two, one? Ditch it because this is a random fragment. I don't know if that's a bug in Linux or a bug in Pix, but oh well. Questions? Okay, other fun things. You want to learn about sniffing? You want to get your password stolen? Opcache Poison is a fun one. Now mind you, so far I've worked my way down that protocol stack. Every time I explain a fix I'm going to break it again in about five minutes. Now sniffing is a fun one. Don't you love that little number on the bottom? 85 to 95% of attacks. I love these kids that call themselves hackers because they break into one ISP, steal a password, break into another ISP, steal passwords. When are you actually showing technique? Now sniffing is easy for the person who hasn't figured it out yet. It's simply an intersection of data. As client sends a server, my notebook sitting on your machine has your password. Anybody use any of these applications or protocols? Come on! Your password has been stolen. Telnet, clear text, unencrypted. Rlogin, clear text, unencrypted. Well, POP, IMAP, clear text. If you're using APOP, okay, then you're a little bit safer. I can only read your mail, I can't read your password. HTTP. A little dialogue box pops up, you type your name and password, clear text. FTP, clear text. Simple mail transfer, clear text. Simple network management, clear text. RPC, NFS, clear text. All of which are available to be listened to over your network. Is that secure? Have you used SSH? SSL will provide encryption, although one minor plug again or four against a cell. SSL simply means the person cannot listen to your packets between you and the server. It does not mean the server is secure. Well, my pet peeve is like, we're secure, we use SSL. That doesn't mean they're secure. It means that the data getting to them is encrypted. The second it's handed off to their applications is clear text. Just to name a few, be aware. Download SSH, download secure CRT, use it. If your ICP doesn't support it, tell them to. If they don't, get a new ISP. Best protection? Buy a smart hub. I know, it's kind of expensive, but you've got to do it if you're going to be serious. Use SSH, use Kerberos, that's kind of nice. Use DES Channel Up, it's not really widely distributed as it should be. Whenever possible, remove from riskless mode. On my home site, you can't sniff. I've rebuilt all my kernels and I removed the capability from sniffing from my kernels. Go ahead, root my system. People do it all the time. You can't sniff. Makes your network a little bit more secure. Well, to rebuild the kernel would be kind of nice, but you've got to replace the kernel, but because it's immutable to file, you need to reboot the machine from console and install it. Which is kind of a pain in the ass, because I have to be there at console to install it. Maybe buy Cal lots of beer, I'll sneak into the war room and do it for me, but I don't know. But I'm locally using Ethernet. It's common mac address poisoning. I love this. Mike told you about all the different ways about TCP IP and how you can fool things and redirect things. Well, let's go one layer. Let's go, like, layer two. Ethernet level. Press anybody to impersonate anybody on your local LAN. Hmm. Yeah, I love these. We have secure IP coming out. We're doing all the secure stuff with IP. We're encrypting our packets and everything else. Well, too bad. I just blew your foundation away. Denial of service. A lot of redirects. Now, how does our cache work? Well, you're on a network. Every network, every Ethernet card has, in theory, a unique MAC address. And also a lot of unique IP addresses. Hopefully it's a unique IP address. How do the machines figure out who's who? Well, something called ARPs. So, host 3.4 doesn't transmit. Hey, who's 3.8? That's a broadcast over the local Ethernet. That machine replies, hey, that's me. Oh, fee notification. That's a MAC address number. The first several bytes are, you can pretty much tell what kind of host I'm working with here by looking at the first several bytes. I'll leave that to your own figuring out what kind of machine I have at home. And the second set of bytes are the host type. But by just looking at the MAC address, you can tell the hardware type. So, in the case of a break-in, what happens? Here we are with that little transmission. Hey, who is this person? I lie. Where would the IP packets go? Straight down. Oh, by the way, Loft will be announcing a product this weekend. If you're interested in this stuff, look for the announcement. So, hard cache poisoning by a smart switch, by a smart hub. Oh, one more quick thing about this. You don't have to wait for the request. A lot of applications will just accept the packet. If you just get on a network and say, hey, hi, I'm the new router here. I'm this manager. A lot of machines are like, oh, okay, update the cache and start sending information to you. And, of course, I don't believe in things that hand out fixes. Again, mortgage the house by a smart hub or switch. Whenever possible, remove some from your kernel. That's like a broken record. One network, ARP Watch is really good. ARP Watch is a program that a friend of mine wrote. It basically listens to your network and keeps a table of IP addresses to ethernet addresses. If a new one shows up, it sends a notification, hey, new IP address, or hey, new MAC address. If somebody uses somebody else's IP address, it goes, hey, that changed. So, if I plug my notebook into your network and start trying to take over your identity, what happens? At least they'll know about it. It's really good for people running large sites and people that you run and you have them always bringing new computers in or moving computers around the network. It catches them real fast. On stable networks, in other words, places that aren't being re-IP addressed all the time, go to your servers, preferably UNIX. You can also do this on NT. You figure out where that menu is by yourself. And you can permanently insert into an ARP table. And that's the command ARP dash S, IP address, MAC address, and pub. That will permanently insert that MAC address into your kernel table, which means it'll ignore the broadcasts. If you have your mail server, your DNS server, all your different servers, I hope you're not running on the same machine. That's another foolish thing to do, but that's different talk. I hope each of your major network services runs on dedicated individual hardware. And I hope when you get home that you go and you hard code your MAC addresses between servers. This way, no one can spoof. Mind you, when a machine crashes and you replace the Ethernet card, life will be bad. You'll have to go to every fucking machine and re-do your ARP table. But, good luck. And this doesn't quite work with transient networks, DHCP-based stuff. Yes and no. Most cards, most newer cards you actually have, the MAC addresses change usually with programming. By default, the MAC address is assigned to the card unless you use Sparks, which is bound to the CPU. So it's kind of a pain in the ass. If you put two Ethernet cards into the same Spark station, they both have the same MAC address. And if you connect them both to the same Ethernet for some various reason, things will get broken real fast. But, rule of thumb, it's bound directly to the card. In fact, let's see. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Our host, DEFCON.org. Whatever you want it to be. All you need is one command. Follow? Questions? Now, let's see. Again, this is just an explanation. I wasn't going to print out the slides, but it's true. You can go to Kinko's and print them. These slides will all be available on the DEFCON webpage. DTO seems to publish these things. But this is just an explanation of what I just said. OS is now a randomizer of numbers. It makes it a little bit harder to do. It turns out that some of the randomizations were very weak. So, even though it looked random, it wasn't random. Whoops. Crypto login helps a lot. Because under crypto login, after you establish a three-way handshake, when you still need to be encrypted, especially SSH, for example, you still need to perform the key exchange. So it's more than one packet. Yes? In Solaris 2.6, there's two or three different options for randomizing your sequence. There are... There's one for standard stuff, which doesn't really randomize it. There's one for RFC. Some of the RFCs are basically in the documents that propose standards. And then there's one for randomizing the sequence. Do you know about those? I'm familiar with the different propositions. I recommend using the RFC or the randomized one, not the non-randomized one. It's up to you. I imagine that the RFC is a standard and the other one is a homebrew. I mean, if your network works, don't worry about it. And here we are, session hijacking. This is very similar to what I just did. Here's that slide again. Now, I'll save you the effort of seeing the three-way handshake. Let's just say it happened. You were happily logged into your ISP. You're on IRC. I'll let it in. Whatever else. And what happens? I spoof a packet. I get it. I hijack the session. Basically, I know what your sequences are. I jump into the conversation midstream. We exchange a packet or two. All of a sudden, your trusted host is out of sequence, so it's going to be ignored. And I now have your teleconnection. The timing is tricky. That's why you use software. Now, once I send that, I can send lots. Now, the problem is you're going to have an axe storm. Because your target host is not going to get an acknowledgement for a packet it sent. And it's going to start streaming acts at each other. Same thing for the trusted host. And eventually, your connection will drop because it's going to discover the axe that was associated with that TCP. And your kernel is going to go, eh, something's screwy here. Kill the connection. Now, a partial hack might be to send an ARP to the target host and make it send its axe to Never Neverland. That would be a pretty good one. That helps a little bit. So, quick explanation. I desynchronize the connection. Then I jump into the sequence that I established. And you're typing along. All of a sudden, your screen doesn't respond anymore. And I've got the session on my notebook. The software is published in FRAC. Anybody feel... Everybody going to use Telnet again? Anybody who used Telnet before and not again? Anybody? And again, mortgage to house. Piety certificate. Buy decent network equipment. Port scans. We're all about them yet. I'm going to go over them quickly because that's actually what the next talk's about. DNS cache poisoning is a fun one. Did you notice that DEF CON web page was down a few weeks ago? DNS cache poisoning. So, port scanning is kind of easy. I'll kind of skip through this quickly because this is actually what the next talk's about. Basically, I send a port to connection one. I get a reset. It's closed. Two. Reset. Port three. Reset. Skip to seven. Open. I got ports open. Port seven. Discard was open. Eleven was closed. Twenty. FTP was open. This is basically what happens when you're on strobe or NMAP. When you're on strobe or NMAP. That's the next talk. And I'm going to skip through this. I don't want to really tread over modify. And there's different types of options. I'm going to skip through this because, again, I don't want to take the wind out of somebody's sails. See what we're doing? We're doing fine on time. Basically, by the way, you don't want to do resets. I'm going to skip through this again. I don't want to take the wind out. You can spot this stuff. Here's a few applications. GCP log. NetStat. Abacus. Those are little applications you can run on your server. Again, I'm skipping these slides. It's all next hour. Let's do a fun stuff. DNS cache poisoning. Everybody know about DNS or how it works? I'll tell you. Okay, here's the .server, the .com server, and the acme.com server. And, of course, legitimate client and DNS server. Now, this is a normal, healthy situation. Your client goes, your local DNS server goes, hey, where's acme.com? We send a packet off to the root, the overall internet called dot. He goes, hey, who's acme.com? I don't know. Why don't you ask .com? Hey, who's acme.com? I don't know. Why don't you ask acme? Hey, who is this person? Oh, the answer is, yeah, it gets sent up with the proper IP address. Simple, huh? Now, it might seem inefficient, but actually what happens is your DNS server down here caches that information. So next time somebody asks, is it already in the cache? A little bit more efficient that way. Also, it causes some minor security problems. Vulnerability to the cache, you always insert erroneous information, like where did that reply actually come from? Here we are again. As an outside person, I go, hey, who's acme.com? It goes, where is that? I reply. It sends me the answer. That's obviously the wrong answer. It sends me the wrong IP address. Gee, could that be the same IP address that www.defcon.org had maybe three weeks ago? It had nothing to do with that. So what happens later on? Somebody else asks for it. You get that reply. Okay, what if we were talking Wells Fargo Bank? And that IP address was my home web server? What would happen when I ask for your password? You type it in. And what happens when I ask you about your account number? You type it in. Then what happens? I go to jail. Yeah. I have to pay for my DEF contract. But again, if you update the current versions to 8.something, by Paul Vixie, I recommend that. For the person who knows what I was talking about, yes, I know there's several permutations to this. It used to be, we were just having a little mess. We just started doing it. It used to be that DNS servers would only accept responses. Well, actually, it would just accept a response, actually. It wouldn't even care if it asked a question. It would just accept it. Oh, ah, it's fixed that. So now it only accepted responses for questions asked. Well, eventually, you realize, well, I don't know. We'll just ask the question first. So the DNS server goes, fine, we'll start sequencing our requests and making sure the answer is the same sequence. That didn't work. The sequences were, A, very predictable. B, you're able to send all the possible sequences within a minute anyway. So, I mean, you know, the sequences are, how long does it take to send, like, 65,000 packets? Not long. And so they took care of that. So now they're thinking about how to randomize the sequence. But it turns out. The sequence randomization is not that random. Yeah, so it's a little thing going here. But run the latest version. It's a lot better. And next version, we're actually going to have encryption. That'll help a lot. Yes? Yes and no. In this case, we assume you're actually going to ask it. Yes, it will ask it. But a lot of times, you'll send a packet out asking for, what's the current version of IPv6? What's the IP address? It's called the SOA record, which is a serial number. And if I reply with a higher serial number, I can override it. So when I say that little fake packet, it's going to have a serial number of 9,999,000, just to, you know, some astronomical number, and with the expiration date, we'll never time out. So that's going to be in your cache. They'll power it on your server. And eventually, yes, if it's already in your cache, I might not get it in. But then, all I got to do is ask for another record that's not in your cache, and I can probably slip it in. One of the other exploits, of course, was piggybacking. You know, so I run DISORG, that's my home domain, and I would, for example, get you to do a DISORG lookup, and then my DISORG reply would piggyback a Wells Fargo reply. That's another way of slipping past the gates. And again, I can quite literally go on for an hour of just permutations of this one. So, you know, in closing for this particular topic, we'll just say upgrade. Even if you just installed Solera 7, upgrade. Whenever you buy a commercial product, download, install. Same thing with SendMail. So effectively, upgrade, fix padding, you know, modern version tracks, queries, et cetera. BTP, anybody know what that is? Yes. This is a fun one. We all heard about, what was it, killing the internet in 20 minutes? Want to know how to do it? Actually, DISORG has released some automated scripts for this one. Okay, here's a little network. We have a network. We have an internal router. We have a couple of peers. Obviously, these people have got money since they have multiple connections to the internet. Internal router establishes a BGP connection to the peer routers, or blue routers. I'm on the outside world. Me being a nasty sob forges reset and fin packets. Mind you, the TCP connections, I don't know what the sequence is. But there's only 65,000 of them. How long is it going to take me? Now, eventually, that network picks up. It goes out. When internal router and router A discover or drop a TCP connection, internal and A assume the other guy crashed, automatically rebalance their internal balance tree of routes. And if you're anywhere near a large hub or large center of the universe, that can take a long time and a lot of memory. And after it balances this, it reestablishes the connection, and then rebalances the tree. After the tree is balanced, then your connectivity. So your network can be down for up to 20 minutes. This is an extreme case, but it takes a while. So if a peer loses a BGP connection, you're screwed. You no longer have connectivity if you have one peer. Here's a blind attack. I have a 1 in 65,000 chance. Not a problem. Better than the lottery, better than the slot machine. Let's see. The attacker may be able to keep the connection down infinitely by continuously resetting resets to zero. Again, what's the first sequence number? Zero. Until we establish a sequence, it's assumed to be zero. So when you send out the SYN, the reset is sequence zero, since we haven't really established a full sequence. The attacker may keep things down. And eventually, when the routing table is large enough, it can take a significant time to come back up. So your network is up, what, three minutes every ten minutes? Or worse? Your site's out of luck. You can really embargo a corporation this way. And the network admins will go nuts because the routers are up, the routers are pinging each other. Your Cisco discovery protocol says, yep, I see a router right next to me. And you get the connection, it goes right back down, and they'll have to pull their hair out all day to hook up a proper network monitor. And again, this attack is best fixed by filters. Unfortunately, if I get to pick on Cisco some more, actually most networks, you lose about 40% of your bandwidth when you turn on IP filtering. So since people only buy a big enough router that they need, nothing more, they discover they've turned on IP filtering, the router isn't big enough, but they just pay, they spend how much money? So there's a problem. Question? Yeah. How flexible can that be? Well, since I'm probably spoofing, it's going to take a while. You probably have to manually do it. You really just can't say where this packet came from because the source address has the wrong stamp on it. You probably have to call up each person in your chain of connections, hopefully not 255 hops, usually about 30, and get them to run a monitor and tell you where the packet's coming from. How often do they get qualified to do that? I don't know, I don't work there. How often do they get qualified to do that? It really depends. I don't want a subpoena first. It's all privacy versus workability issue. It falls under Jennifer's, I guess, column. But this is a fun one. This one is really just way too much fun. We have IP filters, so bam. Again, the internet's getting overloaded. The centralized hubs just don't have enough bandwidth to support filtering. Most companies, the best thing you can do is if you run a company, you run an ISP, filter you up. There's no reason a packet should leave your network if it's not from your network. That being, have an outbound filter means that all packets leaving your net have a source address of your network.