Blog du Tristank

So terrific that 3 of 4 readers rated it "soporific"

Two easy ways to pick Kerberos from NTLM in an HTTP capture

Two easy ways to pick Kerberos from NTLM in an HTTP capture

  • Comments 1
  • Likes

When tracing authenticated HTTP traffic, you'll often see a Windows client use the Negotiate protocol to authenticate itself to a Windows web server.

In the past, I've surprised my friends and amazed casual onlookers by being able to instantly surmise which authentication protocol was actually in use. While that's a useful skill to have, it's one I'm prepared to share - at great personal expense and possibly the cost of a few free dinners - with you, dear reader.

First up: what's this Negotiate business? Negotiate is actually an umbrella authentication package that covers the NTLM and Kerberos authentication protocols.

If you're (that's "you" in the "your computer" sense of the word) not a Windows domain member, Negotiate will negotiate NTLM only. If you're a domain member and everything's going fantastically (thanks for asking), it's Kerberos. But for a variety of reasons, it might end up being NTLM.

Negotiate might be upgraded in the future to support more than just NTLM and Kerberos, so when that happens, you can probably ignore the advice in this article!

For now, there are two easy ways to work out when Negotiate means Kerberos or NTLM:

1. Number of round-trips to authenticate a client

Not counting the initial anonymous GET request:

  • Kerberos uses one round trip to authenticate a client
  • NTLM has a "challenge" phase that adds a second round trip

The shot from Fiddler below shows responses from the server, each number represents a client request, and the next column is its corresponding response code. The 200s are the successful completion of each authentication sequence.

Request pairs 1 and 2 are a successful Kerberos authentication. Request pairs 3 through 5 are using NTLM because http/fakename isn't a registered SPN in AD. Using Negotiate, if Kerberos authentication fails, NTLM may be used as a fallback.

I forced NTLM by using a DNS hostname for which a kerberos SPN was not registered, which is actually a realistic simulation of the conditions in which double-hop authentication doesn't work.

For the setup-curious, the setup for the /negotiatethis/ virtual directory is as below:

 

2. Size of the Negotiate blob

Kerb tickets are much bigger than password hashes. See if you can spot the difference below! (headers trimmed for compactness)

A. NTLM

------------------------------------------------------------------
3. GET /negotiatethis/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: fakename

HTTP/1.1 401 Unauthorized
Content-Length: 1656
Content-Type: text/html
Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
------------------------------------------------------------------
4. GET /negotiatethis/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: fakename
Authorization: Negotiate TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAFAs4OAAAADw==

HTTP/1.1 401 Unauthorized
Content-Length: 1539
Content-Type: text/html
Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate TlRMTVNTUAACAAAABgAGADgAAAAFgomiCQs+k8e625YAA
AAAAAAAAGIAYgA+AAAABQLODgAAAA9EAEkAQgACAAYARABJAEIAAQAMADIAMAAwADMARA
BDAAQADgBkAGkAYgAuAGQAbwBtAAMAHAAyADAAMAAzAEQAQwAuAGQAaQBiAC4AZABvA
G0ABQAOAGQAaQBiAC4AZABvAG0AAAAAAA==

Date: Wed, 02 Aug 2006 06:27:07 GMT
------------------------------------------------------------------
5. GET /negotiatethis/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: fakename
Authorization: Negotiate TlRMTVNTUAADAAAAGAAYAHwAAAAYABgAlAAAAAYABgBIAAAA
GgAaAE4AAAAUABQAaAAAAAAAAACsAAAABYKIogUCzg4AAAAPRABJAEIAQQBkAG0AaQBuA
GkAcwB0AHIAYQB0AG8AcgAyADAAMAAzAE0ARQBNAEIARQBSAK5mqZs/4zeTAAAAAAAAAA
AAAAAAAAAAADlpPfISbVP+br+jiEvDlc8jTU0LwwgJGw==

HTTP/1.1 200 OK
Date: Wed, 02 Aug 2006 06:27:07 GMT
Server: Microsoft-IIS/6.0
Content-Length: 56
Content-Type: text/html
Set-Cookie: ASPSESSIONIDSATTTAST=NGFNNCCAMIKCAMPIPKDAGAGE; path=/
Cache-control: private
--------------------------------------------------------------------

Image reprinted for easy reference - above were 3, 4 and 5, the NTLM set- below are 1 and 2, Kerberos.

B. Kerberos

------------------------------------------------------------------
1. GET /negotiatethis/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: 2003dc

HTTP/1.1 401 Unauthorized
Content-Length: 1656
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Date: Wed, 02 Aug 2006 05:29:23 GMT

------------------------------------------------------------------
2. GET /negotiatethis/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: 2003dc
Authorization: Negotiate YIIJvwYGKwYBBQUCoIIJszCCCa+gJDAiBgkqhki
C9xIBAgIGCSqGSIb3EgECAgYKKwYBBAGCNwICCqKCCYUEggmBYII
JfQYJKoZIhvcSAQICAQBugglsMIIJaKADAgEFoQMCAQ6iBwMFACA
AAACjggPSYYIDzjCCA8qgAwIBBaEJGwdESUIuRE9NohkwF6ADAgE
CoRAwDhsESFRUUBsGMjAwM2Rjo4IDmzCCA5egAwIBF6EDAgEE
ooIDiQSCA4VWCBvPweTzPp0+99JbpMcHxGmMsxsZRR+CX8MhRM
YXjVy1oLGO0yGRQzVOoPUxzAB3G97FbBZF6/psJ036bkW/K6nZs6U
7vC/pu/Vw83hpUWogKhQJRrb8fuANGgqRnxKPMCsQEqqcaZpEJCR
eqzuhzH9BHPHVH+uzRdkinp9cw1UrlsKm2t/ipxfnTXarUxKg4+xLXQ
qPkh/UsntWH2zesAbmXVIRbJsu48WQRlVflodTXFqi+3E0ITi52+pzH
iz46RGYUsDXohJD43CpJLV5TlSPk0etHSAPj1igqLm9jBGjNUA36HiFq
NNDwtNdw1g3u4RNOSqHg7yrbw72SvOUyDoZeizqh6Zxq3HUzN8LU
w12pNunHeU/WJZff5uGjHZSyioDrEOk7vI134GYh1B4zWsXe8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w
jMKKnNGAvGXOkloSIrBxuSBclZcwlg8Xrr/XIMNaeO1dX72F36KABOk85
EQBKwq6lZCKIICq1HxO2b3+Gt7I8fYBP8yuX/0uLP0wMBJPSlUt/qozEt0/
gK4t2IVg/0EjNVpNEZxvzDX2KbNNBo+Vkb7TCgS7+yYi1mzDAJ1XYRxx5S
tJ55Qo5p0nqqqmgo26smy7xY0bpOXVGdGF1n3C6yeedRrOaSkMqLVm
UAvrFtbJyEryxEZt1NXZl91yCWNt67pvSjRSMpE7yWC0/zWLRPYmfBUgis
I8DmQr9hBsoNJypC3HzUf0FRHQG9yc/ko7GSPEPXHP+eZFlcY+8ZhZrgl
IvgIl6+tc2b8rq+rwQYCh2q3CJt2lC7FaFCl4O2sv6GB8KDkT9V73VP40dX/
7FpiqDntDp9Tj3ihjzrREKeRwMuSHIrtT2dXzipK/hveEre3T+F3hU9NTSj
qCRr4wMSkd8SQzfL2XBL2SlMEHqV9o7l+G44XSVARc9YVdzDcxLvswd6
Ug1ej6D7KbcXAHZi6VdWEKGPxv5SVDLf

HTTP/1.1 200 OK
Date: Wed, 02 Aug 2006 05:29:23 GMT
Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate oYGfMIGcoAMKAQChCwYJKoZIgvcSAQICooGHBIGEYIGBBgkqhki
G9xIBAgICAG9yMHCgAwIBBaEDAgEPomQwYqADAgEXolsEWQLu3qmHQaYEPcEIXKRwn4w0wieU6
w71tqGzllrZMCeBeCDgLaUNmnSfA8SEYCC27ZNJ/wxx3+W4Q3JPy1VmG+lQ6JQtF1nZ6HOZYvnkup6
926v1mgofc7ss

Content-Length: 56
Content-Type: text/html
Cache-control: private
--------------------------------------------------------------------

Using Fiddler, it can be a little tricky to identify the difference in GET request size from the Headers view, but Raw shows you what's what, and how long it is!

My Kerberos back-catalogue.

[Manual Trackbacks]
Ken Schaefer: Two easier ways - using "real" network captures and Ethereal/Wireshark (eg, a network sniffer that understands the authentication blobs and just outright tells you), and the Event Logs.

Comments
  • The newest beta of Fiddler has an "Auth" inspector tab which notes whether or not Kerberos or NTLM is in use.

    [TK] Fantastic!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment