You, sir, uh, you, Nick. Okay, well, I know the stragglers, all of them, sir. What's that? Okay, you let me know if you can't hear me, okay? You let me know if you can't hear me. I'm losing my voice. I've been talking, I've been hanging out at parties at DEFCON until, uh, well, anybody know when the last party let out? Was it around 5 a.m. or 6 a.m.? Anyway, um, so I'm kind of losing my voice, but we'll, uh, we'll, uh, we'll get by. Um, anyway, so I'm going to talk today about Bastille Linux. Um, has anybody here been in the room before? Has anybody been, seen, uh, seen me talk about Bastille at a previous DEFCON? Okay, well, that's kind of cool. Okay, there's not a huge amount of repeats, but there's some, so, you know, in terms of introducing it, so. You guys should still be happy. It should be fun. What's that? Okay, so I'm supposed to remind you all that we're being recorded. I'm not sure why. Maybe, I think they've had a few people streaking through the, uh, through the talks. Um. Yeah, I wish. Okay, so, anyway. Um. Bastille Linux, who's, who's used it in here? Or, or downloaded it at least? Because lots of people download it, I'm sure, and never use it. Okay. So, for the rest of you. Here's what Bastille Linux is. It's a security hardening script for Linux and Unix. I'll talk about what a hardening script does, why you want one, why it's useful. But, uh, now we're working on Red Hat 7.3 and Mandrake 8.2 and Turbo Linux 7.0 and SUSE 7.2 and Debian 2 and, uh, and HPUX 11. Um, 11.0, 11.i, whatever. And, uh, and that's a lot more than last year. Because last year I just came up and said Red Hat and Mandrake. But it turns out a bunch of people have all been helping out. Um, sometimes they port it and they don't tell me about it. I find out about it later. Sometimes they port it and, uh, send me an email. I'm just like, hey, I, I ported Bastille. Hope you don't mind. It's like, no, that's really great. Thanks, guys. Um, we're going for more operating systems next. The easiest way to vote on your choice of next operating system. Okay, this is really a geek conference if I'm sitting here telling you guys you should vote on operating systems. But, but okay. Um, um, our, the next few we're, we're expecting to do are, uh, we know we're going to do Solaris. Solaris is definitely going to be a fun one. Um, because I think that operating system is actually getting worse with each release. Uh, I don't know how many of you have seen Solaris 9, but, uh, it's, it's, and it's nice, it's functional, but it's really functional, so, um. It sure is. It sure is, yeah. Okay, um, we're talking about OpenBSD some. Um, any OpenBSD developers in here? Okay, I can tell because no one's throwing anything. Yeah, in the back. Okay, well. He can't throw that far, I hope, so. Anyway, um, yeah, I didn't really think about hardening OpenBSD until, uh, until really recently because it's, the thing is OpenBSD is the, the operating system that probably, you know, is darn near the best in terms of off-the-shelf operating systems that everyone can, everyone can use. They start out with really good defaults. They, they very rarely, you know, their, their big slogan is something like, uh, um, uh, six years, well, it was something like six years without a, without a, without a root hole in the default install. And, uh, now it's like, I think it's six years with only one root hole in the default install. But no, that's really, really good. I'd like to be, listen, people ask me, you know, vendors are getting better with settings. Are you ever not going to have to write Bastille? Not if they keep going the way they are. I mean, most of them, you know, six years with only one remote root in the default install. That's, that's, that's really good because I think, uh, I think Red Hat has, you know, one every year, one every, you know, uh, maybe one every six months. Um, with Red Hat 6.2, there were like, what, three, you know, six years without a root hole. Um, I think there were, there were either two, two remote root holes or three remote root holes. We'll do. Um, just, uh, one of you in this room has wanted, they're going to, they're going to take you out in handcuffs and you just want to let me know. It's all good. Um, no, it's not. I promise. Okay. Anyway, um, so that's really good for OpenBSD. We might, we might do a little bit of hardening, but there's not a whole lot we can do. But there is apparently an SSH worm that's, is it the SSH worm in Apache? And it's running around rooting, rooting up in BSD boxes right now. Okay. Um, we've talked about FreeBSD. Um, somebody finally gave me a, my first set of FreeBSD CDs or my first set that are actually, that are actually current. So, uh, we might have to do FreeBSD. Um, we'll see. Um, a lot of people tell me, you know, I tried out Best Deal, but it was just so ugly. It was just so, you know, it was just so hard to run when it first came out. We got a GUI. Um. So, um, yeah, yeah. The GUI's even really, they're even, we're even like making the GUI really cool. One of these days I'm going to get around to doing like a web front end. So you don't even have to be able to like install packages to get the GUI to work. You just boom. A little, a little web server will pop up on your box. The Best Deal will run a web client. Anyone who wants to talk to me about web application security can know why it took me this long to get there. Um, but, you know, we're going to do that. But yeah, we got a little GUI. It tells you like, shows you a, a little bit of what's going on. So, um, we're going to get around to doing like a web front end. The Best Deal is basically, it shows you a question, says, hey, do you want to do this? Okay. It tells you, here's why you might want to, here's why you don't want to. And, uh, lets you answer and you get to go through all these different modules and it tells you what you've changed. And I'll, I'll talk about how it works. So, um, um, in general, I guess one of the things I want to say is, when we created Best Deal, the, the first question was, we're trying to make a hardening script. We're trying to make the best hardening script for Red Hat. So there's all this stuff we want to do. The problem is. If you do everything you think of, especially back when Best Deal was originally first written, you break stuff for everybody. Okay. One example was, you know, turning off telnet on a machine. I mean, it seems obvious. Let's turn off telnet and put open, and put SSH on instead. But how many, but how many users, when they try to telnet to a box, are going to be really confused. The telnet doesn't work anymore. Say, Best Deal broke my system and they're going to, you know, and they're going to uninstall Best Deal. You know, they're going to undo it and stuff. Um, so, what we figured out was, we should ask people questions about what it is that we should do. I'd like to, I'd like to remove telnet. Is that okay? And that was a really good idea. But all of a sudden we realized that there were lots of people who, who maybe wouldn't make the decision the way we'd want them to. You know, they'd say, telnet's good. I've used telnet. Telnet's great. I love telnet. So we got to say, listen, telnet's bad. Why is telnet bad? Well, first, um, if you're on the same LAN as me and some other, or some other, or some other conditions, um, then when you, uh, when you telnet to or from a machine, then, um, uh, I'll steal your password. Um, and then it was like, oh, by the way. Uh, so people are like, you know, of course people are going to say like, uh, I got Kerberos. It's like, well, that's fine. You got Kerberos telnet. Still take over your session. Um, so you guys know about session takeover with telnet. Okay. Yeah. Some people do. Some people don't. Fun tools. Really great ways to convince people at your site to get rid of telnet is, uh, um, Entercap. Okay. Or Dsniff. Or Hunt. Okay. In the case of Hunt, Hunt was like one of the first tools to let you like take over someone's telnet session. Um, some of these tools are even kind of cute because you can throw stuff to the server. You can sit there and do stuff on the server and you type separate messages just to the display. Like, hey, this is your system and don't worry about this. Uh, I just have to, I just have to change your password and read your email real quick. Don't worry about it now. So, so anyway, yeah, yeah. It's all. So, so we try to tell people why we want them to do things in the hope that maybe they'll bend to our will. Um, or at least, you know, they'll, they'll make an educated decision about why they're not doing it. So, um, the downside is that this means that your first best deal run, if you have a lot to learn, might take you about an hour. Okay. On the other hand, once you've been through it, or if you're already an expert, it might take you five or 10 minutes. Um, anyway, I'll, let me go through some of the stuff that best deal does in general and I'll, I'll talk about in specifics, I guess. Um, the first is best deal puts a firewall in the box and it could be a firewall for just the single system. It could be the firewall for, uh, it could be the firewall. Whose phone is that? Um, I hope it's not mine. Okay. It could be a firewall for, for the entire system. Um, or it could be a firewall for like, you know, one or two people. One or two networks. Um, we do a set UID audit. Um, this is a very boring thing unless you're currently playing capture the flag over there. In which case I've been told by the, uh, by the capture the flag, the people who set it up, that they've marked like all the binary set UID or something. Um, set UID, ah, we'll talk about it, but it, it's not good to have that many binary set UID. Okay. What else does best deal do? Very informally. It turns off stuff you're not using. Okay. Unnecessary stuff. It's anything you're not using or we can convince you not to use. Okay. Um, for all the stuff that's still there, we try to tighten the configurations up. And a lot of what we're adding is more stuff to tighten the configurations. If anybody in this room was in my attacking and securing FTP talk, you'll notice that best deal's about to start doing a bunch of the stuff that I started telling you all to do. So if anybody wants a refund now, uh, I, I, dude, I'm sorry. Okay. The last thing, as I said, was we're going to educate users and sysadmins. And, uh, and not all admins have guns pointed at their booth, at their, at their boots. But, uh, you know. And a good number of users do. Everyone will shoot themselves in the foot. Everyone will, will hang themselves to give themselves, give them enough rope, um, without education. The nice thing is many of us are educated, but for everybody else, we'll try to teach you something while we're there. Um, y'all having fun? Or am I telling you stuff you already know? Yawn, yawn, yawn. Okay. So I'll try to go a little faster. Okay. So first, why do you, why do you need a hardening script? If you're at DEF CON, you probably don't need to, you probably don't need me to answer this question, especially because if you're, if you're not doing anything to harden your box and you're running Red Hat 6.2, you've probably been rooted six times today. Um, or it's morning, so three. Um, um, the, the, the basic question is that in general, the defaults on an operating system are usually not set well for security. Red Hat's getting better at that. Solaris is getting worse. Okay. Why? Um, as far as we can tell, the reason vendors do this is, is partly because the users who are using these operating systems really want it to be easy to use. They want to install and say, okay. I installed the web servers running and all that. I just push stuff onto the web server and I'm ready to go. It's all good. Okay. Well, that's, that's, that's kind of nice. Um, the other issue is that the programmers who actually create these operating systems, I worked for a vendor for a year, so the program, I, I, I understand these people who create these operating systems, they really like convenience. I have found a number of, a number of, of programmers who work for, who work for, uh, for, for vendors who don't set root passwords. It's just a, you know, it's just like, yeah, whatever. It's, you know, they might root the box. I'll just rebuild it. I rebuild it every day anyway. What do I care? Um, often, often neither of this set, um, will, will understand security. By the way, I'm not busting on users. There are lots of users who understand security, but there are enough that don't that the vendors think, you know, I've got to make sure that I, that I leave the box really, really functional, really, really loose and open. Okay. Um, again, why do you gotta, why do you, why, why do you need any security anyway? Um, well, first it's, you're targeted by clueful hackers. You're targeted by clueful hackers probably, especially if you're here. Okay. Often you're targeted by them because you're one, you're one hop away from the place they're really trying to get to. Sometimes you're attacked by them. Um, you know, sometimes you're attacked by them because they just really would like a, a place to store some files. Um, why else? We're targeted by script kiddies because we've got an IP address. You've got an IP address. Some, some script kiddie just finally got a working exploit after downloading four. Finally gets a working exploit. He gets a scanner that scans systems looking for vulnerabilities. Looking for vulnerable systems. He scans, uh, there's an auto router that I, there's an auto router out there that, that generally scans class B's. It's called auto woo. Looks for, uh, looks at 65,536 addresses, whether or not they exist, but you know, it'll go and check every single one. What you do is you run this, you give it a class B network. It goes out, it scans every single machine in the class B. Okay. If it exists and it's vulnerable, it automatically roots it for you. Goes and roots the next one, roots the next one, roots the next one, and then hands you back a nice list. It says you scan 65,000 hosts. You owned 150. Here they are. Have a nice day. Okay. Um, so, uh, you're, you're going to get hit by script kiddies just because they scanned your part of the network. Okay. If you're on the at home network, you see this every day. Okay. You're targeted by worms, which are slightly smarter than script kiddies, but they're, but they're, but they're fully automated. And the nice part is automation, the level of automation in most forms means they really aren't that bright. Um, they're, they're, they're, they're generally, you know, they're generally looking for very specific things. We can defeat the worms with hardening because worms don't have any ability to adapt. I mean, it's like script kiddies, but yeah, worms don't have any ability to adapt. If they, if they find themselves in a system, they thought they were supposed to be root and they end up as user, you know, as user, not root. Um, they often, you know, can't do anything. They're not, they're not set to say, Ooh, I don't have root. What do I do now? Um, they just, they just get pretty stymied or, uh, they're also easy to defeat because you can do things like change headers. So they're like, you know, they're like, I'm looking for a woo box, you know, for a woo FTPD built on this and then built with this version. It's a different version. Must not be vulnerable. Doesn't even try. Just, just says, must not be vulnerable and moves on. Um, a lot of that's just for speed, but you're getting targeted by worms. Um, by the way, I guess I shouldn't have to answer this. I shouldn't have to answer. You shouldn't talk about this slide at a DefCon conference. Why are script kiddies rooting your box? Well, they want it for everything you can think of. They wanted to run IRC bots off of. They wanted to run an IRC server on. They wanted to, uh, to put up files and, you know, they wanted to use it to exchange DivX movies or MP3s or, or, you know, I don't know, maybe some girl's number. Um, you know, uh, there's, there's like, okay, one number that's passed around among them all. It's fake. She changed it months ago. Stop it guys. Um, um, they wanted to use other machines. They, they want to, they want to use it along with 150 other hosts they got from that auto router to, uh, to fire off, to, uh, to, to, uh, DDoS some site, who knows which one. Um, they want to brag about how many machines they've owned today. Um, and, uh, you can come up with any other use. Anything you want a box for, they want a box for. Anything that you, uh, anything you can think somebody might want a box for, one of them probably wants a box for that. And I, the thing about being a script kid is it's really, really easy. Any of us can be one. We have to drop a lot of clue and then just go and start downloading, you know, scripts from, uh, scripts from, uh, from the internet. Okay. Uh, Bastille, how's it work? Bastille is a, like I said before, we're turning stuff off. So first is try to minimize points of entry. Okay. Remove attack vectors from attackers. Okay. One possibility is turn off network daemons. Okay. We all, we've all seen this. Just about every single article on hardening says, you know, we're going to turn off all the network daemons. Another part is, um, we'll take the, we'll take programs so if, if, if somebody steals an account on the box, maybe because someone was using Telnet at this conference and their account was stolen. Um, you know, we want to actually turn off the, uh, we want to, we want to take the programs that they could, that somebody could access with a stolen account. Um, and if, uh, if any of them have privilege in us, you know, if they had a vulnerability, could give that privilege away. And maybe we'll, maybe we'll shut them down. Maybe we'll take away their privilege. Maybe we'll configure them so they're harder to hit. Um, um, and that's the, that's the other side of things. Um, a lot of times, a lot of times what we're trying to protect against isn't, isn't just someone who remotely, remotely hits your box. It's the person who gets to your box through someone. It's something else. Maybe they got in through the web server and that gave them user web, but maybe they stole, maybe they stole a password. Maybe they stole a password during a Telnet session. I did a, I did a talk at Black Hat on, on securing, on attacking and securing FTP. And, uh, somebody raised their hand at the, at the end of the class because I talked about how FTP sucks because you lose your username and password if you're logging in like that. And he said, actually, during your, during your talk, I stole, uh, I got, I got three accounts and passwords from people FTPing on the wireless network. So, anyway, so, so stolen accounts happens, especially with clear, clear protocols. So, there are set UID programs on your box, um, and they, what they, the, the general purpose of those things is to let people who aren't Root do things that only Root can do. That might be doing things like mounting the floppy drive. Um, it might be doing things like changing the password file to edit your own password. Um, but in general, these set UID programs give an ordinary user Root privilege for something very, very, very specific. And, uh, it's, uh, it's bad if there's a hole in one of them, a security vulnerability in one of them because often a non-Root user gets Root just straight out of that. Are there any questions? Am I going too fast? Not too fast. Am I going too slow? No? Okay. Okay. Cool. Um, does Bastille work? Or, more importantly, does hardening work? Okay. Hardening hasn't taken, hardening hasn't gotten extremely popular just yet, at least not in, I don't think in, in a lot of the mainstream areas. Um. Well, Bastille is a simple hardening script. It was something that was written because I went and did an audit of, of Red Hat 6.0 and wanted to kind of share it. Um, and it was written before either most or all of the vulnerabilities in Red Hat 6.0 were discovered. And it could either stop or contain just about all of them, which was, which was pretty cool. I mean, I'm not trying to, I'm not trying to toot Bastille's horn or anything like that. I'm trying to point out this is, you know, whether you're doing it by hand or you're using a program to do it, this stuff is extremely effective. Um. Vulnerabilities in Red Hat 6.0. Bind had a remote root. Okay. With that case, we either turn bind off for you. Okay. Or, um, we could run it as a non-root user stuck in a cheroot prison, which is a little directory. It doesn't have much in it. Okay. And you can't really escalate privilege from a cheroot prison if you get stuck in there as a non-root user because there's nothing around. There are no vulnerable programs around generally to exploit. So, we could contain bind, which was kind of cool because there were some pretty, there were some pretty fun worms running around. Um. That, uh, you know, if any of you have Red Hat 6.0 or you're on CTF and they just gave you Red Hat 6.2, um, then, uh, you're probably getting hit by bind attacks and, uh, we could, we could at least contain them. Um. Woo FTPD. Um. Um. Darn it, I have a whole talk on vulnerabilities in Woo FTPD. Um. Uh. We were able to, we could, we could turn it off. We could shut down particular modes and basically do a, do a little bit of hardening to make it harder just to, just to leave it, you know, leave it so it doesn't get hit. Um. User Helper was another fun one. It was a, a local root exploit. Um. It was a set UID program. If you were on the box already, you could get root out of that. You could shut that off. LPD and Sendmail had a weird interaction. And again, those could either shut off or we, we made it so the, the big issue is generally you came in through Sendmail. And, uh, it turns out most of the boxes running Sendmail don't actually have to run Sendmail on the network because they're not receiving mail. They're just sending it back out. So, uh, you can turn that stuff off. Dump and Restore was a great one. Okay. I, I talked about what set UID programs do. Dump and Restore were programs that could be run by anybody. Okay. They were set UID roots. They gave you root access on it. They, they gave you, they gave you root abilities on the box so you could run backups. And it's really nice. You want to let people run backups. But you don't generally want to let ordinary users run your backups for you. You don't want to let the web server run your backups for you. Just leave that to sysadmins. So we could turn those off and generally recommend it very strongly that we did. And so if you ran it, if you ran Bastille in Red Hat 6.0, 6.1, 6.2 when each of these became, when each of these had vulnerabilities, you got past them entirely. GPM was another one. If you were on the console, you could get root out of that. And again, we turned it off and told people to turn it off because most people don't even know it's running. And, uh, and, uh, they're not using it either. Y'all having fun? A little bit? Okay. Uh, no streakers have come by yet. I'm sorry. Um, we missed the one in NMH. We missed the one in NAN. And those were hard. So, uh, we just missed them. Okay. So one of the things I wonder is who the heck is using Bastille. I have no idea how many people are using it because people just download it. They download it from us. They put it up on websites. And other people download it from them. So we have no idea. For a while, Mandrake self-taught their distribution. Been talking with Red Hat about integrating it. And they're actually getting better in general. Um, SGI was selling those appliances. Anybody here from Guardant? I've heard some appliance with Guardant actually uses Bastille. We know that probably somewhere around 100,000 people use it. We don't know how many because we just don't have any way to track it. But there are a lot of people using it. It turns out to be pretty useful. Um, I want to show you what kind of capabilities we had and where we're going with it. Um, the first is in our recent 2.0 release, we started making Bastille smarter. So it wouldn't ask you questions about stuff that wasn't on your system. It's still going to do that a little bit, but not very much. So if you haven't installed a package, it shouldn't ask you, you know, can I harden this package? If it doesn't find sendmail, it won't ask you sendmail questions. If it doesn't find programs to set UID route, it won't ask you if it can turn them off. Um, we got the whole GUI thing going on, which was, as I said, really nice. It's really good for, um, really good for making things easy. Um, and we made our configuration file. We made it so you could reuse the thing. So what you do is you can take Bastille and you can run it once. You can answer all the questions. You can take that config file and then go and carry it over to 100 identical lab systems. We work on other things. We're trying to make it so that you can take a configuration file, like, you know, from Red Hat and try to use it on HPUX or something. But that's really hard, actually. Um, um, what I want to do is show you what we're doing, um, and what we're going to be doing. Uh, if you're hearing this talk, I'm going to tell you about the 2.0 release, about what we're releasing in the next two days. Um, there are beta releases up, but go for the stable one. Um, but, you know, I'm going to tell you what we're doing in the next few days and then what we're doing for the next few months. And the next few months is where I start taking a lot of new content, a lot of new hardening steps and trying to integrate them. Um, we're also trying to get on Solaris, um, because they really need the help. Okay. I told you we can set up a firewall. There's a firewall in the box. It can be default and high, which is nice and strong. Um, it can be for a single machine or it can be for a masquerading network. Um, they're adding a DMZ to that right now, so it's, it's actually, uh, it's actually pretty useful. Mandrake, MandrakeSoft actually shipped a firewall that used Bastille, Bastille's firewall as the, as the firewall, as the main firewall program. Anyway, this is kind of nice because if you have a machine that you've hardened or you haven't hardened as much, the firewall adds an additional layer of protection, catches a lot of the stuff that you might have missed. Um. Okay. Well, one of the things I'm, one of the things I always get asked is, well, wait a second, you're going to tell me about all the stuff you turned off. You put up a firewall. You don't need to turn them off. Well, the issue is the firewall might fail or the programs we're turning off might accidentally come back on. So it's kind of the best, it's, it's a really good idea to do both because it's called defense in depth. And the idea is basically if you've got, you know, if you've got anything that you're trying to protect, it'd be really nice if you could protect in, like, say, two, three, four ways. Because if any of those layers fails, okay, if any of those layers fails, then you have another one protecting you. Okay. Firewall vendors, you know, from yesteryear wouldn't love me saying this, but, you know, this is, this is kind of, this is, this is a basic thing that's really, that really makes it a lot harder for someone to nail your system. Okay. So the next time that someone says, oh, there's been a bug in the, there's been a bug in the Linux firewall encode and you can send anything through, you won't have to necessarily, you know, you're hardening still. You're doing both. So you won't have to be like, oh, my God, I'm screwed. Okay. Um. We do things, we do a, we do a file permissions audit. This is, I think, I like to talk about the most boring areas of computer security. This is, you know, hardening a system. This is number three. It's three on the top ten. Is, is definitely edited, screwed on with file permissions. I was really going to try and do a talk this year on, on, on how bad file permissions can let someone root your box really easily. I know it sounds boring, but I'll give you the real live example. I, uh, I found a system where I got in as user nobody because they, somebody had set up an R host. They got me in as user nobody. And it turned out the file permissions on the, on the, um, the file permissions on the crontab directory where all the, where all the cron, where all the crontab files are were really weak. So any, so, so user nobody, um, along with a few other users I was able to get later on, could write to them. So if you can write to the, if you can write to the crontab directory, what do you do? Well, you change root's crontab file. One minute from now. Okay, root's cron, cron's going to run. It's going to say, ah, root asked me to bind a, uh, to bind a shell, a root shell to port 666. Yeah, okay, I'll do that. And it runs. And, you know, all of a sudden now you tell them that it's the system and you went from nobody to root just because somebody had a, just because the vendor of this operating system originally set really weak permissions on a few directories. Um, um, so we do a file permissions audit and try to stop them from doing really dumb things like that. Um, I told you about set UID. Um. There are, uh, one of the examples I often use is user root, but I'm going to name another one. I remember I was working at a, I was working at an all Solaris shop, um, a while ago. And, uh, and I wanted, we knew we had a bunch of stolen accounts. We were a university. Happens all the time. People are using telnet. We can't take telnet away. So their accounts are going to get stolen. But we started tracking some of the stolen accounts. And, uh, and so I had a pager that paged me whenever this guy came on with a given account name. Okay. And so, you know, I got a page one day and I ran over to my terminal. I'm sitting there watching his session. And the guy is, you know, he's, he's sitting here compiling. He's, he's brought, he's, he's FTP'd an exploit up. And that exploit is against pmconfig. Okay. Or pwconfig. pmconfig. It's an exploit against pmconfig. Which on Solaris lets you set the power management features. Lets you do things like suspend the machine or lets you tell it to, to spin down the hard disks or whatever. It's, this is, okay, so this program will set UID root. So if, if it was broken in some way and you could run it, you'd get root. This program was set so everyone on the, everyone on the system could run it. Okay. So he was bringing an exploit. He was going to, he was going to run the exploit. The exploit was going to run pmconfig. He was going to be root. I was like, that shouldn't be set UID. There shouldn't be anybody running on that besides the system. Tappity, tappity, tappity. By the time he finishes compiling his exploit, I've already turned off set UID. He runs his exploit. It doesn't work. He's like, okay, it must be broken and wanders off to the next system. Okay. The alternate version of that scenario is we haven't done a set UID audit. Even one. Like right there as the guy's there. We haven't done any kind of set UID audit. I'm at lunch, you know, no pager maybe. And, and what happens? Well, he runs his exploit and he causes a very bad day. Because the last time we had a root compromise on that system, we took, I think it was 46 man hours. Just to get the, just to get everything going again. That's not a rebuild. That's just, that's just straight. That's, that's just straight from, from, from where we were. Make sure that we weren't totally vulnerable on 8000. Different ways. Okay. PM config never should have been set UID root. There's no reason that you need your ordinary users to be going and changing the power management features on, on a server. I, I can't think of a single one. Okay. If you've got a user who needs to use that, give them the root password. If you don't want to give them the root password, use sudo or something like that. You know. Give them permit, give them and only them permissions to use it. Put them in a group. Um, so the set UID audit actually saves a lot of people's bacons this way. Even though, you know, being a permissions area. It's, like I said, really, really, you know, really, really boring. Um, I've given you a few slides real quick. Each of the set UID programs that we turned off in the first version of this deal are here. Um, there's a star next to them if they've been vulnerable. Okay. So you can just kind of, you can just kind of see it's, it's two on this slide. Well, it's, it's mount, mount, new mount, dump and restore. We're all vulnerable out of those. Trace route. Trace route. Yeah. Trace route of the vulnerability. You're right. I should update that slide. Trace route of the vulnerability. The, uh, that, that LPR, the, the, I think the entire LP suite, but at least one of the programs in the LP suite had it, had a vulnerability. The R, the R tools had a vulnerability that was, uh, was through some library they linked to. Okay. Okay. Um, other stuff this deal does, we're gonna, we're gonna do, we do, we do a bunch of stuff we call account security. Anything to protect the user's account from being stolen. Do things like turn things off. We, we do things like turn things off. We don't let them use crons. They can't go and run cron jobs necessarily. Okay. Um, we go and try to, we go and set up pass, so that if, so that if the user goes on vacation for six months, they're, you know, uh, well, six months at the end of that, they're, they're, uh, you know, maybe their, their password expires and, and somebody else can't steal, can't use their account while they're away. Problem with accounts is when they get stolen or people run away, they don't notice and they never tell us. So, um, other stuff, we make sure that our, that RSH really doesn't work. Because RSH, our login, they, they really stink. Um, uh, just general stuff. Uh, boot security. I have a paper on my website. Um, I have a paper on my website that tells you all the different ways you can root a Red Hat box. Um, all the different ways you can root a Red Hat box if you have access to the keyboard. Um, it's, they're sizable. So, Bastille can protect some of them. We can protect the, uh, you know, all of the, all of the five minute, five minute routes and one minute routes. Like where you, uh, reboot a system, you type Linux single. And it boots in a single user mode and says, here's your shell. And if you block that, okay, we block that. But if you can type at that prompt at all, you type, uh, Linux init equals bin bash. Instead of running the normal init program, it runs a shell as root, hands it right to you. Neither of those give you instant root on the Red Hat system. It's been there for years. They're not changing it. Um, so Bastille will fix that for you. This is really, really great when you're hanging out at a conference and you put your laptop down for three minutes. Okay. Um, what else? When you lock down INETD or XINETD, turn off things like Telnet and FTP. Telnet and FTP are bad. They're really bad. Please don't use them. Please try to get away from them. SSH is good. Use SSH. Okay. Anything that Telnet and FTP do, um, SSH mostly does. Except for anonymous, except for anonymous, you know, anonymous file transfer. And you can do that with a web, with a, with a web server. So, don't use Telnet and don't use FTP. Please, please, please. Okay. Um. One of the things you'll notice as we go through here is we're turning all kinds of things off left and right. Okay. If you look at, if you, if you look into my papers on hardening, one of the things they all do is they say, okay, we're going to turn off this functionality, we're going to turn off this functionality. The idea is the less you have going, if you've got a system with one or two purposes and you can make it only serve those two purposes, well, it's really great. Because if there's functionality that ends up having a, that ends up having a security vulnerability in it, you, uh, you don't get hit because you didn't have that functionality turned on. Or you had some kind of restricted access on that. And that goes a long way. So, this is just applied minimalism. Go small. Less stuff. Okay. Um. We do some stuff with PAM on, on Linux systems. We're doing, we're going to be doing, doing stuff with PAM on Solera systems. Uh. The file size limit you see there is something that we're, that we're, that we're currently debating. Like, because people are starting to, you know, transfer up DVDs to their, to their, uh, hard drive and they get really upset when we say, oh, God, you can't be making a file that big. You must be trying to starve the hard disk. And it's like, no, no. My hard disk is 140 mags. Not going to happen. Um. Lots, yeah? Is the purpose of the file size limit to keep people from compiling exploits? Is it, I'm sorry? Is the, is the . Is the purpose of the file size limit to keep, keep people from compiling exploits? No, actually the purpose of the file size limit is, is for DOS attacks. There are a few, there are a few things that, if you go and take an old version of unix, there are a few things you can do. You write a simple program. which, you know, there's a whenever, almost all the time when a program wants to run another one, there's something called forking and exacting. Forking means it splits itself into two identical pieces and then one of the pieces runs some other program. The other one continues going on. Well, you can do this fork where you split into two pieces. You can have each of those fork and split into two more. Now we're at four. And fork again. Okay, now we're at eight or we're at sixteen? We're at eight. Okay, then it goes, you know, then they all split and it's sixteen and then they all split again and it's thirty-two. Well, if this continues on, if all this forking continues on, you end up with tons and tons of processes and the system goes to start another program and it says, ooh, I can't start another program. I have this table of all the processes on the system and it's full. So, you know, the next web connection that comes in won't work because your web server goes to start another web server and it can't do it. Or the next user logs and won't be able to get a shell because, well, that's another process and you've already exhausted the limit. The file size issue is the same thing. If we say people aren't allowed to write files bigger than ten megabytes or bigger than a hundred megabytes or, say, a gig, then we can stop people from, you know, we can stop one of the other attacks, which is to drain the entire system of all its hard disk space, leaving, well, everything broken. Any other questions? Y'all having fun or you want to go faster? Slower? Yeah, question. Question. Oh, the stuff that's basically versions of operating systems. We work on a whole bunch of operating systems. So we're covering Red Hat 6.0 through 7.3 and some of the stuff that's specific to one of those won't get asked on the ones it's not specific to. Okay? Like I said, one of the issues is we're trying to make it so that if you don't tell them that enabled, we won't ask you about turning it off unless you're trying to run us in policy creation mode. Okay. Yeah, so logging, we put lots of extra logging. Yeah, yeah, in the back. Could you list what operations you're... List all the ones we're boarding to now? Or we're on right now? Red Hat 6.0, Red Hat 6.1, Red Hat 6.2, Red Hat 7.0, is there a 7.0? 7.0, 7.1, 7.2. Mandrake 6.0, 6.1, 6.2, 6.3, 6.3, I think there was a 6.3. 7.0, 7.1, 7.2, 8.0, 8.1, 8.2, I think there might be an 8.0. 8.3, and if it is, we're on it. Debian Current, SUSE, whichever the slide, 7.2, Turbo, 7.3, HPUX, 11.0, 11.11. That's what we're on. Okay. Yeah? Are the configuration files that I mentioned earlier universal for Red Hat 6.0? The configuration files that I mentioned earlier are universal to Red Hat, to the universal among all the different Red Hats, et cetera. The issue is that what we've got right now is if you answer all the questions, if we can get you to answer all the questions for, say, Red Hat, then you'd be covered across all of the Red Hats you're running. If you answer the questions for Red Hat 7.1 and you run them on a Red Hat and you try to use that configuration on a Red Hat 7.2 system and they're similar enough, it'll work. And it'll tell you if it's not going to work because we're checking for that. Yeah? What happens if you have Red Hat 7.0 and then we have a . And then we want to upgrade to Red Hat 7.3? Upgrade path. Oh, darn it. You know, there's this dirty little secret in the Linux world, and that's that most of the RPM-based operating systems don't exactly upgrade easily. I mean, you can do it, but stuff starts breaking. This is not what the vendors say, but what I tend to say is if you want to upgrade a, can everyone hear me? Okay. I tend to say that what I try to say as far as the, damn, that's loud, what I try to say with upgrading is, you know, whenever I upgrade my systems, what I do is I'm partitioned. So I've got a home partition and I've got other partitions or maybe just one other partition for everything else. Okay? So what I want to do is if I'm going to upgrade, I actually just do a fresh reinstall on the normal partitions, I leave my home directory alone. So still keep all my data. This is, you know, this is one way to do it. It's what we do on a major OS. I don't know if anybody's tried going from like Solaris 2.6 to Solaris 2.8, but I think there might be an upgrade feature. I'm not sure how well that works. That's just, it's four years apart. I don't know. I'm not sure the vendors are really that great at upgrading. So with that said, we have something that'll let you, you know, one of the issues is you can undo Bastille and, you know, do your upgrade and redo Bastille. Another is you can make the upgrade, you can make the upgrade and rerun Bastille and it'll use your old configuration file. But really, OS upgrades are just really hard to do. I mean, I don't really think most of the vendors get it right so well. And stuff just breaks. Okay. I have a list of stuff we turn, I have a list of stuff we turn off. If it's starred, it's had a vulnerability lately. I think Samba should probably be in that list. GPM, the news server, maybe one of the routing games had a vulnerability. It turns out what I'm trying to do with these stars is I'm trying to show you how much of the stuff, you know, has had a vulnerability in the last three years. Okay, if you're running a three-year-old operating system, you've probably nailed. Okay, if you're running a one-year-old operating system, some of these you got hit by. I mean, there are tons of vulnerabilities. That's why we patch, which is, I think, the number one most boring area of computer security. But that's why we patch and it's why I try to get people to harden your systems. Okay, especially because there are lots of vulnerabilities we never hear about, or maybe some of you do, but I don't hear about until they get made public, maybe a year later. In the meantime, there's no patch because nobody knows there's a problem, so we don't patch it. Okay, hardening will actually, hardening has some chance of actually blocking the exploit anyway. Okay, even while you're still vulnerable. Does that make sense? So that's, I guess that's the biggest argument for hardening is it's just, you know, there are lots of vulnerabilities you may or may not know about, and you may, heck, you may be lazy about patches, like 80% of us, and so you may be getting, you may be vulnerable to a bunch of exploits, or at least to one. You may be getting a major exploit at any given time, and it would really rock to have a hardening script or to have hardened the system personally so that that stuff doesn't work. Okay, some of the stuff we do, I'm gonna go through the rest of the hardening steps. Send mail. We try to set send mail so it doesn't listen on the network because if you're just sending mail off the box, you don't need send mail listening on the network, so we can turn that off. We remove those recon commands that spammers can use expn and verify to find a case. Hound's in a box. Yeah, in the back. You a Qmail guy? Anybody in here write Qmail? Okay, okay, two, that's great. Okay, why don't we replace send mail with something decent like Qmail or Postfix? Yeah, that's a really good idea, actually. We try not to install software right now. We try to just harden what's there. Postfix is making it onto Red Hat and Mandrake, which is kinda nice. I'd love to see it. I think the Qmail was also added to the base distributions. We haven't tried configuring those because we're trying not to install software because you wouldn't believe how amazingly hard it is to help people install software and to do it in a secure way. The people who really, really know their stuff say, your particular method of installing software isn't good because maybe you're not getting vendor keys, maybe you're not able to check with PGP on old operating systems, maybe you're not able to check with PGP on all the non-linuses. The people who are really new to this get upset because if the installation, if we tell them how to install software, often they don't get it right. And they get really upset and they send us email or they just get rid of Bastille and we haven't helped them in the slightest bit because they got all upset because they couldn't get a package installed. But no, I think you're right. We should at least be putting a screen in that says, hey, run Qmail or Postfix because SunMail's had a history and these guys really haven't. Good enough for the alternative MTA zealots. I am one, so yeah. Okay, we're gonna table questions till the end of the presentation. Anybody hate that idea? Okay, so we're tabling, cool. Okay, other stuff we do with SunMail, we're gonna run it as a non-root user via INETD or XINETD. If you do a bunch of permissions changing, you can actually do this so SunMail does get hit. It wasn't running as root, it was running as mail. So somebody can actually go and read everybody and change them. Everybody's email, but they don't have root on the system. This is a darn useful thing, so we're gonna start doing it. I'm gonna have a Postfix slide, but no Qmail slide. So I always try to recommend the other MTAs. Postfix is a nice easy one because it's getting installed on a lot of operating systems by default. The Postfix and Qmail people will probably be holding a small fight outside after this talk. Or maybe we can just all go out for beers. So yeah. But yeah, think about going on all your systems. Think about going with Postfix or Qmail. I think there are books on each of these now. There are more and more people who are trained on them. It would definitely be great to be on an MTA, on a mail transfer agent that actually was written with security in mind from the start instead of with the idea that we have to make 50 different kinds of mailing systems all work together. DNS bind. Historical note, we secured bind before there were a bunch of remote root exploits. Before the worms came out that went around exploiting bind. This is not a brag. This is a, hey, this is a really good idea. Harden it before you find out that it's vulnerable. So when you do find out that it's vulnerable, hopefully you haven't already been hit. Okay. Things that we do to bind. One is we churn it into a little directory that if somebody breaks into bind, they can't get out of, which means they can't really do much on the system. Another thing we do is run it as an independent user. This is just about containing it. We're trying to stop, if someone does exploit it, then we're trying to stop them from getting anywhere. This is some other stuff we do. We make it so that if you've got a bind server that's just for your, let's say, your company's network or your home network, other people outside of that network can't go and query and ask it questions and thus possibly pass it attacks. All they can do is ask your DNS server possibly about your zones. This is a really useful step. This is the stuff from whenever I do attacking and securing DNS, these are the steps that end up in there. Do things like, the zone transfers are only supposed to use by secondaries, but zone transfers are what people like me who are doing pen testing love, because you go and you ask some huge domain, hey, just give me everything so I can read through it all and to my heart's content and figure out everything I can about your site. Well, we should definitely shut this functionality off, so we do. We also do things like, we're gonna choose a random version string. So if you've got a worm out there that's running around and it checks and it says, oh, you've got bind. I'm looking for, I'm looking for bind, bind 8.2.1 servers. You're running an 8.2.1 server, but your bind server answers back, I'm bind 8.2.2. They say, oh, I can't do this, I can't exploit this one, so they don't attack. A lot of the worms, this is the way they work. They check version strings. Change your version strings, you don't get hit. Doesn't mean that we've actually saved you from being vulnerable. You're still vulnerable. You just get attacked less often. Less often means, unless you're somewhere here, which is an extremely hostile network, that you generally, you might never get attacked by, you might never get attacked by one of these worms. You might never get attacked by one of these scripts. Script kiddies. Another thing is views. Views let you do, views are really cool. Most people don't know about them. Views do what SplitBrain or SplitHorizonDNS did. They give people who are on the inside of your internal network, the whole list, everything that's in your DNS files, okay? And they give people on the outside, just the machines that they need to know about. Just your externally accessible machines, like your web server, your mail server, your DNS server, your FTP server. But they don't tell about where all the printers are. So no one ends up using your printers for bounce attacks. More on that some other time. Apache, we try to turn it off. We try to bind it to a local, to the local interface. The idea being, if you're just using your web server as a development platform and nothing else, then maybe you don't need it to listen to the network. We turn off different functionality on Apache, like following symbolic links. We turn off things like server site includes, CGI scripts. Most all the, most all of the, The ways that people nail a web server actually isn't through the web server itself. It's through CGI scripts or whatever that's on the box. And if we can disable them, then they don't get used. The last thing is we're going to try to remove as much of the weird functionality that most people don't know about from Apache because often if you remove it, there's a lot of stuff that we all have on our web servers. We don't even know about it. Just weird modules that the vendor thought would be really useful to us. And they're probably useful to us. But if they aren't, we'll turn them off for you. FTP. FTP stinks. FTP really stinks. I told you about usernames and passwords being stolen. FTP servers get rooted all the time. Why else is FTP bad? There are nice tools out there that let you steal people's files while they're in transit. I recommend trying to replace it with SFTP. It's part of the SSH suite. There are free clients. It's for Windows and Mac and Unix and web servers. I'm losing tons of... I'm losing people off the side. Am I really boring y'all? I'm boring? Okay. FTP, one of the things we do now is we'll either turn off normal authenticated access or we'll turn off anonymous mode. This is all the stuff that I came up to add to that because I had to write a paper and do a talk for this conference and in the process ended up making a nice, nice, long list. Okay. Anybody who wants to can download that talk and find out why we're doing all this stuff. But basically all this stuff is is removing functionality from FTP from the FTP daemon that you may not be using. Okay. Well. Eight. So let me check on time, see where we are. We're actually doing fine on time. Are there any questions? Does anybody want me to go into detail on this slide? I thought we'd be out of time by now. Yeah. The question was, we'd see Venema had a secure port mapper called RPC bind for Solaris. Do we use anything like that? Actually, I think the Linux vendors are, we're going to have to install that, I think, or we're going to have to try to at least recommend it on the Solaris systems when we're supporting those. On Red Hat systems, it's already there. They're already using a port mapper that allows access control. Yeah. You said you're going to be incorporating the FTP stuff back into the FTP. I think you referenced it in your other talk. You just brought up the best deal. Is there going to be a list of parts that you didn't do that you're going to have to manually add? Yeah. Actually, the question I just asked was, the question was, you said you're going to be incorporating all the stuff you did in your FTP talk into best deal. What about the stuff that you're not going to do? We actually have a nice feature called the to-do list, which says this is all the stuff that we didn't feel confident doing on our own, like maybe installing QML, guys. These are things you should do, and they'll tell you what to do, and maybe they'll tell you how. Any other questions? Oh, stop leaving, guys. I can't be that boring. Yeah. Yeah. I was talking about putting a patch in a churro, that's a really good idea. I think I may try to do that. We haven't gotten to it yet. We haven't gotten to it yet. Any other questions? Yeah. Mac OS X. Mac OS X. Okay. If anybody has deep pockets in here, the first person to buy me or lend me an OS X capable machine gets a full port of best deal to OS X. I don't have a machine. I don't have one that'll do it. So, you know. The other possibility is if somebody who has one decides to help us port it, then we'll get one. So, anybody who either has deep pockets, has a machine they wouldn't mind lending to somebody, or, heck, you know, wants to help us port, send me an email. Send me an email. Seriously. Get on the discussion list if you want to help us port. I don't have a machine, so it's going to be, once we're done porting, it's going to be even slightly hard for me to certify it. Yeah, in the back. The client gets to do it. It's not only part of the system, but it's also part of the machine. The question in the back is Titan. No, no. Yeah. So, Titan is an auditor. Titan audits and then tells you what, you know, says, hey, you want to harden this stuff. It's actually a really good program. It came out way before us. They weren't ported to Linux when we came out, but now they are. They're doing Linux and FreeBSD and Solaris. Yeah, I think we're talking about getting some of the auditing functionality. The cool thing is the Center for Internet Security, writes, you know, distributes an auditing program for Linux and Red Hat, I mean, Linux and HPUX and Solaris, and soon AIX, and I actually write that thing, so there's some possibility that what we'll do is we'll distribute both together somehow and have the one audit and the other one fix. So, yeah. What about, like, adding accounts for individual services, like, so nobody is in the car? The question is, what about adding accounts? For different services, so that they can all run as, instead of running as root, they can run as that account. Or as nobody. Oh, yeah, or as nobody. We're trying to do that. That's actually the DNS, with the DNS thing, we add a DNS user, we run the DNS server as that user. The idea is, for everyone who's thought of running everything as nobody, what you really want is not so much everything running as nobody, but everything running as different users. So if anybody takes over one user to take over the DNS server, they can't necessarily use the, you know, they can't go and modify the web server's files, or they can't go and, you know, do stuff as, as the web server user. This can be really darn useful. So, yeah, we do do that. We're going to do it even more. Please do it yourselves. Yeah. Any other questions? Okay. Time's basically up, but, yeah, I'll take another question. Sure. The question was, we talk about password-protecting LILO. Yeah, we do GRUB, too. Yeah, and on Solaris, we're going to password-protect EEPROM, so you can't, you know, you can't stick a CD in even and boot off the CD. You can't modify the boot process on Solaris. Yeah, boot security is really one of the hardest things to do, but we can at least take some basic steps to keep off the one-minute routes and the five-minute routes that, you know, you get as soon as you sit down on the keyboard on one of these. Any other questions? Actually, I have one first, real quick. Do you all have fun at this talk? You all are kind of, you know, I've had people leaking out to the side. Okay. I'm happy. I'm happy. That's cool. Okay. Yeah, the question was? Contact. Contact info. Ah. At the bottom of that is a website. Okay? At the bottom of that is a website. If you go to that website, that's my website. It should have my email address. If you follow it long enough to my business, you'll find my work phone number. Don't call me at work just to harass me. I know I call, you know, I know I bust unscripted kiddies if they're in the audience. I'd really appreciate not getting phone calls. If you do call me, I'll just change my phone number, so please don't. But yeah. Now, on the other hand, if anybody wants to hire an independent consultant, hey, man, I'm there. So, but yeah, no, actually, that website I'm giving you there has a bunch of articles that I write in security and conference talks where I can, where I'm allowed to publish them. They'll be published on there. There'll be links to there. So, one example is, if you're in this room and you're one of the many people who asked me about the FTP talk that I gave here at UMist, the slides are at that site. The updated slides are at that site. So, any other questions? I think we should let the next speaker, let the next speaker get up here. So, I'll be around. You can all, you know, we can all hang out or whatever or we can all go and catch the next talk. It's all good. Thank you.