My name is Matt Shannon. I work for KPMG as part of the Information Risk Management group. We do penetration testing, vulnerability assessments, general security work. What I'm going to talk about today is Microsoft Front Page. I'm going to cover a couple of different topic areas. It's a pretty heavily deployed tool that's not very well known. I'm going to cover the protocol, the back end systems. I'm going to cover a simple brute force authentication scanning program I put together. I'm going to talk about what to do when you first start. I'm going to talk about how to gain front page access. I'm going to talk about ASP. I'm going to talk about some of the powerful ASP components and tools you can use to gain further access. And then I'm going to wrap it up with how to secure front page. All of you have friends, relatives, girlfriends, clients, others that insist on running front page. This is how you take the extra steps to prevent the people that attended this conference from doing anything to them. And just to get us all on the same page. Before we begin, we're going to talk about a lot of tools and techniques in here. We all know you've got to use these on machines that you have permission to use them on. So, get your written permission ahead of time. Let's get started. Laying the groundwork. Front page. Microsoft Front Page. What is it? You have to ask that question. You've been under a rock for the last ten years. It's Microsoft's integrated website development tool. It's a system for adding pages. It's basic to advanced functionality with little or no web page experience. In addition, it's an integrated Microsoft Office package. And in my personal opinion, a security nightmare. It was built by Vermeer Technologies in early 1995. Vermeer was one of those dot-com explosive firms that created front page to capture the web boom. Following an enormous success, they were bought out by Microsoft in 1996. The original programming staff still works for Microsoft, although the management's moved on to new endeavors. Essays aside, all DLLs, all functions within front page start with the underscore VTI underscore Vermeer Technologies Incorporated. Decoding the system. We're going to talk a little bit about the HTTP protocol and what's going on behind the scenes when you access and administer a front page site. It's client-server communication. Very basic. Front page client talks to the front page server extensions over HTTP put requests. The front page client typically makes requests against author, admin, shtml.exe, as well as VTI RPC commands. We're going to talk about the different DLLs. The admin DLL is typically used for authoring commands, uploading content, downloading content. Reviewing properties, setting permissions. The author DLL is used, like I said, for uploading and adding content. The VTI RPC and shtml are typically used for starting your initial session or beginning access. There's a lot put on that slide, so I'm going to try to break it down for you, but you can go back and read it at your leisure. The authentication system is kind of interesting. It authenticates you every single time you do anything. When you first make a connection, it authenticates. When you scan the directory, it authenticates. When you pull up a file, when you upload or download a file, it authenticates. What it essentially does, the first half of the authentication is let's determine if this actually is a front page enabled server. So the first request is a client request for underscore VTI underscore inf dot html. Basically, this gives us information on server versions. In other words, is this client compatible with this version? It gives me locations for the admin, the author, EXEs or DLLs, whatever case that may be. Following this, the client takes this information and makes a post to VTI RPC. It's kind of an initial session start post. It's trying to initiate communication. The server will typically respond with a 200 OK. The client then posts to VTI RPC. VTI author or admin, depending on the action. In our example here, it's author. In the case that the administration has elected to allow everyone access, at this point, the front page will receive a 200 OK and you will have authenticated. Otherwise, you'll get kicked back a 401.3 authorization required. At this point, the client knows it needs to communicate. It needs to authenticate to the server. It needs to authenticate so it takes its NTLM. In the case of Windows, it takes the NTLM username and password, builds the NTLM challenge, and sends that back to the server. The server will once again respond with a 401.3 authorization required. Except this time, it passes back the server side challenge. At this point, the client, knowing its own username and password, and having a specific server challenge, pushes back the challenge response. It closes with a 200 OK. It's a very simple system, but it happens again and again and again throughout the process of accessing front page. We'll talk a little bit about VTI-INF. This does provide all the configuration information. It's embedded in the comments of the VTI-INF.html. If you were to open that page, it would just say front page configuration information. What resides inside that, on the other hand, is actually the comments, and they show the location of the file. They show the location of the server version information, things like that. Like I said before, VTI-INF actually gives us a lot of extra information about the server itself. Believe it or not, it tells us the operating system in most cases. The .dll's and .exe's, can help us determine that. Anytime the VTI-INF contains author or admin .exe, 9 out of 10 times you're dealing with an Apache or a Unix box. Dll's will of course come on the Windows side. More importantly, the version information can help us narrow down the OS version. This is important for other attacks. I put together a version information table. I've got the... I was not able to obtain a Windows ME personal server version information. I apologize, the formatting got munged. Windows NT, typically it is a 4.x version. Pretty easy to remember. Windows 2000 and Windows XP both fall under a 5.x version, although it's most often than not a much lower subversion number for 2K. It's a 5.1 or a 5.2 versus a 5.6 or 5.8 on XP. I didn't create the name, that's Vermeer, but Vermeer created, they call their packets that they pass back and forth, Vermeer RPC packets. Vermeer RPC packets resemble web services. They resemble encoded HTML with variables. In my opinion, it might have been an early precursor to XML. The following is a sample. This is a sample Vermeer RPC packet. It contains a large amount of information. It's a little clearer, I'm sure, on your CD than it is up here. What you'll see embedded down in there is a physical drive path to a file you attempt to download. It's pretty much a big no-no. You really don't want to keep a complete physical drive path to the file. It's possible to use that kind of information for future Unicode exploits. In addition, if you climb in and start reviewing the different information, you'll find a lot of different functions or features, revision level, additional authorizations and permissions, all embedded in those strings. It would be interesting, and we made multiple attempts to modify different values, and I think there's still additional exploits to be had there. Let's talk about the backend for a minute. One of the more interesting things we were able to do was download a free copy of Microsoft's Windows debugger, the WinDebug tool. It's a free tool. Microsoft gives it away. Attach that to a backend running INET info process and listen as you connect to and make a front page session. Watch what DLLs are being used and what functions the DLLs are calling. You can download WinDebug from Microsoft's debugging site, which I've included here. When you download this, you will also want to enable it to use Microsoft's Symbols server. It'll help you translate what functions they're calling. Both the access to the Symbols server as well as Microsoft's debugging tool are completely free, and a really easy way to get an understanding of what's going on under the hood. Front page server extensions use, as a partial list, other front page server extension DLLs. The AuthL and AWEL DLLs you'll find are used more often than any of the others. The Author and Admin DLLs almost contain stub-like functions that are used to call functions in the earlier DLLs. I don't know the level of debugging skills, but debugging is, is an art as well as a science, and it takes time to understand it. There are multiple guides and tutorials available on the internet. A couple of quick Google searches will point you to dozens. WinDebug's got its own set of help files. But I included here the simple commands I used when I was getting started. You can use the VM to set breakpoints, and it's kind of interesting. You can give it the DLL and a global variable like star. In other words, in the example I did, FP4 AWEL bang star, it'll essentially set a breakpoint for every single function in that DLL. Now, that's going to hurt, because you're going to be stepping through that again and again and again. However, what you're going to get is a list of three, four hundred functions. You can immediately pinpoint and narrow down the functions that seem most interesting to you, such as set permission, get permission, check authorization, things like that. BC to clear those breakpoints. Once you've got your list, you print up your list, you go back and highlight the ones you want to set the breakpoint on, and then go back and run through and step through the code at those points. G is, of course, go. Once you hit a break, you can restart it with go. P pauses the activity. All right. What did I discover when I went through it? This is just a very brief list, but one of the things that I hit on, was the FPAWEL service actually forms a listing of all documents in the defined web prior to accepting a request. It was my hope that it was coded a little more poorly, that it would break for your request, then go and pull the file and retrieve it for you. However, the server does pre-query the site and then create an stack array listing of these values, and then it will reply with what you, when we search this list, when you make a request. However, is there still an opportunity to break out this list? Are there opportunities for the buffer to be overrun? I'm sure there are. DSPContext.getfile is another one of the, getfile and getdocument, they're called when downloading from front page. Set your breakpoints to these, and you can step through and figure out exactly where that array is getting called, and whether or not there are opportunities for buffer overruns. NTDLL is used to, exclusively in the authorization process, and we all know that there were attack vectors on that. Microsoft came out and said they will not patch for NT4. Do those same attack vectors apply via front page? Entirely possible. Okay. Taking some of this background information I learned about front page through my job, I went ahead and put together automated tools to grind through accounts, to grind through passwords, to grind through client front page enabled servers. FPExploiter was what came out of it. It's a really, it's a simple tool. It's a front page password grinding and vulnerability scanner, built as both command line and Perl GTK. In other words, now that you have a better understanding of how front page works, let's find out about finding vulnerable targets. This is what brought about the tool. The tool locates front page accessible web servers, uses default options, in other words, tests for the everyone account, then follows up using user defined accounts and passwords. It comes with a default password list. If I recall, it's one of the ones that the, one of the NetBios forums uses. It's a typical, simple password list. It's a Perl GTK and a command line tool. When you open it under Linux, you will see a window pretty similar to this. The scanner works by, you provide it a class C range. You set targets. Yeah, I could definitely have made it a lot larger than that, but most clients only have a class C network, and we didn't want to help to script these out any more than I had to. You can also set the password list. Like I said before, the password list is created initially with a roughly 25 or 30 standard administrator passwords, very simple things, password 123, the password list can be modified. Keep in mind that using an enormous password dictionary, something on the tune of tens of thousands of passwords, will chew up your memory very quickly. The default account is set to administrator. This was done on purpose. The administrator account does not lock out. If the client had set has a better account for you to use, if you know that their web administrator uses the account webman, or webadmin, or mike, then that would be of course the one you would use. Keep in mind that those accounts can be set to be locked out. Again, the tool allows you to save the log. It wouldn't be very useful to me if all I could do was look at it on the screen. So you can save the log to text, print it up, and add it to your scanning reports. Screen capture during operation. There are more interesting ones on media. On the website. Now, what I didn't cover is that the tool is built for and only runs against IIS-based web servers. I didn't make any modifications to support FrontPage Apache as the authentication system and the processes are very different. FrontPage Apache uses DES or Crypt function on the Unix side. However, they do store their passwords in individual files. Many times these password files are accessible. So I wouldn't be too surprised if in the next three to six weeks you happen to see a version that supports Apache up on the website. There's also an opportunity to redesign it for generic FrontPage access. Perhaps the OpenOffice guys, if they're listening, are interested in adding FrontPage-based access to the OpenOffice suite. And I'm all for rebuilding it something a little faster than Perl GTK. Support for uploading content is very close. There's a few Unicode-based characters that Microsoft puts in, but once all of that's been cleared up, I don't see it taking very long. All the code is available at the website. It's on your DEF CON CD, but I recommend you go to the website tomorrow. The code will be unlocked once I've got access to a console. I recommend you go and download that if you plan on using it. That's where the latest code will be. So let's say you've gained, access to FrontPage, and you're looking at the next steps. In other words, where do you go from here? The little session we're going to call ASP for Hackers. Active server pages have been around for quite a while. And if you ever take the time, or have taken the time to develop any web-based content, ASP is much like PHP. It gives you a lot of options. It gives you a lot of areas you can exploit. You can build some rather impressive administration and control systems straight from a web page. One of the first tools I'm going to talk about is a tool I discovered out on ASP Alliance. Michael Brinkley developed it. Real nice guy. His tool set's rather extensive. The SQL Server, it's a SQL Server database tool. If you've ever administered or accessed SQL Servers, you've gone at them using Query Analyzer. Most of us folks are command line driven, different types, and Query Analyzer allows you to go in and execute all of the administrative queries you would want to do. Add an account, removing users, analyzing the data. What SQL Ultimate allows you to do is it allows you to run a Query Analyzer session directly out of your web browser. Once you've used your front page exploiter to find a vulnerable server, you've logged in and uploaded SQL Ultimate, you'll find you're able to access, administer, and control internal SQL Server databases, as most administrators do place the SA account embedded in the ASP code already on their site. SQL Analyzer, to give you some suggestions, some interesting things to try, adding SQL users is very simple. Most of the time you are part of the SA role. Accessing corporate data, accessing the back end to web applications can also be very powerful. You can execute extended store procedures as well as locate application accounts and passwords. Here's a screen capture of SQL Ultimate. You'll see the query window on the left and the resulting window on the right. Go ahead, go over to ASPAlliance.com and check out the stuff that was put together by Michael. He's really done a lot of great work. He was very amenable to me putting it up here. Like I said, there's the link for the ASP Alliance site. Let's talk about command line ASP. This is an old one. It's been out for quite a while, but there are still some folks that don't know about it. I'm going to butcher this poor guy's name or girl's name. Maseo is what I'm going to try. This tool allows for the execution of simple commands on the command line. It's just that basic. Some of the more interesting things you can do with it, Netstat minus A, Netstat minus N, create your own makeshift reverse DNS lookup. Do a Netstat minus A, get the names. Do a Netstat minus N, get the numbers, match the ports, and you've got kind of a makeshift reverse DNS. You can do an IP config. You can do a VER. You can do a set users. You can net users, net local group. Remember that the account permissions that you have, typically on a site, are when you've cracked a site or something like local system. However, if you've built your own front page site and you set that site to require authentication, the account you log in with is the account you execute these as. Front Page Explorer helps us find vulnerable web servers. Command ASP dot ASP contains custom code to execute simple console commands. Now, like I said before, you can use a Netstat minus A or a Netstat minus AN to make a makeshift reverse DNS. You can use net local group and net view to understand drive mappings in groups. It's a very powerful option. In fact, many clients in the past have had their web server mapped to multiple internal file servers to make retrieving documents on the website much easier, as well as using ping to find additional servers. Here's a screen capture of the command ASP tool in action. It's a very simple punch in the command and hit go and you'll have the results passed back to you in HTML. The code is not available at my site, of course. It's available at secureteam.com. ASP code can be used in conjunction with WinSock controls to provide scanning from the web server. What I'm talking about here is there are a lot of us have other options. I've just mentioned two. There's a lot of other things you can use ASP code for. You can upload controls. Microsoft, as well as a lot of other companies, have developed web-based controls to do any manner of things, and one of which would be a WinSock control, perhaps programmatically scan the internal network. There's been some really fascinating work being done with ASP.net for Samba shares and remote administration. You can use that tool to reach out and do the same sorts of right-click administer sort of activities you would do on the internal network. In addition, you can use the ASP code and an XML HTTP control to proxy surf the intranet. This was a previous client. This was beneficial as the client had mounted web-based cameras in their intranet to provide security monitoring for their employees. So it was very interesting to be able to watch their employees go about their dealing business. We're going to close a little early today, I think. I don't want to get the attorneys mad at me. We're going to talk about holding down the fort. How do you secure a front page? You use simple best practices. As in most systems, your first, last, and primary line of defense is your password. The front page really is no different. You want to choose strong passwords consisting of upper and lower case characters, numbers, special characters. Let's make it something a little more difficult than dog, cat, password, girlfriend's name. I prefer you stick with passwords over eight characters in length. And we can go into a lengthy discussion about, well, it only uses the first seven, and then if you have a 14-character password, it's really like two. That being said, passwords eight characters in length, typically they're easy enough to remember. You have to remember your own phone number, and that's seven characters in length. So what's one more? Change the admin account. Contrary to popular belief, Microsoft actually encourages you to change the name of the administrator account. It will not break all functions. It won't cause the machine to explode. Choose a meaningful admin account, but avoid typical choices like root, admin, supervisor, boss. Concept of least privilege. Only provide the access necessary to get the job done. Use front page roles to assign users author rights versus admin rights. In fact, if there is no reason to have the administrator account have front page access, then pull it. Within front page, the front page has its own set of permissions. Use the front page permissions tool to add or remove accounts as needed. Pull the administrator account or reserve it for, or reserve the front page administration rights for specific accounts. Your best option, and this is my personal favorite, is remind your employees, specifically another girlfriend, family members, that you don't use front page from just anywhere. You use it when you are in your corporate office, environment, VPN, secure area. By that, I recommend using the IP-based restrictions that are native to IIS. Go and take the admin, author, and VTIRPC files and set those to only be allowed access from internal IP addresses only. Consider segmenting your web developers onto a separate segment of your network and allowing that group access to those DLLs only. All right. There's the site. Hi. I don't have a lot of artistic talent unlike some of the other folks here, so it's pretty plain, but it contains the code and the commentary and all of the tools packaged both in typical tar.gzips or RPMs. I want to thank some of the guys who came before me. There's a bunch of front page hacking techs out there on the internet. Some of them are more pertinent than others at this point, but I've included a link to one of them there. The guys over at the Perl GTK tutorial. It's been a long time since I've done anything with GTK. It was good to get up to speed. And Microsoft's put together a pretty big site devoted entirely to front page. It tends to rotate and move around, so you've got to pay attention to where it is. But they've got a lot of the backend processes mapped. They talk a lot about some of the VTI information that gets passed back and forth. We'll close with the thanks. Of course, my lovely wife. My boss. It's a shameless attempt to get a raise. The graphics designer who did the image, Mike D'Andrea. He's a resident blender head, does a lot of this kind of stuff. I could never have come up with anything like that. Steve Bickle, who did the technical review. And the guys over at the, the GTK tutorial put up with my emails. All right. If you've got any questions. Otherwise, I do want to cede the pool that the best question does happen to get one of these cellular PC cards. They won't let me keep it, so I have to give it out to someone with an informative and entertaining question. You said the authentication system for the Apache version of front page and the IIS version of front page. Front page are different. Won't they just use basic and NTLM? Like, I don't think front page has its own authentication system at all. It's just a web server. Is that correct? It isn't. You're close. The difference is the way the information is passed. Front page uses a, has a VTI specific header. It doesn't use the typical NTLM header. So when you go to a website and log in with, say you've got a Microsoft and IIS site and the site has, you know, authentication required, the authorization string is passed back and forth. It's just an NTLM authorization. On the front page side, they've got their own VTI headers embedded in that. It's, from the standpoint of technology, it's very similar. However, from the standpoint of the headers and the exact style of the information that's passed back and forth, it's different. Good question. You know, I wish I could answer that. I haven't had a lot of exposure to the .NET platform. I know that they kept, that front page is used on both XP and the 2003 server. I know that the LLs have not changed. They're all the same. The tool really hasn't changed a lot in the last five or six years. And with 32,000 of them deployed on last Google search, it's remarkable that it hasn't been more, more followed than it has. Yeah. Well, actually, to answer that, .NET allows you to authenticate and upload content from the front page extension. Well, then most likely whatever the same, the same rules would apply. There's likely a huge security role in that. So out of the box, if you wanted to see front page extensions enabled from the internet, outside of providing good passwords for authentication in there, is there any Well, the biggest vulnerability, it's a good question. The question was what's the, what are the, what's the real problem besides passwords and access with the front page, if I think I've got that right. The real problem is it's typically not configured. It's typically deployed right out of the box and the first person to request access for it, someone goes in and sets it to access to everyone. And immediately within, within a few weeks that's forgotten and the site exists. What's interesting is it's not more heavily scanned for, it's not more heavily detected. The IIS scanners I think will tell you if there's a front page enabled site, but they won't go any further than that. They won't tell you if it's got a weak password or missing an account or the everyone account is configured. Yeah. After that, probably the biggest problem is if you don't configure it then your password is something that you use front page as a client to modify the website. Yeah, and honestly, the guys I wouldn't worry as much about, in a professional opinion, the guys I wouldn't worry as much about are the guys that go in and modify your site. I, you know, if someone goes and modifies my main page, I'm probably going to figure that out pretty quickly when my wife or significant other family member calls and asks me, what the heck this is. But the guys I'm worried more about are the ones that slip copies of some of these ASP tools deep down in my site, rename them to make them sound like there's something that should be on my site and it takes me weeks or a well-configured tripwire-like configuration to even find them. That's where the real power is. That's where the real risk is. Yeah. Can you speak to some of the standard vulnerabilities that exist within front page as a platform as opposed to just the Yeah. There are some. In the past, you could go to the VTI underscore CNF file for each directory and, of course, it would give you a directory listing that would allow you to execute different content from there. I found, I went through and one of the links that was in here spoke about a lot of the different, a lot of those older exploits. However, from 2K forward, a lot of those rules do not apply any longer. That's the majority of the clients I was running into. Yeah. If they were 2K or were beta testing O3, I didn't spend the additional time to go in and review those. If you have a client that's on an MT4 or even a, for all extensive purposes, an ME or a Windows 98, it might be worthwhile to go back and take a look at that. However, a lot of those rules don't apply any longer. So, most of the older vulnerabilities are information leakage? From what I saw, yeah, most of the older vulnerabilities were information leakage or directory scanning or, and remember that what I'm, what I really want to hit on is the tool gets configured, installed and enabled more often than not. 32,000 sites on a Google search is enough to kind of make your head spin. And, when it's there, more often than not, it's completely misconfigured. What, what you'll find, what you'll find, I'm sure, in doing this kind of work is that it's not so much vulnerabilities in systems as it's vulnerabilities in people's ability to manage systems that cause problems. All right. It's a good question. Here you go. Yeah, go on and enjoy Vegas, all right? All right.