All right, if I could have everyone's quasi-attention here. My name's Humperdink, or as you can all see from the slide, my real name's John Miller. I'm the Senior Security Engineer for Covert Systems. We're a company based out of LA. And today I'm going to be talking on how you can secure your Windows Internet servers. What I want to hit on is a little of the old stuff, a little of the new stuff, and hopefully, what I really wanted to stress is no matter what Windows OS you're running or any OS, if you have good fundamentals and use common sense while setting up your server, you're going to be fine. So let me start off here with the first slide. Hold on, let me turn this mic off. Done and done. Oh, and there's my email address and a little thingy. All right, number one, anytime you have, like, let's say you guys are running an NT4 server and you're looking to upgrade 2000. Should you do that? Never. It is, like, one of the worst things you can ever do. I remember there were problems. There were originally issues with upgrading from NT4 to 2000 with leaving passwordless accounts and stuff like that. And so it always, whoa. My bottom went up. Always try to use a fresh install no matter what you do. Even if, let's say, you know, you're redoing your site, try to use a fresh install for everything. Or if you guys have, you know, one set server, do, like, a ghost image and just ghost image everything. Because I've seen a lot of people where they actually have a compromised machine and they just keep upgrading it and stuff like that. And the machine's still compromised. Always use NTFS. I see people out there running fat file systems on web servers and stuff like that. And you always screw up with the file permissions. What else? When you upgrade, your default security settings are not applied. So you have to go into the MMC, like, every time you upgrade and load up your security template and reapply everything. Make sure you have. The current service packs. A lot of times you might be, you know, a week or two late on stuff and stuff will get by you. A lot of companies I do audits for, this seems to be a killer on them. They're either running legacy applications and they don't know how to respond with current service packs and so they just let them go. Always, always test it if you're running something, this legacy that's dependent on it. And try finding the new solution. HF NetCheck is a great tool. It allows you from an administrator account on the network to run a check against any IP. As long as you have administrator access on that computer and it'll tell you what hotfixes are and aren't installed. And it'll give you the TechNet ID and you can go and locate everything online. More on file systems. NTFS or FAT. When you're running NTFS you get the actual file permissions that you don't get with FAT. So never, ever, ever use FAT. Services. I see a lot of people who decide that they're going to run, let's say, an IIS server. So when they go and they do the full install they figure they'll just install everything and either disable what they don't need later. Or, you know. They'll use the idea of, well, you know, I might not need SMTP on my web server but it never hurts to have it there. This seems to be a killer. Because people end up running things on servers that they don't know are actually running. Lots of people, when they do a default IIS install, will have an anonymous FTP running and just not know. That always seems to be a problem. Always make sure that you actually go through and don't install anything you don't need. A lot of, in a corporate environment, remote administration is always a problem. And so lots of places, if they decide to go with Compaq hardware, they use like Compaq remote insight manager, PC Anywhere, terminal server. More or less, you'd be surprised. VNC is very popular. You need to, before you actually install your server, you need to decide what you're going to run. Because if you want to set up terminal server, the time to do it is during the installation. Personally, I like using VShell, which does SSH and SFTP for Windows. It is not free. But it is a great program. It's available at vandyke.com. Okay, this is something. Like 99% of the people out there who run Compaq hardware, Compaq actually ships with their Compaq restore disk, which has Windows on it. When you actually use that server installation, it installs all the Compaq software, which includes Compaq remote insight manager and stuff like that. Compaq remote insight manager operates on port 2301. You might want to scan your machines for it. It is, in reality, a fairly insecure web server that there are oodles and oodles and oodles of exploits for that your local neighborhood script kitty can get a hold of. So it is the devil. All right. Next slide. All right. Now we need to talk about network configuration. A lot of places, if let's say you're running an IIS service, they'll decide to run Windows networking and just update the website, you know, via a network share or something like that. Any Windows machine you have that is actually physically touching the Internet should only be running TCP IP. That should be the only protocol. Use TCP IP filtering, which is, I mean, more or less it's a firewall built in. It's in the Windows. It's been there forever. Since as far back as I remember, NT4 has it. Barely anybody uses that. It's pretty straightforward. You just go to the advanced user settings on your actual TCP IP protocol, and you can set in what ports you actually want to allow TCP IP traffic go to and from on your machine. So if you're running a web server, and let's say you have Van Dyck's SSH on there. So all you have to allow is 22 and 80, and you can do, you can have people do SFTP uploads. You can actually SSH in, stop, restart services, and you can have people browsing the web onto that machine. So it's wonderful. If you ever get backdoored, it prevents a lot of problems with people launching services on ports that aren't applicable. Always NMAP your servers, port scan them, to make sure you don't have extra ports running. A lot of times you'll go into places and they'll be like, that's a web server, you know, it's just running web services. You scan it, it's running all sorts of crap. That just kind of gives you an extra level of protection to make sure it's okay before you put it on the internet. Never, ever, ever put an IIS server on your web server. Your corporate domain. For the sheer fact that if there's one Microsoft server that is the most compromised, or actually it's probably the most compromised server ever known, it would be IIS. And so by doing that, you're allowing people to actually compromise your IIS server, which is more or less inevitable. If anyone's determined enough, they can compromise an IIS server, no matter what you do. And then it gives them a stepping stone onto your entire domain. So always put your IIS server on an external IP, on a DMZ, and just leave it alone. Another way I personally like to do it is you can put in two Ethernet cards. You can do a private card and a public card. And then just do, you know, SSH or whatever on your second Ethernet card. So the only port that anyone sees from the web is port 80. It's also great, I love telling people this, that, you know, I've seen people running Microsoft FTP forever and ever on all their IIS web servers because, you know, hey, we need to update with front page and stuff like that. And before, before SSH. SSH for Windows, like, the best way to do that was, like, burn it to a CD and walk it over to the machine and upload it. So, I mean, having a second Ethernet card is great. Especially if someone's, if you have it on a totally separate address space. If you have it on a separate class C or something like that. If someone's scanning, they won't even find it. Using the Microsoft Management Console. Most people do not use this. I wouldn't be surprised if half the people in the room do not know what the MMC is. More or less, when you go to computer management on your NT server, all that is is a snap-in for the MMC. The MMC is a mystical, magical thing you can use to do almost anything to your Windows server. You can access it by clicking your start icon and clicking on run and typing in MMC and it will pop up. It's a great, great tool. What is it? You can... Through it, you can manage your security templates, which allows you to do, you know, user policies, ACLs, what else, you know, account restrictions, everything. Never use a default Microsoft custom security template. Either you can take one and customize it to your own needs or you can build one from scratch. If you're doing this in a corporate setting, you need to establish standards. For what you actually want these servers to do. And build a security template for, like, each machine based on an original security template. And then every time you build a machine, apply that security template. Security configuration. Password complexity. I can't tell you how many times people out there who have web developers and email users, people do not apply password complexity rules through the security template. So you have people with passwordless accounts, people with dictionary words and stuff like that. You can actually, through the MMC in your security template, set complexity rules. And always make sure that your passwords are at least a minimum of eight characters long. There is... You can also do the settings where your PDC, or Active Directory Server, will actually remember passwords so they can't be used again. So if your machine does get compromised and somebody obtains the SAM file and cracks it, hopefully, by the time you set your expiration date to, by the time they go back, the password won't be valid anymore and it can't be reused. Event log access. Lots of people have, especially with NT4, they did a lot where you could have public read access to your event log. And by your event log, I mean that's your security log, your application log, everything. So always go through a series of registry changes you can find to change that. Define permissions for services. Most people don't do this. Which is funny, though, because on almost every Linux machine, you always have, you know, Apache is running as nobody and stuff like that. People don't really define permissions for what everything can run as. So you have services that don't need it running as administrator. Always rename your administrator account. More or less, if you have anyone who knows anything, it won't fool them, but it will stop on a lot of stupid scanning tools that just scan for passwordless administrator accounts or administrator accounts with simple passwords. I was... I like to actually create a new administrator account, and you can do registry changes to disable your original one. Common sense. With IIS especially, people like to just do a default configuration, and everything's up and running, and leave it at that. What you need to do is actually go in and think like a hacker, and what they actually exploit. Um... With a lot of stuff like Code Red, you used, um, IDA, um, crap, script mappings and stuff like that. Delete them out if you're not using them. Um... Most hackers, when they go and actually compromise your machine, the only way, well, the easiest way, and they can do it directly from a command line to upload files to your machine, is to use TFTP. Delete TFTP off your computer. If... Number one, if you're configuring, like, Cisco devices or anything that uses TFTP, from a web server, you're probably not gonna use the Microsoft default one. Go out and download the Cisco one. Um... And also, a great thing you can do is rename your, your, uh, command prompt from CMD to something else. So if, let's say, you know, a new, uh, a new worm comes out that, uh, does directory transversal or something like that, and actually launches a command shell from a web browser, if it calls for command.exe and your command is, like, you know, shell.exe, you're fine. Um... Do you really need Microsoft TFTP? No. Rename your command prompt. Um... What I like to do with, um, with IIS web servers is do not put them on the same partition as your system files. Uh, just create a second, uh, a second partition for, just for your actual web hosting. Um... The nice thing about it is it's easy to back up, it's easy to maintain. If you ever need to restore something, you can just blow away the old partition, put in the new one, and you're fine. Um... Yes, people running IIS on Exchange. Um... I would say the most important, uh, computer in any corporate structure is the mail server. Everybody uses email. Um... When email goes down, productivity comes to a halt. Uh... Do you really want IIS running on your company's most important server? Um... IIS is compromised a lot, and do you really want to risk someone compromising IIS and reading people's emails? Or, at the very least, halting your email server. Um... Outlook, Outlook Web Access on, um, on Exchange 2000 and Exchange 5.5 It's beautiful. CEOs love it, because they can check their email when they're on the road. And it's pretty, and it looks like Outlook. But then again, you're doing the exact same thing, where you're running an IIS server with not only... Not only are you running an IIS server on your e... on your email server, you're running an IIS server that's capable of changing user passwords. Okay? It's... It's just not a good idea. Um... You can go to, uh, Microsoft.com Microsoft Security Alerts website. It's really a great website. Not that many people know about it. It's, um, Microsoft technet slash security slash notify.asp They will actually... Microsoft will notify you when new security alerts come out. If you're not on bug track or something like that. All right. Um... Configuration for IIS 4 and IIS 5. Um... Try to run base services. Don't run SMTP or, uh, FTP. Um... Get away from that. These are on... On an entire server. If you're running a sole IIS server, these are the only services that you need running for that machine to actually work. You need your event log. Your license logging service. Um... NTLM security support provider. Um... Your RPC service. Um... Your NT server. IIS admin service. MSDTC. Worldwide publishing service. And protected storage. And with that, you can... You can... You can actually stop every other service on the machine and your web server will run beautifully. Um... Stuff to remove. Do not ever leave sample files or, um, admin scripts, um, on your web server. It's just too easy for people to mess with them. Um... I don't like using inetpub at all. Uh... Like I said, I'll... I'll... Make a new partition and I'll just, you know, call it inetpub. So, HTTP files and just upload everything to that. Um... Remove your, um, HTW mapping. It's one of the tabs you can actually do in your internet service manager. Uh, it's more or less useless. Uh, remove your IIS admin password. Um, that is the actual file that allows people to change passwords using Outlook Web Access. If you are gonna, uh, use Outlook Web Access, I would recommend removing that anyway. When people click on the path, change password button, they'll get a 404. But, you don't have to worry about someone getting in someone's email and then changing their password and locking them out. Um, remote data services, don't need them. Um, what else? We have more stuff here. Parent paths. You can actually disallow, um, the use of directory transversal. It's great, but 90% of your web developers out there use it in their actual code. So, if you disallow that, there is a possibility that you're going to end up, uh, breaking the website. Um, that's something that you'd probably want to talk to your developer or whoever makes the, the site before you actually host it. That is where you can go to change that. You can open up your web server properties, the home directory configuration app options, script mappings. All of those script mappings you do not need. They can all be removed. Um, I'm sure that if some of you out there have been keeping up on Windows security, you've seen some good ones there. IDEA, you know, printer mappings. Yes, you do not need those. You can, this is the place to go to remove the script mappings. You go to your web server, your properties, master properties, web, WWW service, edit, home directory configuration. It's a bit of a mouthful. Um, by the way, if anyone needs any of this, you don't have to write it down. It's actually in my PowerPoint on the DEF CON CD. Um, miscellaneous stuff. Never allow anonymous access to your computer for anything. Um, this will take down, you don't have to worry about null sessions. Um, you can do that. And this is the registry key where you go to actually change that. Um, permissions. Set your ACLs. Um, a lot of people out there don't really know what ACLs are. Um, standard access control list. More or less, it's, it's your permissions that tell your computer who can do what and what not. I'll get into the next page. Um, make sure your IIS log files are not publicly readable. That is the directory. You can actually go and change the option on that using, um, your properties and, um, your security tab. And you can view that it's not readable by everyone. Uh, what else? Ooh, that goes quick. Okay, um, you can set down that CGI should not be run by, um, these are the only people that should be able to, um, execute CGI's. Um, which, use the four file extensions there. Um, what else? Script files. Everyone needs, uh, executable, um, permissions on that. Administrators, full control, system full control. just make sure, this I, I take a note of, um, make sure you do this when you deploy an IIS server. Um, static content isn't really that much of a problem. Um, everyone, uh, you don't need, uh, execute properties. All you need is read properties. And, uh, just give administrators full control. Okay, now let's get into the world of Exchange. Uh, for a while, um, Sendmail's getting into it now and it's working rather well, but Exchange for the longest time was one of the few email servers that would actually do outgoing mail authentication rather than using relaying. Um, even though it was, even though it was capable of doing that, Exchange 5.5 still did, um, the default permission of using it, your servers and open relay. So always make sure you, uh, don't have to worry about relaying mail for spammers because spammers fucking suck. Um, try using your encrypted file system. Um, nobody's really played with that much. It's gonna make a, it's gonna be a big player in .Net. Um, I mean, I can't think of a better thing to use it for than Exchange. I mean, encrypt all of your users' mail. You don't want people reading that if they compromise the system. Um, antivirus. Always make sure you're running antivirus on your email server. Otherwise, you're going to have much larger problems down the road where you have users infected with all sorts of viruses and, um, the easiest way to stop, to stop them is write your Exchange server. Um, Internet mail connector. Oh, Internet mail connector. I had no idea what that was. you can actually use that to limit your outgoing size so you don't have to worry about people, like, blasting your pipe or spamming. You can do, I mean, more or less, no user should really be throwing over 100 meg emails, uh, on a T1. I mean, that'd really fill it up. Here's kind of a neat thing you can do. Um, let's say that you guys want to run Outlook wire access, um, because somebody high up said you guys need to. And so you have no real choice. Well, what you can do is you can put a Send Mail server or another Exchange server out on the DMZ so it's on the public space, lock it down to Friday, and then relay the mail to an internal Exchange server using the Internet mail connector. Um, there, there it is right there. Um, you can add the, uh, this is just when you do it on your, when you're actually installing Exchange, make sure you add the Internet mail connector, and you can add it to your existing Exchange server on the DMZ, and you don't even have to, uh, you don't even have to add mailboxes or folders to the one on the DMZ. It, uh, because, because all our access is a relay, your internal Exchange server will sort everything out. So you only have to manage users in one place. Um, oh, Exchange administrators. Um, instead of using the default administrator account for 2000, um, they have Exchange administrators where not all administrators on the machine are full administrators of an Exchange server. Um, it's great if you have desktop support or someone who's in charge of adding users that you actually restrict them where they can't dig up the set, the settings on your Exchange server. Um, these are the three different types of Exchange administrators. Jesus Christ, it's hot. Um, all right, the security page, um, make that registry setting and you will actually get one more page in your Exchange setup that allows you to do other security options. Um, tracking logs for your Exchange server. Um, that, I can't point to it, but, uh, remove the read permission for everyone, more or less anyone with the uh, with an email account and the ability to log on locally would be able to read your Exchange tracking logs. Um, you can do it with, uh, through file permissions at that location. Outlook web access. Um, make sure you lock down IOS, uh, quite hard. Um, the best way to do it is using, um, SSL. Uh, what's it called? Just do an automatic redirect from your standard HTTP to an HTTPS. Um, so even when people screw up they'll still get to it and, uh, you can just generate your own certificate and they'll be fine. Um, one of the neat things with Outlook web access is it supports something called front and back in mode. Okay, this is front and back in mode. It's kind of like if I knew how to go back a button. Hey, how about that? You can, uh, read more about it at that address at, um, on the Microsoft website. Again, it's on the CD. Um, what's it called? This is more or less, uh, a diagram of how it works. You, um, do a front-end exchange server. It was just like I was saying with the, uh, internet mail connector. You do a front-end, uh, exchange server on your untrusted DMZ that relays everything through another firewall to, um, your back-end exchange server on your trusted network. Uh, there are default rules here that would make everything work peachy, so if you have to do it and you know little or nothing about firewalling, this will help you a lot. Uh, again, on the CD. perfect, we're on time. Um, there are multiple tools that you can use for securing your Microsoft web servers. Um, URL scan is a great tool by Microsoft. It actually sits in between the internet and your actual, um, IIS server and scans URLs for transversals and stuff like that that shouldn't be happening. Baseline security analyzer is a great tool by Microsoft. It's more or less, it's a, um, exactly what it is. I'll pop it up here in a second and show you what it looks like. It allows you to, um, to type in an IP or a host name of a computer on your corporate land. You have to be an administrator to run it. And it'll run HFNet check against it. It'll check for common misconfigurations and stuff like that and tell you what you need to do. Everyone should really check that out. Um, I'm going to, all of these tools are on a, on my 23 org account. I'll, at the end of it I'll give you the address of that. And you can download them there. The iOS lockdown tool. I heard good things and bad things about this. Originally it was fabled that it was useless and it actually left your server open more than it locked it down. Um, I personally don't like to use it. It comes with URL scan built into it. but that's just because I like to know what I'm doing to my server. Um, if it's one of your first times installing an IIS server or you just don't really care that much, it's a great tool. Give it a try. Um, secure IIS is a tool by a company called EI. I'm sure they're here. Um, you can, you can buy it from, it was originally, it's claim to fame was that it discovered the code red worm. Um, it's a URL scan only to a much greater extent and it is much, much more expensive. It's great if you work in a corporation and, you know, five, six thousand dollars for a piece of software to sit on your web server to give you an extra layer of security is totally feasible. I recommend that everyone goes and picks it up, tries it out. Tripwire for NT, uh, which is a little bit of a host based IUS. It, it's a great thing. Again, it's expensive. It's great for a web server because if it gives you that, um, extra notification if any of your web files ever get defaced or anything like that, uh, it's a great tool. Tripwire, I was talking to them, they were going to come and hook up free software for attendees and stuff like that but everything fell through at the last second. It's probably going to have stuff up for them on my website in a little bit where people can go and download evals and check it out. It's really, it's a great tool. Um, there's a lot of corporate backing behind it. They're a great company. I really recommend checking it out. Always make sure you're running a good antivirus. I can't stress that enough. Um, so many people out there are just getting owned by like the cloud virus and stuff like that. And if you run antivirus on your, all of your web servers, it, it cuts down on a lot of problems that the desktop admins and anyone internally are going to have to deal with. Um, you can always hire a computer company such as Covert Systems to come out and do a full audit and lock you guys down and take care of all of your needs and you can sit back and drink a cold beer. Um, that works too. It's kind of passing the buck, but you know, if it's not your job, that's what I do. Um, that's the, the website address where I'm going to have all my tools at. Right now, the directory is not viewable by the public. I'm going to go and have that fixed right when I'm done with the talk. I kind of forgot about it. All you have to do is connect to it. Um, it has a picture of me when I'm like seven years old standing in my hallway holding an AR-15. I'll take care of you. Um, what else? All right. We have like ten minutes for questions. Anyone have any questions? It depends what script mapping. You, you're going to have to customize that on an actual, it, it depends what scripts for ASP. That's something you'll have to get together with whoever's designing it. you talked about, you talked about removing everyone from the . What's that? Removing everyone from the permissions. I mean, . Is that what the trouble is? Oh, I'm, I'm totally not hearing you. Removing everyone from the permissions. Okay. And only allowing authenticated users. Authenticated users to do what? The building group. To, to manage, to what? Oh, I mean, you can do that, but then again, you might run into problems where Microsoft actually uses the everyone group instead of not having the administrator. You'd actually have to go through and make sure that you have administrator added to directories where the only group allowed is everyone. Okay. Yeah. It's kind of, I've done it before and it does break things. So, I, I wouldn't recommend doing it, but if you have the time, you can customize one, do it, and it just goes to silver and use it over and over again. Any other questions? I can't hear you at all. Why don't you, here, if anyone has questions, why don't you just come up to the stage and ask me. All right, everyone, have a good night. Thanks for coming out. I'm pretty glad to be here. Can you explain the front end backing? Okay.