Authentication in IIS

xiaoxiao2021-03-06  105

By Joe Lima

We often think about security measures as ways of protecting resources by preventing access to them. The need for authentication arises because, in the real world, keeping people out of protected areas is only half the battle. Authentication is about letting certain people (or processes ) in, while keeping everyone else out. in practice, this usually means some people are going to have to be given secrets (passwords) that will form part of the credentials they need to present in order to gain access to protected resources. But since , as the old saying goes, the best way to keep a secret is not to, the distribution and exchange of access-providing secrets inevitably raises the level of risk to a secure system. A major goal of authentication, from a security point of view Is Minimizing That Risk - Especially When Uses Are Being Authenticated Remotely, over publicly-accessible networks. Authentication is the process of poking minimally risky holies in one '

s security.In this column I will look at the typical spectrum of authentication methods used in IIS. It is a subject on which you can find plenty synopses online, and a lot of detailed documentation on implementing the specific methods, but not much in between . Without drowning you in implementation details, I will try to go into enough depth to provide a solid understanding of the various options, with special emphasis on the security implications of each.Note: Not every possible option will be covered here, only the most commonly used ones. If there is reader interest, future columns may investigate less-commonplace choices such as client certificate mapping, .NET passport, and options requiring third-party integration like Fortezza and RADIUS.Anonymous AuthenticationIn one sense, anonymous authentication is effectively no Authentication At All, Since The User Is Not Asked To Supply Any Credentials Before Being Served The Requested Resource. However, IT IS Worth Remembering That, FRO M the web server's (or the overrating system "

s) perspective, even an anonymous Web site user is logged into a site using a specific set of credentials.Users who access a site anonymously are logged in using the Anonymous account (by default called IUSR_MACHINENAME although this can, and as a security precaution probably should be renamed). This account requires the Log on Locally right in order to function properly, and by default is part of both the Guests and Everyone groups. When you disable anonymous access to a resource (or a whole site) users must be authenticated in the standard sense - meaning they must provide security credentials such as username and password in order to gain access to the resource.Basic AuthenticationIIS Basic authentication as an implementation of the basic authentication scheme found in section 11 of the HTTP 1.0 specification.As the Spectation Makes Clear, This Method is, in And of Itself, Non-Secure. The Reason Is That Basic Authentication Assumes a Trusted Connection Between Client and Server. Thus, the username and password are transmitted in clear text. More specifically, they are transmitted using Base64 encoding, which is trivially easy to decode. This makes Basic authentication the wrong choice to use over a public network on its own.When combined, however , with the robust transaction security provided by Secure Sockets Layer (SSL), Basic authentication is often the best alternative. One reason is the relative absence of client-side compatibility issues. Basic authentication is a long-standing standard supported by nearly all browsers. IT Also Imposes No Special Requirements on The Server Side - Users CAN Authenticate Against Any Nt Domain, or Even Against Accounts on The Local Machine.

With SSL to shelter the security credentials while they are in transmission, you have an authentication solution that is both highly secure and quite flexible.Basic authentication exampleBasic authentication is a simple challenge / response model. The following listing shows the essential components of an entire Basic authentication transaction at the HTTP layer - essentially this is what you would see if you were watching the exchange of data between client and server using a network sniffer like Microsoft's Network Monitor (keep in mind though that this exchange would be sheltered by end-to -END Encryption IF SSL WERE Being Used. In The First Frame, The Browser Requests A Resource - In this case, the homepage of a web site called "Host." Get / http / 1.1host: host the server thr ITS Challenge: An Access Denied Message Containing The WWW-Authenticate Header, Which Informs The Client of The Type of Authentication Available, And The "Realm" to Which Clients Who SuccessFully . Authenticate will have access (In the Windows implementation, the idea of ​​"realms" has been largely superceded by the NT domain, but a default realm is included for informational reasons anyway.) HTTP / 1.1 401 Access DeniedWWW-Authenticate: Basic realm = "192.168.1.1" On the client, the user sees (on first request and in the default mode) a dialog requesting her credentials. She types in her user name and password and the Base64 encoded version of these credentials is sent back to the server .

Get / HTTP / 1.1Host: hostAuthorization: Basic dGVzdDp0ZXN0 Finally, the server, having gotten the all-clear from the password store (probably a Windows Domain Controller) serves the requested resource.HTTP / 1.1 200 OK Digest AuthenticationThe Digest authentication option was added in Windows 2000 and IIS 5.0. Like Basic authentication, this is an implementation of a technique suggested by Web standards, namely RFC 2069 (superceded by RFC 2617) .Digest authentication also uses a challenge / response model, but it is much more secure than Basic authentication (when used without SSL) It achieves this greater security not by encrypting the secret (the password) before sending it, but rather by following a different design pattern -. one that does not require the client to transmit the password over the Wire at all.instead of sending the password itself, The Client Transmits a One-Way Message Digest (a checksum) of the user's password, using (by default) The MD5 Algorithm. The Server Ten Fetch es the password for that user from a Windows 2000 Domain Controller, reruns the checksum algorithm on it, and compares the two digests. If they match, the server knows that the client knows the correct password, even though the password itself was never sent. (If you have ever wondered what the default ISAPI filter "md5filt" that is installed with IIS 5.0 is used for, now you know.To make the exchange even more secure, the password checksum is computed with a value passed to the client by the Server, Called A Non. Because it is recomputed each....

Constantly changing nonce's help deter replay attacks, since the checksum of the client's password will be different for each logon.While the encryption used in calculating the checksums is not as strong as what is used in SSL, the point is not to encrypt the entire transmission, but rather to use encryption to avoid transmitting the secret in the first place. While not as strong a challenge / response paradigm as Kerberos (see below), Digest authentication has the advantage of working across firewalls and proxies. This is only true of Integrated Windows authentication in the case of (Point to Point Tunneling Protocol) PPTP connections.A major weakness, however, is that passwords must be stored in a reversibly encrypted form, so that the authenticating server (IIS in this case) can access them and Run Them Through The Checksum Algorithm. Although It Is Trivial To Configure Active Directory To Store Individual User Accounts in "Encrypted Clear Text" Form, this Setting Compromises the Stron ger default configuration under which those passwords are stored as hashes (non-reversible). In other words, the price paid here for keeping the password out of the transmission is storing it in a more vulnerable form on the backend.Digest authentication requires Internet Explorer 5.0 and later clients, plus as mentioned Active Directory (Windows 2000) domain accounts on a Primary Domain Controller configured for digest authentication. Here is the relevant Knowledge Base article from Microsoft.Digest authentication exampleHere are the essentials of a Digest authentication transaction. Get / HTTP / 1.1HOST: Host After The Initial Request by The Client The Server Issues The Following Challenge.

HTTP / 1.1 401 Access DeniedWWW-Authenticate: Digest qop = "auth", realm = "host", nonce = "2bd66743fd60d0a94782802000000568aeb718920e1494a50e65be582dcf" The WWW-Authenticate header in this example obviously contains much more information than in the Basic authentication case In addition to. specifying the Digest scheme and realm, it provides the unique nonce to be used by the client in computing its request digest. The qop parameter lets the server announce the "quality of protection" that must be applied to the message digest.GET / HTTP / 1.1Host: hostAuthorization: Digest username = "authtest", realm = "host", qop = "auth" algorithm = "MD5", uri = "/", nonce = "2bd66743fd60d0a94782802000000568aeb718920e1494a50e65be582dcf", nc = 00000001, cnonce = "6012f8c9164809aa4bd43a9d6bf9f006" , response = "30d83bc31f870a4e85a927ffc48fef1b" The client's response to the server's challenge is still more complex. First, the username is passed in the clear so that the server can look up the appropriate password. After some additi onal informational parameters, the nonce is returned unchanged, so that the server can use it in computing its own version of the digest. The "nc" and "cnonce" parameters are required because the server sent the quality of protection (qop) directive in . the challenge The "nc" parameter provides a count of the number of requests the client has sent using this nonce -. duplicate counts indicate an attempted replay attack The "cnonce" parameter is effectively a client-side nonce.

This unique value was used by the client, along with the server's nonce, in calculating the request digest, and it must be used by the server as well. Requiring the use of a client-side nonce adds a measure of mutual authentication and message integrity . checking Finally, the request digest itself (the checksum of the nonce and the user's password) is passed as a 32 character quoted string in the "response" parameter HTTP / 1.1 200 OK Integrated Windows AuthenticationIntegrated Windows authentication -. NT Challenge / Response in NT and IIS 4.0 - has changed over the years as the underlying authentication mechanism for Windows domains has changed from LANMAN (NT LAN Manager) to NTLM (versions 1 and 2) to Kerberos What has remained the same is the core idea of. integrating the process of authenticating on the Web server with the standard domain authentication mechanism. When Windows clients (essentially, the required version of IE) can be presumed, and when passage through firewalls and p roxies are not a concern, this authentication method has always provided significant efficiencies in terms of user account and password management.Integrated Windows authentication is the most complex IIS authentication topic because it incorporates so many different elements, including quite varying levels of security depending on OS Version, Type of Domain and Configuration. It's Stregths and Weakness, Advantages and Limitations, Are Largely Those Of Windows Domain Authentication Itself.

In Windows 2000 domains, Integrated Windows authentication comes in two flavors: NTLM version 2 or Kerberos 5.0 NTLM is a holdover from NT 4.0, in which version 1 was the default authentication mechanism (the stronger version 2 became available with NT Service Pack 4). . Just as Windows 2000 still allows for the use of the NTLM, so NT 4.0 also supported the earlier LANMAN mechanism, and for the same reason - backwards compatibility with Windows clients that could not support the newer standard.This evolutionary approach to upgrading Windows authentication has always proved something of an Achilles' heel from a security point of view, since the presence of the older authentication mechanism as an option weakens the security posture of the newer, more secure mechanism. (See the Multiple Methods and Negotiation section below. ) NTLMThe NTLM Version of Integrated Windows Authentication IS Similar To Digest Authentication In That Is A Challenge / Response Mechanism Where The Challenge Is An once provided by the server to the client. A major difference is that it does not require passwords to be stored in reversibly encrypted form in the Active Directory on the Domain Controller. This as a significant server-side security advantage over Digest authentication.This is accomplished because the client, instead of creating a digest directly from the user's password and the nonce, first creates (but does not store) a hash of that password that is identical to the NTLM hash of the password that is stored in Active Directory on the Domain Controller. The Client Tan Uses The Password Hash and The Non To Build The Digest Response.

Thus the server side of the transaction does not need access to the client's original (clear text) password in order to recompute the digest and verify that the client has knowledge of the password.Integrated Windows authentication will also work with much older versions of IE ( as old as 3.01). However, unlike Digest authentication, NTLM is not firewall or proxy friendly (a culprit here is need for multiple round trips over an open connection), nor does it support delegation of security credentials, once established, to other servers such as SQL (double-hop impersonations) .Integrated Windows authentication example (NTLM) Here is a trace of the essentials of an Integrated Windows authentication session using NTLM GET / HTTP / 1.1 Host:. host HTTP / 1.1 401 Access Denied WWW-Authenticate : Negotiate WWW-Authenticate: NTLM After the Client's Initial Request for a Protected Resource, The Server Responds Much As It Would For Basic Authentication (Except That A Second WWW-Authenticate Header Is SE nt to indicate that the method can be negotiated up to Kerberos by a Kerberos compliant Windows client) GET / HTTP / 1.1 Host:. host Authorization: NTLM TlRMTVNTUAABAAAAB4IAoAAAAAAAAAAAAAAAAAAAAAB = In the Authorization header sent with the client's second request, accepting the offer to use NTLM , the parameter is a so-called Type 1 message, containing a Base64 encoded series of flags indicating the authentication options supported by the client. This is the real beginning of the NTLM specific exchange and, from now on, the HTTP connection must remain open For The Authentication Process To Complete SuccessFully.

HTTP / 1.1 401 Access Denied WWW-Authenticate: NTLM TlRMTVNTUAACAAAADAAMADAAAAAFgoGgCY6qiih5j bAAAAAAAAAAAH4AfgA8AAAAUABPAFIAVAA4ADAAAgAMAFAATwBSAFQA OAAwAAEACgBKAEwASQBNAEEABAAkAHAAbwByAHQAOAAwAHMAbwBmA HQAdwBhAHIAZQAuAGMAbwBtAAMAMABqAGwAaQBtAGEALgBwAG8AcgB0 ADgAMABzAG8AZgB0AHcAYQByAGUALgBjAG8AbQAAAAAA This server's second 401 message is a distinguishing feature of NTLM authentication, relative to the other methods we have looked at The WWW-Authenticate header includes another Base64 encoded message,. this one called a Type 2. It completes the negotiation of the authentication options between server and client and also provides the actual challenge (the nonce) to the client GET / HTTP / 1.1 Host:. host Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGIAAAAYABgAegAAAAwADAB AAAAACgAKAEwAAAAMAAwAVgAAAAAAAACSAAAABYKAoFAATwBSAFQAO AAwAGoAbABpAG0AYQBFAFIATgBFAFMAVACZTd1Br98zFkTowoPysC5ysMaXqb qycwRldOKyZJbCIZLxCfcZe3ZHiYQmG97jr89 = The Client's Third Request Contains a New Authorization Header with a t ype 3 message that answers the server's challenge and proves that the client has knowledge of the correct password. HTTP / 1.1 200 OK Kerberos Kerberos is a Key Distribution Center mechanism that incorporates the Needham-Schroeder challenge / response protocol, Denning-Sacco timestamp nonces, and a Ticket-Granting Service for single sign on Another words, it is quite a complex and subtle mechanism, in comparison to past versions of Windows authentication -. too complex to describe in detail here Generally speaking, it is far more secure than. The Ntlm Mechanism It is Meant To Replace.

The idea of ​​using Kerberos for Internet negotiation of keys was specified in RFC 3129. The core idea in Kerberos is the use of a Key Distribution Center (or KDC - a role played by the Domain Controller in the Windows implementation) to provide shared temporary secrets ( "tickets" in Kerberos-speak) for clients and servers to use in mutual authentication. The KDC maintains a set of master keys corresponding to valid users and servers, which it uses to encrypt these shared temporary secrets. Overlaid on this KDC system is an elaborate set of refinements: challenge / response patterns to combat forgery, timestamps in place of conventional nonces to combat replay attacks, and a ticket granting service to issue Ticket Granting Tickets (TGT) so that users do not have to keep logging in order To Use Different Services WITHIN A SINGLICANTLY GREATER ALGORITHMIC SOPHITISTINTICANTLES KERBEROS An Inhere Security Advantage Over the NTLM Version of Integrated Windows Authenticat ion. In addition Kerberos has a practical advantage over NTLM in that it allows delegation of security credentials for distributed application environments. In other words a user's authenticated identity can be passed to another server, hence another application tier (such as a database server). It also authenticates the server being connected to, as well as the client. It also requires rough synchronization of all clocks on systems throughout the domain, or the timestamps that are an essential part of Kerberos' defense against the reuse of cracked session keys in replay Attacks Won't work. As a result, users Won't becoming.............. ..

Or, worse, a server's time service could be compromised to facilitate an attack with expired tickets. Although Kerberos is default authentication scheme for Windows 2000, XP and 2003, there are many cases of Windows Integrated Authentication in which older, and weaker authentication schemes will end up being used in preference to Kerberos. The authentication routine will negotiate down to NTLM for other clients in a Windows 2000 domain, or for Windows 2000 or later clients when authenticating on NT 4.0, or for those same clients when not part of the domain . You can disable the older authentication schemes, but at the cost of backwards compatibility for scenarios like these One final client-side compatibility consideration:. IE 6.0 on Windows 2000 will not, by default, accept the "Negotiate" challenge and use Kerberos, But Will Instead Take The NTLM Option. this is because the "enable integrated windows Authentication" option is not success by default. here is the knowledge base articl e on how to configure IE on Windows 2000 to use Kerberos when the server offers it Note:.. There is no point in showing you a second HTTP trace of the Windows Integrated authentication logon using Kerberos instead of NTML This is because most of what distinguishes Kerberos from NTLM would not appear in such a trace - the only differences you could see would be the lengths of the encoded strings and the presence of "Negotiate" rather than "NTLM" in front of them Multiple Methods and Negotiation The idea of. .

The IIS and Windows environments provide such a wide range of authentication options among which negotiation can happen that it is important to be aware of this process in some detail. First, it is possible to select several of the authentication methods covered here, and rely on the users' browsers to negotiate the most secure available method. This has the advantage of greater client-side interoperability (non-IE and older IE browsers are given alternatives). However, this essentially means that the level of overall security is that of the weakest link. This danger is repeated if you enable only Windows Integrated authentication, since by default it makes two authentication methods available (NTLM and Kerberos in Windows 2000 domains) and allows downlevel negotiation to determine that the weaker of the two will be used. As Mentioned Above, this is part of a long-term problem with windows automation, etc 帖子 帖子 帖子 帖子 帖子 帖子 帖子ning backwards compatibility with earlier, less-secure methods For example, the NT 4.0 SAM database stores not one but two hashes of the user's password -. one in the relatively secure NTLM hash and one in the much less secure LANMAN hash This gives. a cracker a great shortcut -. first crack the case-insensitive LANMAN password, and then compute the possible NTLM hashes by trying out the various possible combinations of upper and lower case In the case of NT 4.0, the weak link can be eliminated by Disabling the lanture authentication, using the procedure described in this knowledge.

转载请注明原文地址:https://www.9cbs.com/read-123143.html

New Post(0)