DEF CON 12 is pleased to present Daryl Hyland, IT industry veteran in a number of fields, sysadmin, netadmin, etc. My apologies. Without further ado, DEF CON 12 presents Daryl Hyland. Hope everyone's been having a good time. How many people here have been had to get bailed out of jail this weekend? I don't see any hands. Ah, you're slacking. The name of this presentation is the New Secure Workstation. Can't overemphasize, this is not on my calendar. This presentation is going to be an informative look at Microsoft group policy security issues in today's workplace and the way we as security professionals, system designers, and implementers have poorly deployed group policies as a security solution. Group policies are designed to control system behavior and security. We will be focusing on the security part of this or the lack of the security. Areas of discussion on today's presentation. Where policies are used, what policies control, and why policies are used. And then, of course, we're going to show some exploiting of these weak policies. And in conclusion, we're going to touch a couple bases and hopefully give you some reasons or things to change to improve your security. Over the last decade, Microsoft operating systems have inundated the manufacturing environment as industrial control systems. These systems were manufacturing equipment and they used to do data gathering systems. And the two forms I see them used as is on kiosk style systems within the industry and on Citrix farms. Dealing with industrial control systems, it's very critical that security is maintained at a high level. Downtime within these manufacturing environments could cost a corporation tens of thousands of dollars. And I've actually experienced some systems, if they came down, could actually cause loss of land or life. The second area is standard business desktops. These are your typical desktop systems. These are the systems that you see set in any office environment. Probably from a group policy view, this is probably where I see group policies used the most effectively. In these environments, we don't typically try to lock down and tighten these boxes and make them so secure that they can't do anything. What we try to do in these environments here is basically form a desktop structure that works good for that business environment. We might limit a few applications, but we mainly want to create a structural display for the business person to do their job. The third area is public access terminals. This is a very interesting area. I've talked to several friends that work in the school industry, asking them about group policies. And they basically said, yeah, we use group policies. So I prompt them with a couple questions, and they're pretty much doing what everyone else is doing in lack of security. Library systems. I actually went over to a couple libraries where I live at and seen what I could do on the library systems. Their security is no better than anyone else's. It's obvious. Kiosk systems. This one needs a little more research. I did not have time to put a lot of work into kiosk systems. Kiosk systems would be the systems you see in, as an example, Target grocery stores or Target department stores. Used to put in resumes, applications. They're used for gift registers. They're used for photograph imaging type systems where you can put your little memory cards in and do something with your photographs. These type of systems, I'm not sure exactly what they're using for security, but I wouldn't be surprised if group policies are a part of that security. What does secure restrict? Applications. You want to restrict access to configuration tools within your group policies. If you don't, don't bother restricting anything. If a guy can go in there and change everything, there's no point. Restrict functionality of certain applications. If you have an application that lends itself real well to being configured and manipulated with registry entries, these can be rolled into group policies very effectively. An example of that would be Internet Explorer, which is built into the group policies within Microsoft. And you can turn a lot of functions off and a lot of functions on, and you can manipulate the way the thing looks. The other item here is prevent users from running certain applications. Group policies has a function where you can say a list that you can add applications to that the users can only run those applications. I have yet to see anyone actually use this. And even if you do, all you have to do is rename your hacking application to one on the list and it will run. File system security with group policies. Hide your drive icons, prevent file system browsing. This is purely smoke and mirrors. This does nothing for you. As I show in my demonstration, you'll be able to, with the high drive icons hidden and system browsing shut off, you'll be able to get access to any application running on your system. The only way to properly handle this is with actually NTFS file system rights. If you don't want to use your access in the file system, prevent it with file system rights. Don't try to do it with group policies. So why do we secure? We restrict with group policies. Probably one of the biggest ones, we want to prevent users from screwing up the workstation. Even with group policies in place, I've seen this over and over again. Users going into the system and poking and playing around until they find a way around group policies and basically destroying the system anyways. Prevent users from accessing something. From my perspective, where we see this most is trying to prevent users from getting access to the internet with a web browser. Employees out surfing porn. I don't think group policies is the place to configure this at. I have yet to find a system where that's been done, where I couldn't go in and hack the registry on the box and redirect the whole thing to another out port. This should be done on your network. Stop hackers. I have a little different definition of a hacker. I work in a manufacturing environment for a Fortune 500 company. And the hackers we see is in any employee that has a keyboard and a mouse and spare time on his hands to become a hacker. As an example, I had one system administrator at one of our factories after talking to him about how he was securing his, in this environment it was a Citrix farm. He was using group policies to secure it and a few other applications for securing it. And about every other day he'd have to go down and he'd find out the guys had reconfigured the box and they were getting internet access and they were surfing porn. He'd go down the next day and they'd have all these games running on these boxes. And these are industrial control systems used for pulling data off the processing systems. These are very critical systems. And he could not figure out as an assistant administrator how they were doing this. So what he did was he ended up shadowing and he found out what they were doing. So he went down and asked them how they figured out how to do that. Well they said they sat down and actually went through every possible key combination on the keyboard until they found a way around all this stuff. And the final statement on this page right here is if you're really not sure what you're securing then maybe it doesn't. Over and over again I have system administrators that say I want this locked down. I want it secured. I don't want to be able to do anything. I want to stop them. They go through all this effort, spend all this time, all those man hours trying to secure something and then I usually take about 30 seconds and show them how I can defeat everything they did. At that point they say well what's the point? I don't need to secure it. It's not important. And I say well why are we spending all the man hours? That costs money to the company to restrict this when it's really not needed. So you need to ask this question on everything. If you're really not sure why it needs secured, then maybe it doesn't. These statements here are statements that I've actually had come from system administrator and implementers on our network that have deployed group policies. One of them actually said if I can't get around it, it must be secure. I said well what did you do to try to get around it? Well I tried clicking on a few things. Well let's be real. We're putting these out in people's hands that basically stand all day looking at this machine. Reading the numbers off of it in the manufacturing environment. And what are they going to do? They're going to try every key combination until they get around it. So yeah, they can get around it. The other one is they aren't hackers. They won't figure a way around it. That's usually what it is. After I show them how to get around their group policy securities, I had this statement given to me. They aren't hackers like you, Daryl. They won't find a way around this. Well then I usually re-inform them of what they said to me the day before. That they ended up with 15 or 20 systems that basically guys had hacked into. Added game applications. Brought down Citrix farms adding applications. Yes, they are hackers. You give them a mouse and keyboard and time and they're hackers. The third one there, so they break out of it. That doesn't matter. There's nothing important there. That's where I have to jump back to the previous slide. If you're really not sure why it needs secured, then maybe it doesn't. If you're going to say that, then it probably doesn't need secured. Group policies work. You know, group policies work in the right environment. What are you trying to do? Are you trying to make this your security structure around group policies? Then no, it doesn't work. If group policies are going to be deployed to manipulate the desktop, to create a user environment for your users to be able to do their job, then yes, it does work. You guys are going to be able to do your job. You're going to have to answer this question for yourself. Now let's start getting into some of the fun stuff. Hackers don't need fancy tools or scripts to get around group policies. Let's use the tools right in front of you. I've never had to bring a tool outside the box to actually take over the box. Use the tools that are right in front of you. Internet Explorer, Notepad, your help screens, command line, FTP. I'll be showing some of these in a minute on how these can be used to get around some of these security settings. Give a resourceful man any application and he will rule your system. I guarantee you. If he has time and he has a desire, he will get around your security. Again, know your environment. Know the OS file structure. You can't exploit it if you can't find it. You can't protect it if you can't find it. If you don't know what's there, how can you secure the system? Know your OS command line tools. These can get you around almost anything when it comes to group policies. It doesn't matter what the operating system version is. XP, 2000, 2003. Even Windows 95. If you know your system, you can use it to exploit the system. One of the slides is missing off here. The slide deals with Microsoft's group policy and some known vulnerabilities. I wish I had it up, but I don't. But I'll go ahead and go over it. It deals specifically with group policy delivery to the workstation. There's three known vulnerabilities. One of the vulnerabilities basically says when I log into my box and authenticate to my active directory, I'll also authenticate off to my group policy server, which will deliver the group policy down to my workstation. If you disconnect the cable and authenticate locally, you can put off actually getting new group policy changes. This is a minimal risk, but it does work. And then you can reattach to the network, and based on what the timeout is, which defaults 90 minutes, you can actually delay getting those group policy updates for 90 minutes on the system. The second one deals with DNS, the resolution of your group policy server. If you mess with the DNS, you prevent that box from resolving to the server, you will not get group policies. You'll still log into active directory. You'll still get your file system. But if you screw with the DNS on your box, you can prevent it from getting group policies. The third one deals with exclusive read functions. If I go to a machine, I log in to the network group policy, go out to the group policy server, go down to the list there, find my group policy object associated to me, go ahead and open it in exclusive read mode, walk over to another box that I've never logged into, log in to active directory, it'll authenticate me to active directory, give me my file system, but I won't get the group policies. Now I have a system that has no lockdowns on it. Cheap pet tricks to torment and frustrate your group policy designers. And all these come compliments of Microsoft built right in, most of them. Help screens. If you can get a help screen up, sometimes you can get Internet Explorer up running from a help screen, you can get Notepad up, you can even get diagnostic tools running from a help screen. The second one is loopback. If that box has any shares available to it, and you have the local file system blocked with, you can't get to the icons, you can't browse the file system, I've been able to use this to basically, redirect myself back through the loopback and get the entire file system. One of our designers actually deployed a system, it was a thin client, running embedded XP, and they protected the Citrix server they were connecting to, but they didn't protect the local box. So with the local box, they decided, well for us to get this thing to work, they put group policies on it, but they made the user administrative of the box. Real smart one there. Didn't take me long to find out, all I did was a loopback that could see dollars. Got the full file system, was able to get applications up and running, was able to hack the registry, redirect the box out to the Internet, was able to go anywhere I wanted to go at that point. USB memory drives, this is a big item. Security people need to think real hard about these. If you're going to allow them on your networks, or you're going to allow them on machines that you're trying to restrict some kind of security, if you really want security on that box, turn this off, if you can. Older versions of applications. Microsoft group policy, in a lot of cases, when you set up a policy to protect you from running a certain application, if someone gets an older version of an application, there's a good chance it'll run. And if you're smart, it'll put it on a USB and plug it in and do it. Trigger errors. This is another example I had was with that same thin client. After they reconfigured it and brought it back to me and the user was no longer an administrator, they failed to turn off the debug mode. So basically what I did was when I got Internet Explorer up and running, I did a cross-site scripting attack, wore off one of our internal servers and caused IE to crash. Went into debug mode. Debug program came up and I was able to get access to the file system. And launched certain applications. Security alert pop-ups. As an example, not able to get to the file system. If you have Internet Explorer, I've used this one to exploit a system where I went to a site where the key wasn't signed by a known authority. So I get the pop-up box. With that pop-up box, I was able to save the file to the file system. In this case, I saved it to the desktop, even though there was no applications. The only thing I had access to in this box was the desktop and Internet Explorer. So what I did, there was no icons in the desktop. I saved this to the desktop. They failed to lock down the desktop completely. Now I've got a file sitting on my desktop. I instantly renamed the extension of that file and then did the one right below it. Non-associated extension attack. Where I want to get applications, I just launched that. Microsoft pops up and says, I don't know what to open this with. Just pick an application. Now there's the group policy tricks. I thought I missed that. We'll skip that one. Now we're going to get into some examples. I think we're going to have some fun here. We're going to go ahead and split the screen here. As I was putting this demonstration together, I was trying to weave some interesting tail around this. This is Bob's computer. The best way to describe Bob is he works for his uncle. But knowing that Bob's uncle's company likes Bob, they don't trust him. They think he's a hacker. They know he subscribes to 2600. He goes to DEFCON every year. So what they decided to do was give him a worthless desktop. At least they thought it was worthless. So they locked him down. So they decided to give Bob a clock so he knows what time it is. So he can go home. He can't do nothing with it. They didn't give him any applications. Figured he was a hacker. He'd be dangerous with an application. I could do that. Oh, come on. They don't allow him to do that either. Sorry about that. Maybe I should have done that before I set the demonstration up. We're going to be off the bar here in a second. Don't worry. I was just showing real quick that basically there's no applications. Bob can read a clock so he can go home. He can log off and shut down his box. But other than that they don't want him doing anything. Of course the assistant administrator missed one key feature. He forgot to shut off the Windows key. So Bob knows if he takes the Windows key he can probably hit several different keys and get some kind of reaction. In this case Bob figured he would go ahead and bring up the Help Center. And if we all know, the Help Center is a very big place. Here's nothing but a fancy web browser. Bob knows he can click through here and get several applications up and running. But he's going to go for Internet Explorer. On the right-hand side of this screen here, this is basically a web browser. I believe the extension on these are CHMs, usually written in HTML or Java. Bob knows unless the assistant administrator has specifically gone into group policy, and said do not open a new window, all he needs to do is find the link on the right-hand side, hold down the Shift key, and click on it. And he can have Internet Explorer up and running. But just in case that doesn't work, there's other ways of doing it. In this particular configuration of this box, Bob's going to go ahead and try going to print. When he gets to print, he's going to go ahead and print to a file. Go ahead and save it as test. Yeah, overwrite it. Something's happening. Oh, there we go. Microsoft Office Document Imaging. Well, you can probably find a lot of ways around things in here, but Bob's looking for Internet Explorer. So if you go to send to in a lot of applications, you can find all kinds of interesting things. Here we go. Recipient using Internet fax service. Well, he's not listed in any fax services, so Microsoft's nice enough to tell him, well, if you click OK to open a page in your web browser where you can choose a provider. There you go. Now dealing with shell folder vulnerabilities. There was a bug track that came out in October 2003 dealing with shell folder exploits, kind of a remote exploit using shell folders and shell folder traversal. It was an interesting exploit, but I took it and thought, well, this shell folder thing's kind of intriguing. What can I do with it? Can I get around lockdowns and security on a workstation using the shell folder vulnerabilities? Well, what I found out was, oh, yes, you can. Using shell folder vulnerability, I can actually traverse my file system to another file system. We'll go ahead and give an example of that using a USB. Of course, this USB is considered a local file system, and we have this box locked down, so you can't browse the local file system and you can't see the icons for it. If you want to do a traversal on an XP using a shell folder, you need to join it with a plus symbol. Yeah, of course I want to open it. Take a good look at that date. This is Windows 351 command com running on an XP. There's your backward compatibility. You can open applications from here. When you use an older version, one thing you can't do, don't try to change directories. They don't like it. You can read directories. You can run almost any application from here. But if you try to change directories, don't like it. When you're dealing with a command com or command.exe, you can lock it down in group policies. In the group policies, if you don't want the command com to function, you need to shut down command prompt scripting also when you shut down the command prompt. If you don't, command com will work. So there is a way to stop that. Okay, dealing with reg.exe. This box has reg.edit locked down. Apparently don't like that, does it? Trust me, reg.edit is locked down. You can't run it on this box. But Microsoft is nice enough to give you a command tool, reg.exe. From here, you can export and import registry. I haven't found anywhere in group policies where you can explicitly shut that down. Now we have command com up. Type in reg. Here's the actual syntax for it. Playing around with some of the registry hacks in these locked down systems where the user is just a user. The HT current user. There's a lot of functions in there. You can screw with. This is where you can actually hack IE and change the proxies if it's locked down. Even though everything is secure, a lot of these features you can modify. It will affect the actual policy image that the user is running at that point. There you go. We just dumped the registry for the current user. Bingo. You can dump all the registries out. If you're dealing with kiosk style systems that ought to log in, hey man, go through there and find the password you're using. My research, this one was kind of fun. FTP. Well, what can you do with FTP? Well, you know you can shell out. But, you know, we got the system locked down. It won't let me shell out. Yeah, it will. If you pass it to the shell and then pass your commands to the shell, it will execute. Again, if they shut down the command scripting process, this won't work. But I have yet to see someone shut it down. Non-associated extensions. You can also execute programs from here fairly effectively. Let's go ahead and give that a try. We're going to go ahead and create a file. We're going to call it Fred. Here we go. We're going to put a non-extension on it. A weird one. MNB. I hope that ain't an extension. It sounds like one. Let's change it. That sounds good. Boom. Okay, now from here, if we go ahead and let's just execute it. Thank you. So there we go through and look at the different applications. Also, if your file system is set up so you can't browse your file system and you can't see the icons, and you go to browse and try to get somewhere, it's going to go ahead and freak out on you. Oh, let me see that drive. That's the DVD. Okay. Let's see. There you go. Administrator lockout. It ain't going to let you do anything. But I'm not going to give you an example here because you're going to have to trust me on it. You go to that. If you type in the full path to the file, it will add it to the list for you. As you can see, I've already did the command comm and some of the other ones. But since they didn't want Bob opening anything, I'm going to go ahead and open Word. So what have we done so far? Basically, we get Internet Explorer up, Notepad, and we can hack the registry, and we can run Microsoft Word. There you go. Another big one, Program Manager. If all else fails, this will work in a lot of cases. Program Manager. Run command line. If they have turned off command line scripting, you can still execute DOS commands. But be aware, if they display within a DOS window, you better have quick vision. This doesn't handle pipes and it doesn't handle redirects. That's the biggest problem with it. But you can execute commands. And as an example, here we have substitution. Now, as I mentioned, the local file system is not accessible. In a normal environment, you would typically, in a hard lockdown like this, the user would at least have a network file system that he could write his applications to to use it. If you don't want him getting access to the local file system, and you use group policies to shut that down, if he's smart enough to do the substitution, he can redirect the local file system to a network drive letter. You should do that just to make sure. See, it flashes up there pretty quick. I bring the desktop up. Look at my computer. Now I've created an S drive. There's your C drive. Some other methods and tools. The only application they give you happens to be a processor or Microsoft Word or something like that. Microsoft Word has some neat functions. Insert, hyperlink. From here, you can insert. I don't know. Wordpress. Wordpress. Wordpress. Wordpress. Wordpress. Wordpress. Where's Notepad at? Anyone remember? Send system? . Let's try it here. If we fail, what the heck? . You can create links in here, basically hold down the control key and click on those and it's not in that folder. Okay, you've got to learn how to spell. So you can use that to get access to almost any application, but you obviously need to know where it's at and how to spell it. Restrictions on certain programs. The question was, if you have a note that's not in the loud applications, will it run? I do not believe it will, but if you can get access to rename it, it will. Just rename it to a loud application name. What's that? Okay, so you can restrict by hash, you can restrict by application. Okay, well you can run sign. It's run to applications only. So I guess you can get a little tighter restriction on those applications. Okay, in conclusion, let's take a closer look at why we're using policies and their purpose. Before you go putting a lot of effort into locking things down with policies, you need to take a good hard look at why you're doing it. You try to lock them down because you have hackers that are actually lurking around the especially weekend warriors or board employees, might be better solutions. Inept users, if they have two sticks to rub them together, they poke their eye out with one of them, that's probably the best one. If you don't want users running applications, remove them from the workstation. If you lock out the command ICSI, don't forget the command.com, and you can lock that out using the disabled command.com scripting process. And of course, if you don't want users screwing the registry, don't forget to lock out or remove the reg.exe. And again, let's take a closer look at these USB devices. If you're trying to get security on a machine, these probably need to be taken off or disabled. If you don't want users accessing the file system, secure it with the NTFS file system rights. Don't try to use the group policies as a method. It's purely smoke and mirrors. Can't overemphasize, better security starts with correctly securing the file system. And when policies do fall short of what you're trying to do and they don't work, look at some third-party applications. I'm not going to give you any names here. If someone wants to email me, I'll give you my opinion on a couple of them. You want solutions that prevent any applications not installed by an administrator from running. And I've seen some that did do that. And you want a solution that gives you the ability to drill down. If you truly want to be able to control the system to that level, you need an application that will let you do that. I have a little quote here. It came out of Microsoft's training material. It is crucial that security administrators understand the limitations of group policies. So that they can plan for events in which group policies cannot effectively control user behavior. Group policies is not designed to fully secure client computers. It should not be relied upon exclusively for that purpose. That's right. From Microsoft. Do you have any questions? There should be a way through group policies or through the registry actually to go ahead and globally disable the file association dialogue box as an example so that you would not be able to, under any circumstances or from anywhere, get that box. I'm pretty sure there probably is a way to effectively do that. I've never seen anyone do it because as group policy implementers, we're constantly failing in this area. And that's one of the things I was trying to say. One of the things I was trying to point out. I do not know, I couldn't tell you where to go to do that or where the registry would be to do that. There's a lot of these I don't know to that level and I could go find them so if anyone has any questions for me and they want to email me, I could try to get you a specific answer for it. But right from here, I probably couldn't give you, tell you right to go, where to go in the registry or where to go within group policies to shut down specifically things. One of the biggest rules I've played in this thing is not an implementer of the group policies but a security tester. When they've tried to implement these things, my responsibility has been to go in and say, hey, if your goal is to have this level of security, this isn't working and here it is. And their goal has been to go back and fix it and bring it back to me if that was the plan. But I can find any of that information if anyone has any questions. Just shoot me the email on that. Yes, I can. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Any other questions? 美味 I don't have anything on that right now. Yeah, I'll, shoot me an email and I'll try to find something to get that to you on ADM files. The email ID is... Excuse me? Yeah. No, I'm sorry, don't.