1 00:00:00,000 --> 00:00:06,460 supposed to be in here. We switched because I had a demonstration for Solaris that was going to be 2 00:00:06,460 --> 00:00:11,280 on that screen and there wasn't a screen in the other room, but somebody owned the power adapter 3 00:00:11,280 --> 00:00:16,240 so that was kind of a pointless switch, but we're going to stay here for this talk anyway. 4 00:00:19,740 --> 00:00:27,520 Pretty much we are going to go through a hardening process of Solaris. I had asked for about two 5 00:00:27,520 --> 00:00:33,320 hours and I got 50 minutes, so we're going to be kind of cruising to get everything done in time. 6 00:00:34,720 --> 00:00:40,000 And back to the wireless thing, for the rest of the day, the breakout area is going to be in Athena 7 00:00:40,000 --> 00:00:42,360 and wireless is going to be in here. 8 00:00:47,180 --> 00:00:51,980 What I want to do this morning is go through pretty much a step-by-step process of how to 9 00:00:51,980 --> 00:00:57,340 lock down and harden a Solaris install. Basically, the best 10 00:00:57,340 --> 00:00:57,500 process is to go through the process of how to lock down and harden a Solaris install. 11 00:00:57,520 --> 00:01:01,320 The best practice of actually hardening a box before you put it on the network is what 12 00:01:01,320 --> 00:01:06,500 I'm looking at. However, because I live in the real world and I know that a lot of times 13 00:01:06,500 --> 00:01:10,420 these boxes are already on your networks, most of the concepts that we're going to 14 00:01:10,420 --> 00:01:15,500 talk about you can do to a live box. Anytime that it's going to be something that's dangerous 15 00:01:15,500 --> 00:01:19,500 to a live box or to an operational box, I'm going to go ahead and point that out to you 16 00:01:19,500 --> 00:01:27,360 so that you know to be careful before you try it. What we're going to cover this morning 17 00:01:27,360 --> 00:01:34,940 are basically installation, what we can do with the overboot process, screen auto-lock 18 00:01:34,940 --> 00:01:45,760 for the GUI, disabling services, setting up disk quotas, access control lists, set UIDs, 19 00:01:45,760 --> 00:01:52,160 set GID files, which Solaris, by default, has a ton of, permissions and setting them 20 00:01:52,160 --> 00:01:56,280 correctly, setting up and verifying the paths are correct. 21 00:01:59,340 --> 00:02:08,020 Aliases, system identification, groups, accounts and passwords, logging, cron and at jobs, 22 00:02:08,690 --> 00:02:13,700 and also the if you must use, stuff that I would recommend that you turn off immediately 23 00:02:13,700 --> 00:02:18,200 before you even think about looking at your box, but if you've got to use it for some 24 00:02:18,200 --> 00:02:25,980 operational refinement, what we can do there. The NDDs and some miscellaneous stuff, and 25 00:02:25,980 --> 00:02:27,340 finally, the board. 26 00:02:27,360 --> 00:02:37,580 What I'm not going to cover today are DNS and BIND, NIS and NIS Plus, NFS, and service 27 00:02:37,580 --> 00:02:42,820 specific or third party software like Apache or anything like that because in one of those 28 00:02:42,820 --> 00:02:49,940 we can talk for two hours on by themselves. First off, installation. Load from an official 29 00:02:49,940 --> 00:02:56,540 CD. Don't get some burned CD that somebody has said, hey man, this is a great Solaris 8 version. 30 00:02:56,760 --> 00:02:57,340 Go with it. 31 00:02:58,080 --> 00:03:02,840 Also, make sure that you set up your partitions large enough to accommodate patches. I've 32 00:03:02,840 --> 00:03:06,880 found that one of the biggest problems I run into is that people download the patch 33 00:03:06,880 --> 00:03:10,960 cluster but they haven't actually set up a partition big enough to put the patches on 34 00:03:10,960 --> 00:03:16,280 the machine and they end up having to either rebuild or skip the patch. 35 00:03:18,040 --> 00:03:22,220 Don't load the entire distribution, which is actually what I'm covering. I'm covering 36 00:03:22,220 --> 00:03:27,340 today from a full, an idiot install in other words. If you just come in and say, hey, 37 00:03:27,340 --> 00:03:33,900 everything plus OEM, that's how we're looking at it, don't do that. Just install the packages 38 00:03:33,900 --> 00:03:41,840 that you need and apply the appropriate patches. There is the link for the patches and the 39 00:03:41,840 --> 00:03:45,860 presentation is on your CD and all the links are on there so if you don't have them you 40 00:03:45,860 --> 00:03:47,800 can just copy paste them out of there. 41 00:03:49,380 --> 00:03:54,580 Also, maintain two current backups. If you have the resources, keep one on site and keep 42 00:03:54,580 --> 00:03:55,440 one off site. 43 00:03:57,880 --> 00:04:05,500 Open boot. Open boot is fun because I like to make things difficult with open boot. First 44 00:04:05,500 --> 00:04:11,060 of all, I suggest that you set the security level to full instead of command. However, 45 00:04:11,240 --> 00:04:17,820 at a minimum, it needs to be set to command. To do that, from the root prompt, E prompt 46 00:04:17,820 --> 00:04:25,240 security mode equals command. Very difficult. From the open boot prompt, set M security 47 00:04:25,240 --> 00:04:27,320 mode command. Also very difficult. 48 00:04:27,340 --> 00:04:32,340 For full, pretty much the same thing except you go with full instead of command. 49 00:04:35,300 --> 00:04:40,300 Open boot password. You should always set the open boot password. That way when somebody 50 00:04:40,300 --> 00:04:45,480 comes by and reboots your machine because some idiot didn't lock the screen, they cannot, 51 00:04:46,360 --> 00:04:50,600 they have to know an additional password before they can even begin to start playing around 52 00:04:50,600 --> 00:04:56,760 with your system. To do that, from the root prompt, E prompt security password, it will 53 00:04:56,760 --> 00:05:01,060 prompt you and you can put your password in. From the open boot prompt, password. 54 00:05:02,320 --> 00:05:08,260 Also, set an open boot banner. Just set the environment variable for the OAN banner to 55 00:05:08,260 --> 00:05:14,800 true and then this system property of or unauthorized access or whatever you want to 56 00:05:14,800 --> 00:05:21,080 put in there. Make sure that you've got something, it's an extra little no trespassing sign that 57 00:05:21,080 --> 00:05:22,040 you can put on the machine. 58 00:05:25,360 --> 00:05:32,000 If you, the GUI really should be in the if you must use section because mainly what I'm 59 00:05:32,000 --> 00:05:37,000 talking about today are servers and the fact of the matter is there is no reason that you 60 00:05:37,000 --> 00:05:42,740 need to have a GUI enabled on your server. If for some reason you have some idiot manager 61 00:05:42,740 --> 00:05:46,580 that decides that you need to have the GUI on there so that you can come look at pretty 62 00:05:46,580 --> 00:05:52,020 output or whatever, then make sure that you have the auto lock enabled. For CDE, if you're 63 00:05:52,040 --> 00:05:55,920 looking for something that's very easy to do, right click on the desktop, choose desktop 64 00:05:55,920 --> 00:06:02,460 controls, choose the screen style manager and click the on button and then make sure 65 00:06:02,460 --> 00:06:07,060 to scroll the screen wherever you want it to be set. I like to do it at one minute. 66 00:06:07,300 --> 00:06:12,320 That way if I walk away for any reason, it would immediately pretty much go to screen lock. 67 00:06:12,560 --> 00:06:16,600 However, most people seem to like five or ten minutes a little bit better. It's a little 68 00:06:16,600 --> 00:06:19,580 bit more realistic in case you turn around to pick up a piece of paper. 69 00:06:21,500 --> 00:06:22,020 Four minutes. 70 00:06:22,040 --> 00:06:28,360 Open windows, properties, miscellaneous and set the screen saver to auto and fill in the 71 00:06:28,360 --> 00:06:32,240 number of minutes that you want to actually have it turn on the auto lock. 72 00:06:33,680 --> 00:06:40,420 Services. Before I get started on services, one thing. Disable all unneeded services. 73 00:06:41,060 --> 00:06:47,100 When I go out and do assessments, pretty much at least one a week and one of the biggest 74 00:06:47,100 --> 00:06:51,820 problems that I have, both from an assessment standpoint and from an incident response 75 00:06:52,040 --> 00:06:58,800 standpoint, is somebody has got owned because they have their box sitting there with telnet 76 00:06:58,800 --> 00:07:05,980 running and FTP running or SNP. Any number of services. Solera starts about a 900,000 77 00:07:05,980 --> 00:07:11,700 by default. So you want to make sure to actually disable. Only have the services that you're 78 00:07:11,700 --> 00:07:16,700 running. If it's an SSH server, make sure to have it running only SSH and nothing else. 79 00:07:16,720 --> 00:07:20,960 If it's Apache, just web and whatever method you're going to use to actually access the 80 00:07:20,960 --> 00:07:30,360 box remotely. SSH being the best choice there. I'm going to switch real quick to what I did 81 00:07:30,360 --> 00:07:44,300 was I did an ISS scan. Oops. I did an ISS scan of a default Solaris instar with OEM. 82 00:07:44,720 --> 00:07:50,280 That is what ISS picks up. As you can see there are a ton of highs, a ton of mediums, 83 00:07:50,280 --> 00:07:50,940 and a ton of lows. 84 00:07:50,960 --> 00:07:57,040 But what I also did was at the end of this, after I went through the whole process, I 85 00:07:57,040 --> 00:08:00,500 did another scan to show you what the difference is and we'll take a look at that in a few 86 00:08:00,500 --> 00:08:05,740 minutes. But as you can see, this is what most people have sitting on their network. 87 00:08:05,980 --> 00:08:12,220 Most people just put a default install. If it works, they're good. So they think. Unfortunately 88 00:08:12,220 --> 00:08:17,340 they don't realize the Admin D is started, well S Admin D is started by default. They 89 00:08:17,340 --> 00:08:20,940 don't realize that SNMP daemon is running and the NFP is running. They don't realize 90 00:08:20,940 --> 00:08:21,860 that best server is running. 91 00:08:29,660 --> 00:08:29,960 Oh. 92 00:08:34,540 --> 00:08:38,260 Let me catch myself back up because I set the power point. 93 00:08:45,060 --> 00:08:45,660 Nope. 94 00:08:53,600 --> 00:08:54,260 Now? 95 00:09:06,180 --> 00:09:06,840 Exciting. 96 00:09:15,780 --> 00:09:16,440 Okay. 97 00:09:17,440 --> 00:09:19,460 What's disable in news services? 98 00:09:19,460 --> 00:09:28,060 First off, ined.com. That is where you're going to have about 30 unneeded services that are enabled by default. 99 00:09:28,600 --> 00:09:36,760 Telnet is in there. FTP is in there. S-Admin D is in there. Tool Talk Database Server is in there. 100 00:09:37,180 --> 00:09:45,800 If you're not using them, disable them. If you are using any of those, try and figure out why and see if you can't get rid of them. 101 00:09:47,140 --> 00:09:51,820 The way to do that is just quite simply to comment out the lines that aren't needed. 102 00:09:52,300 --> 00:09:58,920 Also, check your rc2.d and rc3.d directories that have the startup scripts in there. 103 00:09:59,200 --> 00:10:06,980 You're going to want to move the file to a different name and stop the service that it's already running. 104 00:10:08,920 --> 00:10:12,680 I usually just use a lowercase letter. Then when it boots up, it won't get it. 105 00:10:12,840 --> 00:10:15,780 Other people put dots in front of them and do all kinds of things. 106 00:10:15,800 --> 00:10:24,240 But whatever method you want to use is fine, just as long as it has changed the name from a capital S with the number and the service. 107 00:10:26,140 --> 00:10:31,340 One thing that I like that people know is the GUI interface. 108 00:10:32,240 --> 00:10:35,700 Checkpoint Firewall 1. People love the stupid GUI on that thing. 109 00:10:37,160 --> 00:10:45,000 What I've been able to find out is if you've got some manager that wants you to run a GUI so he can come and look at the pretty firewall rules, 110 00:10:45,180 --> 00:10:45,780 but he doesn't want you to run a GUI. 111 00:10:45,800 --> 00:10:50,840 What you can do is disable the GUI for having it running by simply killing RPC. 112 00:10:51,380 --> 00:10:54,400 If you have RPC dead, the GUI will not work. 113 00:10:54,540 --> 00:11:00,260 Then all you have to do if you want to enable the GUI is restart RPC manually. 114 00:11:00,440 --> 00:11:07,460 Just S71 RPC start and then start the GUI up and you can do whatever you need to do and then disable it when you're done. 115 00:11:12,700 --> 00:11:14,260 Make sure to disable sendmail. 116 00:11:14,260 --> 00:11:15,660 It is started by default. 117 00:11:15,900 --> 00:11:20,500 If it's not a mail server and you want to get rid of it, it opens up a ton of problems for you. 118 00:11:21,040 --> 00:11:24,680 To do that, that is in rc2.d and it's the S88 script. 119 00:11:26,820 --> 00:11:34,860 If it is a mail server, configure it to prevent message source routing by commenting out the next few lines in the sendmail.cf. 120 00:11:35,840 --> 00:11:39,480 I'm not going to read those, but you can look at them and they are on the CD. 121 00:11:44,260 --> 00:11:47,120 Expand and verify are started by default. 122 00:11:47,500 --> 00:11:52,640 What you want to do with those is add the following two lines to sendmail.cf. 123 00:11:53,080 --> 00:11:55,580 Opno-expand, Opno-verify. 124 00:11:55,680 --> 00:11:57,340 That will kill those for you. 125 00:11:59,560 --> 00:12:01,360 Install and configure secure shell. 126 00:12:01,520 --> 00:12:12,620 On the CD in the directory, I actually put the HTML file for how to install OpenSSH on the CD so that you can read through it. 127 00:12:12,660 --> 00:12:14,240 It's got pretty good directions on it. 128 00:12:14,260 --> 00:12:15,440 It's got what files you need. 129 00:12:15,660 --> 00:12:22,960 I actually wanted to put several other things, including OpenSSH and the recommended zip files on there. 130 00:12:23,140 --> 00:12:27,900 But when I got done with all the stuff I wanted to put on the CD, I think I had a CD by myself. 131 00:12:27,940 --> 00:12:30,280 So they told me to dial it back a bit. 132 00:12:33,040 --> 00:12:33,720 Use reporters. 133 00:12:34,400 --> 00:12:37,280 Does anybody have any idea why you would want use reporters? 134 00:12:39,720 --> 00:12:40,200 Mainly? 135 00:12:41,200 --> 00:12:41,680 Good. 136 00:12:47,480 --> 00:12:50,120 I'm going to assume you're right because I can't hear you. 137 00:12:50,540 --> 00:12:57,520 But if he said because you don't want your users to have... 138 00:12:57,520 --> 00:12:59,680 Users are generally running their own scripts. 139 00:12:59,920 --> 00:13:02,220 They've got all kinds of things they're running in their home directories. 140 00:13:02,280 --> 00:13:07,600 You don't want them to have something get away from them and run away and take up all of your disk space. 141 00:13:08,120 --> 00:13:11,720 If you had encoded it there, it will stop that from happening. 142 00:13:12,140 --> 00:13:13,520 And put me in these encoders. 143 00:13:13,520 --> 00:13:14,800 This is actually pretty easy. 144 00:13:15,920 --> 00:13:26,300 The first thing you do is you edit the VFS tab and add the mount option for Corda, which is just Corda at the very end. 145 00:13:26,360 --> 00:13:27,780 There's a dash there by default. 146 00:13:27,880 --> 00:13:28,960 Replace it with Corda. 147 00:13:30,380 --> 00:13:34,160 Create a file called Cordas in the root directory of the file system. 148 00:13:34,520 --> 00:13:37,040 And for what we're doing here, we're going to take a look at Export Home. 149 00:13:38,960 --> 00:13:40,680 Touch Export Home Cordas. 150 00:13:42,260 --> 00:13:45,120 Then you're going to need to set up a prototype Corda entry. 151 00:13:45,360 --> 00:13:47,060 And to do that, you use eggcorda. 152 00:13:48,620 --> 00:13:51,600 eggcordaprotouser, whatever the user that you want to be there. 153 00:13:53,160 --> 00:13:57,340 And you edit the number of blocks, hard and soft blocks and inodes. 154 00:13:57,920 --> 00:14:04,280 What that does is that tells you how big of a disk space they're allowed to have. 155 00:14:04,500 --> 00:14:09,420 And also how many files they are allowed to have. 156 00:14:09,420 --> 00:14:11,860 The inodes are the number of files. 157 00:14:12,060 --> 00:14:24,560 So in our example here, they're getting five megabytes of space and they are getting up to a thousand files in their home directory. 158 00:14:25,480 --> 00:14:27,860 That will be when they get a warning. 159 00:14:28,020 --> 00:14:29,060 That's the soft limit. 160 00:14:29,240 --> 00:14:32,880 The hard limit is when it will actually cut them off. 161 00:14:33,040 --> 00:14:37,000 They will not be able to log back in until they get that fixed. 162 00:14:37,860 --> 00:14:38,620 I'm sorry. 163 00:14:38,620 --> 00:14:39,640 They will not be able to log back in. 164 00:14:39,680 --> 00:14:43,800 They will not be able to create any new files or add any new space to the disk. 165 00:14:46,160 --> 00:14:49,760 Then what you need to do is replicate that across the board for all the users. 166 00:14:50,140 --> 00:14:55,440 So if you have ten users in there, eggcorda minus p, then your prototype user. 167 00:14:55,780 --> 00:14:59,780 And then just list out the names of the users that you want to set that Corda up for. 168 00:15:02,520 --> 00:15:04,980 Next thing you do is activate them with Corda On. 169 00:15:05,380 --> 00:15:08,520 Which is Corda On and the file system. 170 00:15:08,520 --> 00:15:10,280 That's how often that you want the Cordas to be enabled on. 171 00:15:13,180 --> 00:15:15,360 Corda Check command is used next. 172 00:15:15,480 --> 00:15:16,820 And that is going to build the statistics. 173 00:15:16,980 --> 00:15:19,760 That's so that you can actually go back and see where people stand. 174 00:15:20,020 --> 00:15:22,860 Is anybody getting close to their Corda limit and why? 175 00:15:23,580 --> 00:15:26,080 And to do that, just Corda Check minus a. 176 00:15:28,060 --> 00:15:30,860 Grab Corda will then report that data back to you. 177 00:15:30,940 --> 00:15:32,420 It will look something like that. 178 00:15:32,500 --> 00:15:33,580 Tell you where people are. 179 00:15:37,280 --> 00:15:38,480 Access control lists. 180 00:15:38,720 --> 00:15:39,020 Next. 181 00:15:40,060 --> 00:15:42,700 ACLs are very, very easy to set up in Solaris. 182 00:15:44,060 --> 00:15:45,620 Unlike some distroys. 183 00:15:45,800 --> 00:15:47,300 That's one of the things I like about it. 184 00:15:47,340 --> 00:15:50,820 Because you can change things around and only let people get to what they need to get to. 185 00:15:51,520 --> 00:15:54,680 It will allow you to avoid the group account problems. 186 00:15:55,860 --> 00:16:00,780 To do that, just use setup ACL to set the access controls. 187 00:16:01,780 --> 00:16:03,560 In our example here, what we're going to use. 188 00:16:03,560 --> 00:16:05,000 This is a file called access file. 189 00:16:07,560 --> 00:16:11,440 It will give you the output of what it currently looks like. 190 00:16:12,060 --> 00:16:17,700 You can see that I have the ownership and the admins group can access the file. 191 00:16:19,400 --> 00:16:21,740 Do a get ACL on it. 192 00:16:21,820 --> 00:16:24,740 And it will show you that user has read right. 193 00:16:24,800 --> 00:16:25,880 Group has read right. 194 00:16:26,400 --> 00:16:27,600 Other has nothing. 195 00:16:28,700 --> 00:16:32,560 If we want to change that to allow a user named Russ. 196 00:16:32,560 --> 00:16:36,300 Who was actually going to be sitting there showing you guys how to do this. 197 00:16:36,380 --> 00:16:37,160 But he's gone now. 198 00:16:37,420 --> 00:16:39,360 To have access to that file. 199 00:16:39,480 --> 00:16:40,900 He's not part of the admins group. 200 00:16:43,140 --> 00:16:46,960 Just do a set ACL minus M. 201 00:16:47,340 --> 00:16:48,920 The user and colon. 202 00:16:49,100 --> 00:16:52,040 And then whatever user you want to have access to the file. 203 00:16:52,380 --> 00:16:54,100 What access it's going to have. 204 00:16:54,140 --> 00:16:55,300 In this case, read right. 205 00:16:57,080 --> 00:16:59,320 And then name of the file. 206 00:16:59,660 --> 00:17:01,840 Then when you do another get ACL on it. 207 00:17:01,840 --> 00:17:04,860 You will see that user Russ has been added to the list. 208 00:17:08,180 --> 00:17:10,200 Set UID and set GID files. 209 00:17:12,060 --> 00:17:16,220 I would actually recommend that rather than do exactly what I say here. 210 00:17:16,360 --> 00:17:18,040 I would actually script this out. 211 00:17:18,140 --> 00:17:20,020 Because otherwise it will take you a long time. 212 00:17:21,400 --> 00:17:26,540 But you simply do a find on the type here. 213 00:17:26,740 --> 00:17:28,640 That will give you your set UID files. 214 00:17:28,860 --> 00:17:30,760 You can pipe that out to a file somewhere. 215 00:17:30,760 --> 00:17:31,860 To look at later. 216 00:17:31,880 --> 00:17:33,120 Because like I mentioned before. 217 00:17:33,280 --> 00:17:34,340 There are a ton. 218 00:17:35,480 --> 00:17:36,400 For the most part. 219 00:17:37,340 --> 00:17:40,420 Very, very few of them actually need to be set UID. 220 00:17:42,380 --> 00:17:43,800 Same thing with set GID. 221 00:17:46,060 --> 00:17:47,600 Once you have those piped out. 222 00:17:47,680 --> 00:17:49,240 You can go through them kind of at your leisure. 223 00:17:49,360 --> 00:17:50,100 And look at them. 224 00:17:50,340 --> 00:17:54,180 Or if you want to take the time to actually write a script out for it. 225 00:17:54,280 --> 00:17:56,000 You can have a grep through the file. 226 00:17:56,120 --> 00:17:57,340 And pull out the ones that you want. 227 00:17:57,420 --> 00:17:58,120 And change them. 228 00:17:58,400 --> 00:17:59,540 Change the forms on them. 229 00:18:00,760 --> 00:18:03,000 Make sure you want to find all the world writable files. 230 00:18:03,300 --> 00:18:05,620 Again, Solaris has quite a few of these. 231 00:18:06,720 --> 00:18:08,020 Simply do a find on them. 232 00:18:08,040 --> 00:18:08,860 Pipe it out to a file. 233 00:18:08,960 --> 00:18:10,000 And go through and look at them. 234 00:18:10,160 --> 00:18:11,820 You should be able at that point. 235 00:18:11,900 --> 00:18:14,460 To go through and figure out which ones need to be. 236 00:18:14,580 --> 00:18:15,520 And which ones don't. 237 00:18:15,640 --> 00:18:17,440 Because there aren't that many that do. 238 00:18:17,800 --> 00:18:18,940 Especially in the server environment. 239 00:18:21,320 --> 00:18:21,720 Permissions. 240 00:18:23,320 --> 00:18:24,120 Root UMass. 241 00:18:24,680 --> 00:18:29,120 I set to either 027 or 077 to do that. 242 00:18:29,300 --> 00:18:30,080 You edit the. 243 00:18:30,080 --> 00:18:31,600 As you default log in file. 244 00:18:31,920 --> 00:18:35,220 And just set the root UMass to 077. 245 00:18:35,580 --> 00:18:36,940 Which is what I actually recommend. 246 00:18:38,240 --> 00:18:39,700 The way the UMass works. 247 00:18:40,040 --> 00:18:41,100 Is it XORs. 248 00:18:41,780 --> 00:18:43,180 Every time you create a new file. 249 00:18:43,340 --> 00:18:47,720 It XORs with the root UMass that is set in that file. 250 00:18:48,080 --> 00:18:50,820 And it will then give you the opposite. 251 00:18:50,940 --> 00:18:51,820 So in our case. 252 00:18:52,240 --> 00:18:54,060 Every file that root creates. 253 00:18:54,320 --> 00:18:58,000 Is going to have a initial permissions of 700. 254 00:19:01,740 --> 00:19:05,520 You also want to check the system device permissions. 255 00:19:05,860 --> 00:19:06,840 By default. 256 00:19:06,940 --> 00:19:08,220 So as default install. 257 00:19:08,380 --> 00:19:12,240 The device permissions are set correctly. 258 00:19:12,580 --> 00:19:14,020 You shouldn't change them. 259 00:19:14,620 --> 00:19:15,960 There's really no need. 260 00:19:16,220 --> 00:19:17,280 What you would want to do. 261 00:19:17,360 --> 00:19:19,480 Is actually verify and dip. 262 00:19:19,600 --> 00:19:21,040 And make sure that they don't change. 263 00:19:21,220 --> 00:19:22,540 And they have not been changed. 264 00:19:22,680 --> 00:19:23,560 You can check that periodically. 265 00:19:24,360 --> 00:19:27,160 You also want to check the permissions on UTMP. 266 00:19:28,360 --> 00:19:30,000 Ensure that they are set to 650. 267 00:19:30,000 --> 00:19:30,420 Make sure that they are set to 644. 268 00:19:32,860 --> 00:19:35,500 Ensure that the ETSI password is set to 644. 269 00:19:37,900 --> 00:19:43,500 And you want to make sure that the ETSI shadow is set to 400. 270 00:19:48,120 --> 00:19:48,600 Also. 271 00:19:49,260 --> 00:19:51,800 To be able to restrict the host.equilib. 272 00:19:52,220 --> 00:19:53,020 Our host. 273 00:19:53,180 --> 00:19:54,460 And .NET RC files. 274 00:19:54,820 --> 00:19:56,560 What I would suggest doing on those. 275 00:19:56,820 --> 00:19:58,740 Is to actually touch and create them. 276 00:19:58,740 --> 00:20:00,520 And then chmod zero them. 277 00:20:00,680 --> 00:20:02,580 So that when you look at them. 278 00:20:02,640 --> 00:20:07,020 No one has read, write or execute access to any of those. 279 00:20:09,300 --> 00:20:12,640 Restrict the privileges on snoop to root only. 280 00:20:14,940 --> 00:20:15,960 By default. 281 00:20:16,040 --> 00:20:17,540 I think that it sets it to. 282 00:20:18,240 --> 00:20:18,760 Yeah. 283 00:20:18,860 --> 00:20:21,020 Pretty much everybody can use it. 284 00:20:21,200 --> 00:20:23,040 So you don't want that. 285 00:20:23,100 --> 00:20:24,820 You don't want anybody who is on your network. 286 00:20:24,940 --> 00:20:26,500 Especially if you're not in a switched environment. 287 00:20:26,760 --> 00:20:28,600 To be able to sniff all your network traffic. 288 00:20:28,740 --> 00:20:34,540 So go ahead and set the default permissions to execute for root. 289 00:20:34,660 --> 00:20:35,500 And no one else. 290 00:20:38,320 --> 00:20:39,600 The root user path. 291 00:20:41,500 --> 00:20:42,240 User bin. 292 00:20:42,440 --> 00:20:42,840 S bin. 293 00:20:43,020 --> 00:20:43,840 And user S bin. 294 00:20:44,060 --> 00:20:47,460 Root user really does not need to have anything other than that in his path. 295 00:20:48,120 --> 00:20:54,280 That is done by editing the .profile file in root's home directory. 296 00:20:56,900 --> 00:20:57,420 Also. 297 00:20:57,420 --> 00:21:00,800 This is another one that you're probably going to want to script out a little bit. 298 00:21:01,140 --> 00:21:03,140 And I actually planned to do that for you guys. 299 00:21:03,360 --> 00:21:04,000 But again. 300 00:21:04,100 --> 00:21:06,160 They had me pull a bunch of stuff off the CD. 301 00:21:06,380 --> 00:21:08,060 So you didn't get everything. 302 00:21:09,800 --> 00:21:12,720 But you want to make sure that no user has a dot in his path. 303 00:21:14,180 --> 00:21:15,580 If you're going to do it manually. 304 00:21:15,680 --> 00:21:17,560 If you're in an environment where you don't have a lot of users. 305 00:21:17,640 --> 00:21:18,300 It's pretty easy. 306 00:21:18,460 --> 00:21:19,840 You can just echo each user's path. 307 00:21:20,960 --> 00:21:23,240 And make sure that there are no dots in there. 308 00:21:25,420 --> 00:21:25,780 Yeah. 309 00:21:25,780 --> 00:21:27,160 Alternately it can be scripted. 310 00:21:27,220 --> 00:21:27,480 Thanks. 311 00:21:28,920 --> 00:21:29,360 Aliasing. 312 00:21:30,140 --> 00:21:33,660 I recommend that you alias both the ls and the lrm command. 313 00:21:35,240 --> 00:21:38,700 With ls I like to add the dash a and dash b option. 314 00:21:39,020 --> 00:21:41,160 And with lrm I like to add the dash i. 315 00:21:42,560 --> 00:21:43,920 What that will do is. 316 00:21:44,380 --> 00:21:46,640 With ls you will get all of your dot files. 317 00:21:48,520 --> 00:21:50,520 Without having to actually do a minus a. 318 00:21:51,280 --> 00:21:52,940 Every time you type ls out. 319 00:21:53,020 --> 00:21:55,760 You'll get all the hidden files immediately shown to you. 320 00:21:55,780 --> 00:21:57,000 So you can keep track of them. 321 00:21:57,060 --> 00:22:00,620 And you make sure that nothing has popped up that you weren't aware of. 322 00:22:01,440 --> 00:22:02,480 With the dash i. 323 00:22:03,180 --> 00:22:04,240 What you do is. 324 00:22:04,880 --> 00:22:06,660 It's going to ask you before you. 325 00:22:08,660 --> 00:22:09,260 I'm sorry. 326 00:22:09,340 --> 00:22:10,280 Before it deletes the file. 327 00:22:10,460 --> 00:22:11,680 It will ask you. 328 00:22:11,700 --> 00:22:12,960 Are you sure you want to do this. 329 00:22:13,540 --> 00:22:15,800 This is particularly important with root. 330 00:22:15,940 --> 00:22:18,980 Because root can delete very important files very quickly. 331 00:22:20,080 --> 00:22:23,220 The example that I always like to give is a mistake that I made. 332 00:22:23,440 --> 00:22:24,840 A long, long time ago. 333 00:22:24,840 --> 00:22:30,060 Where I did an rm minus rf dot dot slash star. 334 00:22:30,260 --> 00:22:31,940 And that is recursive. 335 00:22:31,980 --> 00:22:34,680 And it started going up and up and up and up and up. 336 00:22:34,780 --> 00:22:35,420 Deleting files. 337 00:22:35,760 --> 00:22:39,800 I would have very much liked to have had that ask me before it did it. 338 00:22:39,840 --> 00:22:41,300 Destroyed my entire file system. 339 00:22:45,400 --> 00:22:46,660 To do that. 340 00:22:47,560 --> 00:22:49,800 Depending on the shell that root is using. 341 00:22:49,860 --> 00:22:51,360 Or the user is using. 342 00:22:52,560 --> 00:22:54,520 You follow the steps on there. 343 00:22:54,520 --> 00:22:55,780 You use c shell. 344 00:22:56,660 --> 00:23:00,220 You use the alias command inside the dot login file. 345 00:23:00,560 --> 00:23:01,460 Born and corn. 346 00:23:01,600 --> 00:23:05,360 You add those lines to the dot profile. 347 00:23:05,680 --> 00:23:08,240 And with bash you use the dot bash rc. 348 00:23:08,380 --> 00:23:12,380 And do the same commands that you would use in the born and corn shell. 349 00:23:16,400 --> 00:23:19,180 Include the system name in the root and admin shell prompt. 350 00:23:19,500 --> 00:23:24,500 Most of your admins have access to multiple boxes at a time. 351 00:23:25,220 --> 00:23:28,120 So they are sshed into four different machines. 352 00:23:28,420 --> 00:23:29,900 Running around making changes. 353 00:23:30,280 --> 00:23:33,980 What you want to do is make sure that for at least those people. 354 00:23:34,140 --> 00:23:36,760 That the name of the system that they are on is in their prompt. 355 00:23:37,100 --> 00:23:40,880 That way they don't accidentally change things on the machine that they did not mean to. 356 00:23:47,300 --> 00:23:50,340 Again you do that with the c shell in the dot login file. 357 00:23:51,000 --> 00:23:52,500 Born and corn in the dot profile. 358 00:23:52,500 --> 00:23:55,300 And with bash in the dot bash rc. 359 00:23:55,520 --> 00:23:56,500 And you just do. 360 00:23:57,340 --> 00:24:00,920 For born and corn the ps1 equals uname minus n. 361 00:24:01,820 --> 00:24:04,740 For the c shell you set the prompt. 362 00:24:22,300 --> 00:24:23,620 Groups, accounts, and passwords. 363 00:24:26,320 --> 00:24:29,520 What you want to do is require the users to use the new group command. 364 00:24:29,640 --> 00:24:30,680 To change groups. 365 00:24:32,540 --> 00:24:33,380 To do that. 366 00:24:33,380 --> 00:24:36,840 Don't have any users assigned to groups other than staff. 367 00:24:37,180 --> 00:24:40,500 Every single user to include your admins. 368 00:24:40,500 --> 00:24:43,360 To have just a regular staff user group. 369 00:24:44,440 --> 00:24:46,700 Then you want to choose a strong group password. 370 00:24:47,700 --> 00:24:50,940 For let's say we are going to have the admins group in this case. 371 00:24:51,080 --> 00:24:54,020 You want to choose a strong password for that group. 372 00:24:55,760 --> 00:24:58,620 The easiest way to actually set that password. 373 00:24:58,660 --> 00:25:01,120 Is to change the password on a normally locked account. 374 00:25:01,280 --> 00:25:02,600 I like to use lp. 375 00:25:05,460 --> 00:25:08,420 To do that just obviously password lp. 376 00:25:08,440 --> 00:25:09,560 Put the password in. 377 00:25:10,240 --> 00:25:11,720 And then. 378 00:25:15,360 --> 00:25:16,900 That's the slide that I lost. 379 00:25:17,980 --> 00:25:22,300 Then what you do is you actually cut and paste that out. 380 00:25:22,380 --> 00:25:23,800 Edit the etsy groups file. 381 00:25:24,280 --> 00:25:30,280 And replace the no password in the etsy groups file with that password. 382 00:25:30,280 --> 00:25:33,760 Then whenever someone wants to actually change to that group. 383 00:25:33,820 --> 00:25:35,260 They just issue a new group command. 384 00:25:35,820 --> 00:25:37,780 New group admins for instance. 385 00:25:38,060 --> 00:25:39,840 It will then prompt them for the password. 386 00:25:40,080 --> 00:25:41,520 They put the password in. 387 00:25:41,740 --> 00:25:44,940 And they are then part of that admins group. 388 00:25:45,120 --> 00:25:46,940 If they do not have the correct password. 389 00:25:47,000 --> 00:25:48,120 They cannot change groups. 390 00:25:49,280 --> 00:25:52,480 Obviously also you'll probably want to go back and relock the lp account. 391 00:25:52,640 --> 00:25:53,300 When you're done. 392 00:25:55,180 --> 00:25:57,120 I like to restrict the use of su. 393 00:25:57,300 --> 00:25:59,880 I'm kind of a jerk when it comes to getting root access. 394 00:25:59,880 --> 00:26:01,400 I don't like. 395 00:26:01,480 --> 00:26:03,820 I like to make it as difficult as possible. 396 00:26:03,900 --> 00:26:06,040 Even for people that are supposed to have it. 397 00:26:07,260 --> 00:26:10,920 If you want to actually get uid zero on one of my machines. 398 00:26:11,120 --> 00:26:14,000 You're going to have to provide me with about eight strong passwords. 399 00:26:14,080 --> 00:26:15,020 Before you're done. 400 00:26:15,660 --> 00:26:18,940 One of those ways is by restricting the use of the su. 401 00:26:20,000 --> 00:26:21,240 There's our admins group. 402 00:26:23,360 --> 00:26:25,140 Assign a password to that group. 403 00:26:25,240 --> 00:26:26,040 Which we talked about. 404 00:26:29,000 --> 00:26:30,040 Then anyone. 405 00:26:30,100 --> 00:26:32,160 Then change your permissions on the group. 406 00:26:33,660 --> 00:26:35,920 And anyone who wants to then su. 407 00:26:36,240 --> 00:26:37,340 Has to log in. 408 00:26:37,340 --> 00:26:38,560 Has to new group first. 409 00:26:38,600 --> 00:26:39,660 To the admins group. 410 00:26:39,940 --> 00:26:42,160 And then they will be allowed to su. 411 00:26:46,120 --> 00:26:47,340 Lock the system accounts. 412 00:26:48,940 --> 00:26:49,700 This one. 413 00:26:49,800 --> 00:26:52,020 I'm not quite sure why so many of these accounts. 414 00:26:52,120 --> 00:26:54,400 Are unlocked by default with Solaris. 415 00:26:55,780 --> 00:27:05,360 Make sure to lock the Daemon, the LP, the BIN, the SIS, the ADM, the UCP, blah, blah, blah, blah, blah, lock them all so that they look like that. 416 00:27:07,940 --> 00:27:14,720 Also, lock the SIS admin and SIS groups in the ETSI group file. Same process. 417 00:27:17,180 --> 00:27:27,220 Next, you want to edit the ETSI default password to require a password change at least every eight weeks with a one-week interval between password changes. 418 00:27:28,280 --> 00:27:31,780 Also, in that file, you can set your minimum character length for passwords. 419 00:27:32,800 --> 00:27:40,300 Properly configured, you're going to look something like that where you have max weeks of eight and then weeks of one and the password length. 420 00:27:40,480 --> 00:27:44,120 Eight, nine, ten, whatever you want to use there, at least eight. 421 00:27:44,220 --> 00:27:44,700 So, that's it. 422 00:27:44,720 --> 00:27:45,540 That's for the password length. 423 00:27:46,980 --> 00:27:52,480 One thing, if the password is already enabled, it's not going to do anything until they have to change. 424 00:27:52,620 --> 00:27:58,940 In other words, if you've got some guy who's got, you know, his username, it's three characters for his password as well, 425 00:27:59,500 --> 00:28:07,020 until eight weeks have passed and he has to change his password, that password is still going to be sitting there. 426 00:28:11,040 --> 00:28:13,520 One PwCheck to check for inconsistencies. 427 00:28:14,040 --> 00:28:14,700 It does. 428 00:28:14,720 --> 00:28:23,640 What that will do is it will check the field number, the login name, the UID, the GID, and the login directory and shell for the user. 429 00:28:24,280 --> 00:28:25,960 Verify that those are correct. 430 00:28:28,200 --> 00:28:29,640 Do the same thing with the group. 431 00:28:29,880 --> 00:28:35,320 Run a group check to make sure that those are properly configured and what you're expecting to see. 432 00:28:36,740 --> 00:28:40,820 Then you're also going to want to verify that the permissions of ETSI group are 644. 433 00:28:42,000 --> 00:28:42,540 Next slide. 434 00:28:44,160 --> 00:28:44,700 Next slide. 435 00:28:44,700 --> 00:28:45,820 Grow all SU attempts. 436 00:28:47,180 --> 00:28:53,240 I like to, some people have this set so that they're not all logged, that only the failed SUs are logged. 437 00:28:53,320 --> 00:28:54,340 I like to log them all. 438 00:28:54,560 --> 00:28:58,340 I want to know everyone that tried and everyone that succeeded to get SU. 439 00:28:59,180 --> 00:29:03,820 Disk space can be an issue if you don't check this and clear it out every once in a while. 440 00:29:05,600 --> 00:29:12,360 First of all, to do that, you just verify that ETSI default SU exists and provides a path to the SU log. 441 00:29:12,960 --> 00:29:14,600 It'll look something like that. 442 00:29:15,820 --> 00:29:22,040 Then you also want to log the failed login attempts to the login log. 443 00:29:22,620 --> 00:29:24,520 You have to actually create that file. 444 00:29:24,600 --> 00:29:25,840 It is not created by default. 445 00:29:26,300 --> 00:29:33,520 On a very large network where you have a whole lot of users that are going to be logging in on a regular basis, 446 00:29:33,620 --> 00:29:38,700 this may not be feasible because you don't need to necessarily know every single login. 447 00:29:38,980 --> 00:29:40,600 It'll just take up too much space. 448 00:29:40,600 --> 00:29:44,320 And it's going to be something that you're never actually going to go through and look at anyway. 449 00:29:46,260 --> 00:29:50,080 But if you're in a small environment where you have only a few users, 450 00:29:51,440 --> 00:29:54,980 it's a good idea to actually see when and where and how they logged in. 451 00:29:56,880 --> 00:30:03,360 To do that, after you touch it, you change the ownership over to root and sys group. 452 00:30:03,680 --> 00:30:07,000 And you change the permissions to root only. 453 00:30:09,280 --> 00:30:10,240 Failed logging. 454 00:30:10,240 --> 00:30:11,860 Login attempts are going to look like this. 455 00:30:14,620 --> 00:30:15,940 Haxor did not get in. 456 00:30:17,700 --> 00:30:21,800 What that tells us is the time that he attempted to log in and failed. 457 00:30:22,160 --> 00:30:24,980 And where he tried to log in from. 458 00:30:26,880 --> 00:30:31,300 You want to turn on INETD connection tracing. 459 00:30:31,560 --> 00:30:34,720 And what that will do is attempt to trace all incoming GCP services. 460 00:30:35,240 --> 00:30:37,040 And that will log in sys log. 461 00:30:37,840 --> 00:30:39,620 To do that, you just edit the... 462 00:30:39,620 --> 00:30:42,060 init.d INET sources file. 463 00:30:42,280 --> 00:30:45,600 And add a "-t to the INETD start line. 464 00:30:46,660 --> 00:30:48,240 So it will look like that. 465 00:30:48,780 --> 00:30:51,980 Then you're going to want to kill and reboot the INET daemon. 466 00:30:52,040 --> 00:30:54,500 Because it is not currently running with tracing on. 467 00:30:54,620 --> 00:30:56,300 This is assuming, of course, a live system. 468 00:30:56,380 --> 00:30:59,420 It's not going to be rebooted before you put it on the network. 469 00:31:00,100 --> 00:31:01,060 Just kill it. 470 00:31:01,160 --> 00:31:03,780 Restart it with the "-t switch. 471 00:31:07,220 --> 00:31:08,280 You want to... 472 00:31:08,280 --> 00:31:10,300 This is one of those things I was talking about before. 473 00:31:10,440 --> 00:31:13,680 Where if you're in an operational environment, this is very... 474 00:31:13,680 --> 00:31:15,160 Can be very dangerous. 475 00:31:16,000 --> 00:31:20,800 You want to configure the INETD system to prevent stack-based buffer overflow attacks. 476 00:31:21,360 --> 00:31:24,420 Prevent is probably a little bit strong of a word there. 477 00:31:24,780 --> 00:31:26,720 Maybe help prevent is better. 478 00:31:27,600 --> 00:31:32,520 To do that, you edit the INETD system and set the noexec user stack to 1. 479 00:31:32,780 --> 00:31:35,580 And also the noexec user stack log to 1. 480 00:31:35,920 --> 00:31:37,220 What that will do... 481 00:31:37,220 --> 00:31:43,420 Is any attempts to execute code on the program stack will be logged to syslog. 482 00:31:44,180 --> 00:31:49,700 What I would do if you were in an operational environment is I would set the log to 1 and 483 00:31:49,700 --> 00:31:52,560 not actually set the noexec user stack. 484 00:31:52,840 --> 00:31:58,500 I say that because especially with some legacy third-party software, they are programmed 485 00:31:58,500 --> 00:32:01,400 to intentionally run code on the stack. 486 00:32:01,700 --> 00:32:02,440 If you have... 487 00:32:02,440 --> 00:32:04,680 I believe Oracle 7 is actually one of those. 488 00:32:04,680 --> 00:32:09,960 So if you have Oracle 7 running on your machine, it will kill it. 489 00:32:09,980 --> 00:32:10,980 And it will not work anymore. 490 00:32:11,420 --> 00:32:16,800 But if you log it for a couple of weeks or a month of normal environment time, then see 491 00:32:16,800 --> 00:32:18,760 if anything actually showed up in the log. 492 00:32:18,820 --> 00:32:21,760 If it did not, you're probably in good shape and you can go ahead and do this. 493 00:32:21,960 --> 00:32:25,880 If it did, then you know that you need to probably either upgrade that piece of software 494 00:32:25,880 --> 00:32:28,520 or if that's not going to happen, you don't want to do this. 495 00:32:31,900 --> 00:32:34,600 Next, you need to check your con and add jobs for Valid. 496 00:32:35,580 --> 00:32:37,260 Pretty much just look at them. 497 00:32:37,340 --> 00:32:41,820 Make sure that what you expected to be there is what is there. 498 00:32:44,360 --> 00:32:50,640 Place the user IDs of the users that are allowed to create con jobs in the con.allow 499 00:32:50,640 --> 00:32:51,060 file. 500 00:32:51,340 --> 00:32:57,540 Place the user IDs of the people that are allowed to create add jobs in the add.allow 501 00:32:57,540 --> 00:32:57,980 file. 502 00:32:59,420 --> 00:33:04,660 Conversely, you want to make sure that people that are specifically not allowed are in the 503 00:33:04,660 --> 00:33:05,740 con.deny. 504 00:33:05,840 --> 00:33:09,560 I say that because the con.allow is your default. 505 00:33:09,820 --> 00:33:11,860 That is what it's going to use. 506 00:33:11,980 --> 00:33:19,980 However, if for some reason that is bypassing and fails, the con.deny will at least users 507 00:33:19,980 --> 00:33:24,800 that you know are on the system that you absolutely do not want creating con and add 508 00:33:24,800 --> 00:33:27,080 jobs, it will fail over to there. 509 00:33:27,220 --> 00:33:32,780 And if they're in there, you'll have a secondary measure to make sure that they're not allowed 510 00:33:32,780 --> 00:33:33,620 to create the job. 511 00:33:36,360 --> 00:33:42,300 It's also important to verify that con jobs are legit both before and after adding a user 512 00:33:42,300 --> 00:33:43,200 to con.deny. 513 00:33:44,360 --> 00:33:48,100 That's because it only disallows users from creating future jobs. 514 00:33:48,280 --> 00:33:53,900 If they already had the job scheduled with con or add, it will continue to run. 515 00:33:57,920 --> 00:34:03,060 You need to ensure that the scripts and programs that are launched by con or add are readable 516 00:34:03,060 --> 00:34:04,040 only by the owner. 517 00:34:04,660 --> 00:34:08,080 You don't want anybody and their brother to be able to take a look at these. 518 00:34:10,860 --> 00:34:16,680 An example of that is if mailrun.pl is scheduled to run in the con tab, it should look like 519 00:34:16,680 --> 00:34:16,980 that. 520 00:34:17,140 --> 00:34:20,260 I'm the only person that has access to it. 521 00:34:20,320 --> 00:34:22,040 I'm the only person that can modify it. 522 00:34:22,080 --> 00:34:23,780 I'm the only person that can look at it. 523 00:34:26,360 --> 00:34:27,960 To the if you must uses. 524 00:34:29,920 --> 00:34:31,140 FTP, disable it. 525 00:34:31,200 --> 00:34:32,540 Use SFTP instead. 526 00:34:32,880 --> 00:34:34,640 If you have to use it, use it. 527 00:34:35,700 --> 00:34:41,940 Enable logging and debugging by editing the inid.conf and adding the minus DL switches. 528 00:34:44,820 --> 00:34:54,300 Properly logging entry in inid.conf is going to look like that. 529 00:34:54,340 --> 00:34:56,300 Just at the end you have the minus DL. 530 00:34:57,980 --> 00:35:03,700 You also want to make sure that at a minimum root UUCP bin and anonymous are in the FTP 531 00:35:03,700 --> 00:35:04,580 users file. 532 00:35:04,740 --> 00:35:11,760 The FTP users file is the file that says who cannot use FTP, who cannot FTP into your 533 00:35:11,760 --> 00:35:12,260 system. 534 00:35:12,640 --> 00:35:14,600 At a minimum, those need to be in there. 535 00:35:19,380 --> 00:35:24,000 You want to configure the default FTPD to remove the OS banner. 536 00:35:24,900 --> 00:35:29,700 Whenever you log into Solaris, they'll come back and they'll say 5 dot whatever. 537 00:35:30,020 --> 00:35:32,240 You want to get rid of that. 538 00:35:32,320 --> 00:35:33,500 You don't want to give them any extra. 539 00:35:33,500 --> 00:35:37,880 There's enough programs and tools out there that will tell them what operating system 540 00:35:37,880 --> 00:35:38,440 you're running. 541 00:35:38,720 --> 00:35:42,680 Don't just freely give them the information and cut half the time out of their work. 542 00:35:42,960 --> 00:35:47,780 Also, if they're actually having to use Nmap or whatever, you're going to be getting 543 00:35:47,780 --> 00:35:51,880 something in your log somewhere along the line to let you know that you've been scanned 544 00:35:51,880 --> 00:35:52,840 or whatever. 545 00:35:54,340 --> 00:35:59,440 If they are able to just FTP to you and it tells them what version you're running, 546 00:35:59,580 --> 00:36:01,060 you've cut a lot of their work off. 547 00:36:02,660 --> 00:36:07,140 To do that, you just echo banner with null. 548 00:36:07,540 --> 00:36:11,380 That's open and close quotes into the EDC default FTPD. 549 00:36:11,820 --> 00:36:16,680 When they log in at that point, it will then have no login banner. 550 00:36:19,140 --> 00:36:20,880 No OS banner, I should say. 551 00:36:21,200 --> 00:36:23,780 Tell that banner is essentially the same thing. 552 00:36:24,660 --> 00:36:27,140 Edit the EDC issue to issue a warning banner. 553 00:36:27,380 --> 00:36:30,980 First of all, you're going to have to create that file. 554 00:36:30,980 --> 00:36:32,240 It is not created by default. 555 00:36:32,840 --> 00:36:34,560 Again, put something in there. 556 00:36:34,780 --> 00:36:39,140 Unauthorized access, you're going to die if you come in, whatever, I don't care. 557 00:36:39,600 --> 00:36:43,900 Just something that tells them, I don't want you here if you're not supposed to be here. 558 00:36:44,760 --> 00:36:49,640 The only reason you're doing that, it's not like Joe Leak guy is going to come in and 559 00:36:49,640 --> 00:36:51,660 say, oh, well, I'm sorry, I have unauthorized access. 560 00:36:51,660 --> 00:36:52,620 I'm not authorized to access. 561 00:36:52,760 --> 00:36:53,580 I better log off. 562 00:36:53,820 --> 00:37:00,080 What it will do is if you have it properly authorized by your legal department, EDC 563 00:37:00,080 --> 00:37:06,260 issue and a warning banner, when it comes time for prosecution, you can take that 564 00:37:06,260 --> 00:37:08,740 to court and say, we told them don't come here. 565 00:37:08,820 --> 00:37:11,320 They came anyway, and we want them to pay. 566 00:37:15,240 --> 00:37:18,120 Configure the default time at D to remove the OS banner. 567 00:37:18,240 --> 00:37:24,340 That is the exact same process as the FTP banner, and it will just get rid of the OS 568 00:37:24,340 --> 00:37:25,780 version when somebody logs in. 569 00:37:27,920 --> 00:37:28,840 The NDDs. 570 00:37:28,840 --> 00:37:32,120 Are most of you guys familiar with the NDDs? 571 00:37:32,720 --> 00:37:33,900 I like to use them. 572 00:37:33,940 --> 00:37:39,860 They allow you to do quite a few things that otherwise you don't really realize are running 573 00:37:39,860 --> 00:37:47,020 because nowhere does it say, oh, I have IP source routing enabled. 574 00:37:47,220 --> 00:37:51,780 There's no script that you can run through and find out where that is, but you can actually 575 00:37:51,780 --> 00:37:53,900 sit here with the NDDs and disable that stuff. 576 00:37:55,640 --> 00:37:58,820 First thing I'd like to do is get rid of the IP forwarding. 577 00:37:58,840 --> 00:38:00,360 So I'm going to do a forwarding and directed broadcast. 578 00:38:00,900 --> 00:38:08,940 To do that, you just do an NDD dash set slash dev slash IP, IP underscore forwarding, set 579 00:38:08,940 --> 00:38:10,400 it to zero and hit enter. 580 00:38:10,920 --> 00:38:12,820 Same thing for forward directed broadcast. 581 00:38:14,220 --> 00:38:18,980 If you do a dash get instead of a dash set, it will tell you what it is currently set 582 00:38:18,980 --> 00:38:19,220 to. 583 00:38:23,100 --> 00:38:28,040 You want to configure the system to ignore redirects and disable the forward source routing. 584 00:38:28,840 --> 00:38:30,920 If you want redirects, you want to set to one. 585 00:38:31,360 --> 00:38:34,800 Forward source routing, you want to set to zero to disable. 586 00:38:36,600 --> 00:38:42,520 You also want to configure the system to not respond to address mask broadcast, echo broadcast, 587 00:38:42,920 --> 00:38:44,500 timestamp and timestamp broadcast. 588 00:38:46,540 --> 00:38:49,620 Set all of those to zero with your NDDs. 589 00:38:51,980 --> 00:38:56,040 Also, while I'm thinking about it, there's not just dev IP. 590 00:38:56,380 --> 00:38:58,460 You have UDP. 591 00:38:58,840 --> 00:38:59,780 You have TCP specific. 592 00:38:59,900 --> 00:39:04,780 You can go through and look at them and see what exactly you do need, what exactly you 593 00:39:04,780 --> 00:39:05,220 don't need. 594 00:39:05,320 --> 00:39:09,600 And there is a lot that you can disable there, a lot of enumeration info that will come back 595 00:39:09,600 --> 00:39:14,200 to haunt you later that you can stop right there at the OS level and not have to rely 596 00:39:14,200 --> 00:39:15,160 on your border devices. 597 00:39:17,720 --> 00:39:23,060 All right, now here comes what I was talking about before about making it very, very difficult. 598 00:39:23,860 --> 00:39:28,480 A lot of people do not like to do this because it becomes very hard for your admin. 599 00:39:28,980 --> 00:39:32,660 As well as everyone else to gain root access to the box. 600 00:39:32,840 --> 00:39:37,240 What I like to do is totally disable root login from everything. 601 00:39:37,580 --> 00:39:39,340 Root can never log in, period. 602 00:39:39,480 --> 00:39:44,660 The only way that you can get UID zero is to log in at this point. 603 00:39:44,960 --> 00:39:49,400 If we do this, they'll have to know the open root banner to get the machine up. 604 00:39:49,880 --> 00:39:54,900 Then they'll have to have a regular user account and password so that they can log in. 605 00:39:55,320 --> 00:39:58,460 Next, if they want to ask you to root, they're going to have to opt out. 606 00:39:58,460 --> 00:40:01,820 They're going to have the admin's group password so they can get in. 607 00:40:02,000 --> 00:40:05,360 And finally, they're going to actually have to know the root password so they can ask you. 608 00:40:05,820 --> 00:40:09,840 If they can get through all that and own you, you deserve to be owned because you 609 00:40:09,840 --> 00:40:10,700 have crappy passwords. 610 00:40:13,440 --> 00:40:15,640 To do that, console only access. 611 00:40:16,040 --> 00:40:22,220 You have the console setting and the NC default login to dev console. 612 00:40:22,560 --> 00:40:25,560 That way, root can't come in any other way. 613 00:40:25,640 --> 00:40:26,500 Can't SSH. 614 00:40:26,540 --> 00:40:27,140 Can't Telnet. 615 00:40:28,460 --> 00:40:33,160 But it can still come in as a console user sitting at the box. 616 00:40:33,340 --> 00:40:38,360 Like I said, I like to go a step further and disable it completely and just set it to dev null. 617 00:40:43,700 --> 00:40:45,200 TCP sequence prediction. 618 00:40:45,640 --> 00:40:47,460 Do any of you guys use ISS? 619 00:40:49,060 --> 00:40:52,080 Yeah, ISS sucks with TCP sequence prediction. 620 00:40:52,420 --> 00:40:57,420 It shows up every time no matter what version of what software you're running. 621 00:40:57,420 --> 00:41:00,580 Everything apparently has a TCP predictable sequence. 622 00:41:00,920 --> 00:41:05,400 And that's because they set it to, like, if it guesses 1 out of 500,000 correctly, 623 00:41:05,480 --> 00:41:07,120 then it's predictable. 624 00:41:07,660 --> 00:41:15,860 But you can actually, with Solaris 8, you can take care of that problem even for ISS's toughness. 625 00:41:17,140 --> 00:41:24,900 To set the TCP strong ISS to 2 in the NC default .NET init, it is by default set to 1. 626 00:41:27,420 --> 00:41:35,240 Next, you want to edit the ETSI profile and set the U limit to 0 to restrict the generation of core files. 627 00:41:36,280 --> 00:41:39,400 It doesn't always work, but it's worth a try. 628 00:41:41,180 --> 00:41:43,660 Here's another one that can be kind of dangerous. 629 00:41:44,160 --> 00:41:48,320 Randomizing the file system inode numbers with the FSI RAN. 630 00:41:51,040 --> 00:41:51,700 Tells you why. 631 00:41:54,260 --> 00:41:57,120 But again, very dangerous. 632 00:41:57,120 --> 00:42:02,340 You have to unmount the file system before FSI RAN can be run. 633 00:42:03,340 --> 00:42:06,960 And you want to make sure that you have backed them up before you do it. 634 00:42:07,040 --> 00:42:09,680 And you've checked the file system on them. 635 00:42:09,860 --> 00:42:16,160 Because the chances of it actually ruining your file system inodes are just as good as it working. 636 00:42:16,460 --> 00:42:19,720 So that's one that you're going to kind of take with a grain of salt. 637 00:42:20,000 --> 00:42:25,500 If it works and you've got a system in place where you can actually do it on a regular basis, it's great. 638 00:42:25,500 --> 00:42:32,660 If you actually have a problem where you have an operational system that cannot go down for any length of time, 639 00:42:32,720 --> 00:42:34,280 I would actually skip this step. 640 00:42:36,520 --> 00:42:38,040 Tripwire and log check. 641 00:42:38,320 --> 00:42:41,760 Install and configure those to monitor for false system integrity. 642 00:42:44,040 --> 00:42:45,240 Install Snort. 643 00:42:45,360 --> 00:42:50,300 Any other intrusion detection ideas that you have at your disposal. 644 00:42:50,600 --> 00:42:53,120 I like Snort. It's free. It works. 645 00:42:53,640 --> 00:42:55,480 It's just what I like. 646 00:42:55,500 --> 00:42:59,640 I prefer, if you want to use Real Secure or something else, go for it. 647 00:43:01,620 --> 00:43:07,060 But there are freeware IDS products out there that you have access to. 648 00:43:07,160 --> 00:43:11,280 So you really don't have an excuse for not having some intrusion detection sitting on your servers. 649 00:43:13,620 --> 00:43:22,960 At the border, you are going to want to stop at UDP port 113 and TCP port 113 traffic inbound. 650 00:43:23,160 --> 00:43:23,480 . 651 00:43:25,320 --> 00:43:28,100 Also, you want to block ICMP type 17. 652 00:43:28,120 --> 00:43:30,840 That's your mask request traffic at the border. 653 00:43:32,460 --> 00:43:38,920 And finally, allow access through the firewall only to necessary ports on specific machines. 654 00:43:39,320 --> 00:43:51,700 In other words, if you have a web server, a mail server, and a DNS server sitting behind your firewall, 655 00:43:51,700 --> 00:43:58,160 what you want to do is allow port 25 traffic only inbound to the mail server. 656 00:43:58,300 --> 00:44:00,540 Not port 25 traffic across the board. 657 00:44:00,820 --> 00:44:05,500 Same thing would go for HTTP, port 80, and port 53. 658 00:44:06,400 --> 00:44:11,200 Specifically to that box, that way if you, for some reason, skip a step, miss a step, 659 00:44:11,260 --> 00:44:14,680 or somebody accidentally re-enables a service on one of those machines, 660 00:44:15,360 --> 00:44:20,940 you have another layer of protection to keep somebody from making access to your machine on that port. 661 00:44:24,580 --> 00:44:29,880 Implementing the stuff that we talked about here today is not going to make you totally secure. 662 00:44:30,140 --> 00:44:35,620 We were talking about it the other day, an idea to find a totally 100% secure you-know-it box. 663 00:44:35,800 --> 00:44:36,780 It cannot be made. 664 00:44:37,060 --> 00:44:41,680 If there is a determined attacker out there, and you are his target, and he is knowledgeable, 665 00:44:42,080 --> 00:44:43,800 he is probably going to get you. 666 00:44:44,080 --> 00:44:50,760 But what you can do by doing this is take the time to reduce your script-kidding threat 667 00:44:50,760 --> 00:44:51,860 to essentially nothing. 668 00:44:52,700 --> 00:44:58,820 You will also be able to, if you have an attacker that is looking for a target of convenience, 669 00:44:59,480 --> 00:45:00,680 you are not convenient. 670 00:45:01,000 --> 00:45:02,020 It's like the club. 671 00:45:02,700 --> 00:45:06,280 People, car thieves can get the club off of your car very quickly. 672 00:45:06,560 --> 00:45:12,020 However, when they walk by and they see two sitting next to each other, one has the club, one doesn't, 673 00:45:12,020 --> 00:45:13,260 they steal the car without. 674 00:45:14,340 --> 00:45:15,340 Unless it sucks. 675 00:45:17,600 --> 00:45:19,360 Finally, also, patches. 676 00:45:19,360 --> 00:45:24,700 One of the biggest problems that I see, and I mentioned it before, is people not applying the patches. 677 00:45:24,940 --> 00:45:29,760 If you maintain patch level, you will reduce the bulk of your problems. 678 00:45:29,920 --> 00:45:36,500 Just by maintaining patch level and disabling unneeded services, you've probably reduced your risk by about 90%. 679 00:45:38,780 --> 00:45:41,660 I have a few references in here. 680 00:45:42,740 --> 00:45:44,680 Some of them are online, some of them are books. 681 00:45:44,860 --> 00:45:46,960 Solar Security by Peter H. Gregory. 682 00:45:47,260 --> 00:45:49,040 Sun Press actually put that out. 683 00:45:49,360 --> 00:45:50,280 It's a very good book. 684 00:45:50,520 --> 00:45:54,180 A lot of the info that came from this can be found in that book. 685 00:45:54,220 --> 00:45:56,560 Unfortunately, it is Solaris 7 specific. 686 00:45:57,560 --> 00:46:02,140 That's why I had to update quite a few of the things from this book. 687 00:46:04,320 --> 00:46:13,800 The other thing that I wanted to do was show you the results of the ISS scans. 688 00:46:14,280 --> 00:46:16,200 Like I said, that is the initial scan. 689 00:46:16,200 --> 00:46:20,340 With essentially a default install or dummy install. 690 00:46:21,100 --> 00:46:27,300 If you run through this process and do all the steps, when you are done, you will have... 691 00:46:28,700 --> 00:46:29,520 Not that. 692 00:46:34,160 --> 00:46:34,720 This. 693 00:46:34,860 --> 00:46:36,740 You have four rows remaining. 694 00:46:37,140 --> 00:46:37,840 Trace route. 695 00:46:38,060 --> 00:46:39,380 ICMP netmask. 696 00:46:39,520 --> 00:46:40,860 ICMP timestamp. 697 00:46:40,860 --> 00:46:43,000 All of which should be blocked at your border. 698 00:46:43,340 --> 00:46:45,200 And OpenSSH running. 699 00:46:45,200 --> 00:46:48,080 Which is more of an informational item to let you know that you have it. 700 00:46:48,100 --> 00:46:50,860 There is not a vulnerability actually associated with that. 701 00:46:50,900 --> 00:46:53,580 Assuming that you have your OpenSSH in the current patch level. 702 00:46:54,340 --> 00:46:58,980 I had hoped to actually get this presentation updated for Solaris 9. 703 00:46:59,220 --> 00:47:03,380 Unfortunately, I am a multiprocessor system, so I had to buy the software. 704 00:47:03,620 --> 00:47:06,020 And I didn't get it in in time to update the slides. 705 00:47:06,320 --> 00:47:08,200 But I did get it in and get it installed. 706 00:47:08,640 --> 00:47:11,380 I ran through the process on Solaris 9. 707 00:47:13,480 --> 00:47:17,020 With actually better results because there is no OpenSSH. 708 00:47:17,200 --> 00:47:18,960 It comes bundled with SSH now. 709 00:47:20,180 --> 00:47:25,160 However, I haven't tested everything to actually make sure that I'm not breaking anything. 710 00:47:25,620 --> 00:47:30,160 So before you do this on Solaris 9, you're going to want to do it in a non-operational environment. 711 00:47:30,160 --> 00:47:33,600 And verify that none of the steps are going to break your system. 712 00:47:34,620 --> 00:47:36,260 I have time. 713 00:47:36,400 --> 00:47:37,260 That is it. 714 00:47:37,340 --> 00:47:39,300 I have time for about three questions. 715 00:47:39,380 --> 00:47:41,360 Because I have to go to... 716 00:47:41,380 --> 00:47:43,520 I have to do the road driving contest right from here. 717 00:47:43,840 --> 00:47:45,240 So, yeah. 718 00:47:45,400 --> 00:47:46,420 If you want to come up. 719 00:47:47,180 --> 00:47:48,400 People don't want to ask questions. 720 00:47:48,420 --> 00:47:50,480 If you come up and use the mic so everybody can hear. 721 00:48:01,780 --> 00:48:02,180 Yeah. 722 00:48:03,580 --> 00:48:05,360 Just had a question about the slides. 723 00:48:05,520 --> 00:48:06,640 If people don't have them. 724 00:48:07,260 --> 00:48:10,500 They will be posted on the DEF CON site eventually. 725 00:48:11,380 --> 00:48:16,260 But if you have them before that, you can go to www.securitytribe.com. 726 00:48:16,500 --> 00:48:19,200 And I will have a link off of there to the slides. 727 00:48:19,300 --> 00:48:21,040 So that everybody can get a copy of them. 728 00:48:21,540 --> 00:48:22,380 You have a question? 729 00:48:22,600 --> 00:48:23,000 Yeah. 730 00:48:23,740 --> 00:48:24,140 Hi. 731 00:48:24,800 --> 00:48:30,280 We see Venema used to have software to help protect RPC services. 732 00:48:30,660 --> 00:48:32,120 Like RPC bind and stuff. 733 00:48:32,320 --> 00:48:34,400 I don't know if they still work for Solaris 8. 734 00:48:34,460 --> 00:48:35,440 Or are there any other... 735 00:48:35,440 --> 00:48:38,320 You could also use it in combination with TCP wrappers. 736 00:48:38,580 --> 00:48:41,200 To help wrapperize and protect your RPC services. 737 00:48:41,200 --> 00:48:44,140 Is anything recommended for Solaris 8 or 9? 738 00:48:44,400 --> 00:48:45,280 In that matter? 739 00:48:47,260 --> 00:48:49,520 Unfortunately, I don't really have a very good answer for you. 740 00:48:49,560 --> 00:48:50,080 I don't know. 741 00:48:53,720 --> 00:48:57,440 Explain your pros and cons of using sudo instead of su. 742 00:48:59,420 --> 00:49:02,280 Actually, sudo I have absolutely no problem with. 743 00:49:02,660 --> 00:49:07,760 It essentially is doing the same thing that I'm doing with the lockdown with the groups. 744 00:49:07,820 --> 00:49:09,800 And thank you very much because I meant to mention that. 745 00:49:09,920 --> 00:49:11,180 It is... 746 00:49:11,200 --> 00:49:15,900 If you want to make it a little bit easier on your admins, that is a definite way to 747 00:49:15,900 --> 00:49:16,340 do it. 748 00:49:16,400 --> 00:49:19,080 And I don't see any problem with doing it that way. 749 00:49:20,500 --> 00:49:24,140 If there are no other questions, I would just like to say thank you. 750 00:49:24,320 --> 00:49:25,440 And one... 751 00:49:25,440 --> 00:49:27,720 Actually, I have a couple of questions for you guys. 752 00:49:27,980 --> 00:49:30,060 And those who have left have missed out. 753 00:49:30,880 --> 00:49:31,980 I've got two boxes. 754 00:49:32,100 --> 00:49:33,980 I'm going to ask a couple of questions from you. 755 00:49:34,360 --> 00:49:34,760 And... 756 00:49:34,760 --> 00:49:36,440 What are you guys going to ask them? 757 00:49:37,800 --> 00:49:39,940 Are you guys going to ask questions for the giveaways? 758 00:49:40,500 --> 00:49:40,900 No. 759 00:49:40,920 --> 00:49:41,100 No. 760 00:49:41,500 --> 00:49:41,780 I'm going to ask the next one. 761 00:49:41,780 --> 00:49:41,900 Next one? 762 00:49:42,260 --> 00:49:43,280 I'm getting out of your way. 763 00:49:44,180 --> 00:49:44,460 Um...