<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=NTLM_Authentication_Scheme_for_HTTP</id>
	<title>NTLM Authentication Scheme for HTTP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=NTLM_Authentication_Scheme_for_HTTP"/>
	<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;action=history"/>
	<updated>2026-05-18T17:24:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1459&amp;oldid=prev</id>
		<title>PeterHarding at 02:56, 25 February 2008</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1459&amp;oldid=prev"/>
		<updated>2008-02-25T02:56:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:56, 25 February 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l458&quot;&gt;Line 458:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 458:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[mailto:ronald@innovation.ch Ronald Tschalär] / 14. March 2001&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[mailto:ronald@innovation.ch Ronald Tschalär] / 14. March 2001&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Microsoft]][[Category:NTLM]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1334&amp;oldid=prev</id>
		<title>PeterHarding at 00:20, 19 February 2008</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1334&amp;oldid=prev"/>
		<updated>2008-02-19T00:20:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:20, 19 February 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l146&quot;&gt;Line 146:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 146:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The nonce is used by the client to create the LanManager and NT responses (see [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Password Hashes|&lt;/del&gt;http://www.innovation.ch/java/ntlm.html#hashes]). It is an array of 8 arbitrary bytes. The message length field contains the length of the complete message, which in this case is always 40.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The nonce is used by the client to create the LanManager and NT responses (see [http://www.innovation.ch/java/ntlm.html#hashes &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Password Hashes&lt;/ins&gt;]). &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;It is an array of 8 arbitrary bytes. The message length field contains the length of the complete message, which in this case is always 40.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Type-3 Message===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Type-3 Message===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l259&quot;&gt;Line 259:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 259:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              +-------+-------+-------+-------+&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              +-------+-------+-------+-------+&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The host, domain, and username strings are in Unicode (little-endian) and are not nul-terminated; the host and domain names are in upper case. The lengths of the response strings are 24.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The host, domain, and username strings are in Unicode (little-endian) and are not nul-terminated; the host and domain names are in upper case. The lengths of the response strings are 24.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l374&quot;&gt;Line 374:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 375:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is an actual example of all the messages. Assume the host name is &amp;quot;LightCity&amp;quot;, the NT domain name is &amp;quot;Ursa-Minor&amp;quot;, the username is &amp;quot;Zaphod&amp;quot;, the password is &amp;quot;Beeblebrox&amp;quot;, and the server sends the nonce &amp;quot;SrvNonce&amp;quot;. Then the handshake is:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is an actual example of all the messages. Assume the host name is &amp;quot;LightCity&amp;quot;, the NT domain name is &amp;quot;Ursa-Minor&amp;quot;, the username is &amp;quot;Zaphod&amp;quot;, the password is &amp;quot;Beeblebrox&amp;quot;, and the server sends the nonce &amp;quot;SrvNonce&amp;quot;. Then the handshake is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     C -&amp;gt; S   GET ...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     C -&amp;gt; S   GET ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l455&quot;&gt;Line 455:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 457:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [mailto:samba-bugs@samba.anu.edu.au Jeremy Allison]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [mailto:samba-bugs@samba.anu.edu.au Jeremy Allison]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ronald Tschalär / 14. March 2001 / &lt;/del&gt;[mailto:ronald@innovation.ch]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[mailto:ronald@innovation.ch &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ronald Tschalär&lt;/ins&gt;] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/ 14. March 2001&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1333&amp;oldid=prev</id>
		<title>PeterHarding at 00:18, 19 February 2008</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1333&amp;oldid=prev"/>
		<updated>2008-02-19T00:18:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:18, 19 February 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[NTLM Authentication]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[NTLM Authentication]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is an attempt at documenting the undocumented NTLM authentication scheme used by M$&amp;#039;s browsers, proxies, and servers (MSIE and IIS); this scheme is also sometimes referred to as the NT challenge/response (NTCR) scheme. Most of the info here is derived from three sources (see also the [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Resources|&lt;/del&gt;http://www.innovation.ch/java/ntlm.html#resources] section at the end of this document): Paul Ashton&amp;#039;s work on the [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NTLM security holes|&lt;/del&gt;http://www.argo.demon.co.uk/nt/ntie.html], the [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;encryption documentation|&lt;/del&gt;ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt] from [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Samba|&lt;/del&gt;http://samba.anu.edu.au/samba/], and network snooping. Since most of this info is reverse-engineered it is bound to contain errors; however, at least one client and one server have been implemented according to this data and work successfully in conjunction with M$&amp;#039;s browsers, proxies and servers.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is an attempt at documenting the undocumented NTLM authentication scheme used by M$&amp;#039;s browsers, proxies, and servers (MSIE and IIS); this scheme is also sometimes referred to as the NT challenge/response (NTCR) scheme. Most of the info here is derived from three sources (see also the [http://www.innovation.ch/java/ntlm.html#resources &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Resources&lt;/ins&gt;] section at the end of this document): Paul Ashton&amp;#039;s work on the [http://www.argo.demon.co.uk/nt/ntie.html &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NTLM security holes&lt;/ins&gt;], the [ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;encryption documentation&lt;/ins&gt;] from [http://samba.anu.edu.au/samba/ &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Samba&lt;/ins&gt;], and network snooping. Since most of this info is reverse-engineered it is bound to contain errors; however, at least one client and one server have been implemented according to this data and work successfully in conjunction with M$&amp;#039;s browsers, proxies and servers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that this scheme is not as secure as [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Digest|&lt;/del&gt;http://www.ietf.org/rfc/rfc2617.txt] and some other schemes; it is slightly better than the Basic authentication scheme, however.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that this scheme is not as secure as [http://www.ietf.org/rfc/rfc2617.txt &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Digest&lt;/ins&gt;] and some other schemes; it is slightly better than the Basic authentication scheme, however.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also note that this scheme is &amp;lt;B&amp;gt;not&amp;lt;/B&amp;gt; an http authentication scheme - it&amp;#039;s a connection authentication scheme which happens to (mis-)use http status codes and headers (and even those incorrectly).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also note that this scheme is &amp;lt;B&amp;gt;not&amp;lt;/B&amp;gt; an http authentication scheme - it&amp;#039;s a connection authentication scheme which happens to (mis-)use http status codes and headers (and even those incorrectly).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l264&quot;&gt;Line 264:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 263:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Password Hashes===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Password Hashes===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To calculate the two response strings two password hashes are used: the LanManager password hash and the NT password hash. These are described in detail in the Samba [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ENCRYPTION.txt|&lt;/del&gt;ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt] document. However, a few things are not clear (such as what the magic constant for the LanManager hash is), so here is some almost-C code which calculates the two responses. Inputs are &amp;lt;VAR&amp;gt;passw&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nonce&amp;lt;/VAR&amp;gt;, the results are in &amp;lt;VAR&amp;gt;lm_resp&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nt_resp&amp;lt;/VAR&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To calculate the two response strings two password hashes are used: the LanManager password hash and the NT password hash. These are described in detail in the Samba [ftp://ftp.samba.org/pub/samba/docs/textdocs/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ENCRYPTION.txt &lt;/ins&gt;ENCRYPTION.txt] document. However, a few things are not clear (such as what the magic constant for the LanManager hash is), so here is some almost-C code which calculates the two responses. Inputs are &amp;lt;VAR&amp;gt;passw&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nonce&amp;lt;/VAR&amp;gt;, the results are in &amp;lt;VAR&amp;gt;lm_resp&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nt_resp&amp;lt;/VAR&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;PRE&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l452&quot;&gt;Line 452:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 451:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Special thanks to the following people who helped with the collection and debugging of the above information:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Special thanks to the following people who helped with the collection and debugging of the above information:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jon Lennard|&lt;/del&gt;mailto:jlennard@dsg.com]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [mailto:jlennard@dsg.com &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jon Lennard&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Paul Ashton|&lt;/del&gt;mailto:paul@argo.demon.co.uk]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [mailto:paul@argo.demon.co.uk &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Paul Ashton&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jeremy Allison|&lt;/del&gt;mailto:samba-bugs@samba.anu.edu.au]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [mailto:samba-bugs@samba.anu.edu.au &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jeremy Allison&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ronald Tschalär / 14. March 2001 / [mailto:ronald@innovation.ch]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ronald Tschalär / 14. March 2001 / [mailto:ronald@innovation.ch]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1329&amp;oldid=prev</id>
		<title>PeterHarding: New page:  Back to NTLM Authentication  =NTLM Authentication Scheme for HTTP=   ==Introduction==  This is an attempt at documenting the undocumented NTLM authentication scheme used by M$&#039;s brows...</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=NTLM_Authentication_Scheme_for_HTTP&amp;diff=1329&amp;oldid=prev"/>
		<updated>2008-02-18T22:54:56Z</updated>

		<summary type="html">&lt;p&gt;New page:  Back to &lt;a href=&quot;/kb/index.php/NTLM_Authentication&quot; title=&quot;NTLM Authentication&quot;&gt;NTLM Authentication&lt;/a&gt;  =NTLM Authentication Scheme for HTTP=   ==Introduction==  This is an attempt at documenting the undocumented NTLM authentication scheme used by M$&amp;#039;s brows...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Back to [[NTLM Authentication]]&lt;br /&gt;
&lt;br /&gt;
=NTLM Authentication Scheme for HTTP=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This is an attempt at documenting the undocumented NTLM authentication scheme used by M$&amp;#039;s browsers, proxies, and servers (MSIE and IIS); this scheme is also sometimes referred to as the NT challenge/response (NTCR) scheme. Most of the info here is derived from three sources (see also the [Resources|http://www.innovation.ch/java/ntlm.html#resources] section at the end of this document): Paul Ashton&amp;#039;s work on the [NTLM security holes|http://www.argo.demon.co.uk/nt/ntie.html], the [encryption documentation|ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt] from [Samba|http://samba.anu.edu.au/samba/], and network snooping. Since most of this info is reverse-engineered it is bound to contain errors; however, at least one client and one server have been implemented according to this data and work successfully in conjunction with M$&amp;#039;s browsers, proxies and servers.&lt;br /&gt;
&lt;br /&gt;
Note that this scheme is not as secure as [Digest|http://www.ietf.org/rfc/rfc2617.txt] and some other schemes; it is slightly better than the Basic authentication scheme, however.&lt;br /&gt;
&lt;br /&gt;
Also note that this scheme is &amp;lt;B&amp;gt;not&amp;lt;/B&amp;gt; an http authentication scheme - it&amp;#039;s a connection authentication scheme which happens to (mis-)use http status codes and headers (and even those incorrectly).&lt;br /&gt;
&lt;br /&gt;
==NTLM Handshake==&lt;br /&gt;
&lt;br /&gt;
When a client needs to authenticate itself to a proxy or server using the NTLM scheme then the following 4-way handshake takes place (only parts of the request and status line and the relevant headers are shown here; &amp;quot;C&amp;quot; is the client, &amp;quot;S&amp;quot; the server):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    1: C  --&amp;gt; S   GET ...&lt;br /&gt;
&lt;br /&gt;
    2: C &amp;lt;--  S   401 Unauthorized&lt;br /&gt;
                  WWW-Authenticate: NTLM&lt;br /&gt;
&lt;br /&gt;
    3: C  --&amp;gt; S   GET ...&lt;br /&gt;
                  Authorization: NTLM &amp;lt;BASE64-ENCODED type-1-message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    4: C &amp;lt;--  S   401 Unauthorized&lt;br /&gt;
                  WWW-Authenticate: NTLM &amp;lt;BASE64-ENCODED type-2-message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    5: C  --&amp;gt; S   GET ...&lt;br /&gt;
                  Authorization: NTLM &amp;lt;BASE64-ENCODED type-3-message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    6: C &amp;lt;--  S   200 Ok&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
&lt;br /&gt;
The three messages sent in the handshake are binary structures. Each one is described below as a pseudo-C struct and in a memory layout diagram. &amp;lt;VAR&amp;gt;byte&amp;lt;/VAR&amp;gt; is an 8-bit field; &amp;lt;VAR&amp;gt;short&amp;lt;/VAR&amp;gt; is a 16-bit field. All fields are unsigned. Numbers are stored in little-endian order. Struct fields named &amp;lt;VAR&amp;gt;zero&amp;lt;/VAR&amp;gt; contain all zeroes. An array length of &amp;quot;*&amp;quot; indicates a variable length field. Hexadecimal numbers and quoted characters in the comments of the struct indicate fixed values for the given field.&lt;br /&gt;
&lt;br /&gt;
The field &amp;lt;VAR&amp;gt;flags&amp;lt;/VAR&amp;gt; is presumed to contain flags, but their significance is unknown; the values given are just those found in the packet traces.&lt;br /&gt;
&lt;br /&gt;
===Type-1 Message===&lt;br /&gt;
&lt;br /&gt;
This message contains the host name and the NT domain name of the client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    struct {&lt;br /&gt;
        byte    protocol[8];     // &amp;#039;N&amp;#039;, &amp;#039;T&amp;#039;, &amp;#039;L&amp;#039;, &amp;#039;M&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;P&amp;#039;, &amp;#039;\0&amp;#039;&lt;br /&gt;
        byte    type;            // 0x01&lt;br /&gt;
        byte    zero[3];&lt;br /&gt;
        short   flags;           // 0xb203&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   dom_len;         // domain string length&lt;br /&gt;
        short   dom_len;         // domain string length&lt;br /&gt;
        short   dom_off;         // domain string offset&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   host_len;        // host string length&lt;br /&gt;
        short   host_len;        // host string length&lt;br /&gt;
        short   host_off;        // host string offset (always 0x20)&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        byte    host[*];         // host string (ASCII)&lt;br /&gt;
        byte    dom[*];          // domain string (ASCII)&lt;br /&gt;
    } type-1-message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
                 0       1       2       3&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         0:  |  &amp;#039;N&amp;#039;  |  &amp;#039;T&amp;#039;  |  &amp;#039;L&amp;#039;  |  &amp;#039;M&amp;#039;  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         4:  |  &amp;#039;S&amp;#039;  |  &amp;#039;S&amp;#039;  |  &amp;#039;P&amp;#039;  |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         8:  |   1   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        12:  | 0x03  | 0xb2  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        16:  | domain length | domain length |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        20:  | domain offset |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        24:  |  host length  |  host length  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        28:  |  host offset  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        32:  |  host string                  |&lt;br /&gt;
             +                               +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +             +-----------------+&lt;br /&gt;
             |             | domain string   |&lt;br /&gt;
             +-------------+                 +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The host and domain strings are ASCII (or possibly ISO-8859-1), are uppercased, and are not nul-terminated. The host name is only the host name, not the FQDN (e.g. just &amp;quot;GOOFY&amp;quot;, not &amp;quot;GOOFY.DISNEY.COM&amp;quot;). The offset&amp;#039;s refer to the offset of the specific field within the message, and the lengths are the length of specified field. For example, in the above message &amp;lt;CODE&amp;gt;host_off = 32&amp;lt;/CODE&amp;gt; and &amp;lt;CODE&amp;gt;dom_off = host_off + host_len&amp;lt;/CODE&amp;gt;. Note that the lengths are included twice (for some unfathomable reason).&lt;br /&gt;
&lt;br /&gt;
===Type-2 Message===&lt;br /&gt;
&lt;br /&gt;
This message contains the server&amp;#039;s NTLM challenge.&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    struct {&lt;br /&gt;
        byte    protocol[8];     // &amp;#039;N&amp;#039;, &amp;#039;T&amp;#039;, &amp;#039;L&amp;#039;, &amp;#039;M&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;P&amp;#039;, &amp;#039;\0&amp;#039;&lt;br /&gt;
        byte    type;            // 0x02&lt;br /&gt;
        byte    zero[7];&lt;br /&gt;
        short   msg_len;         // 0x28&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
        short   flags;           // 0x8201&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        byte    nonce[8];        // nonce&lt;br /&gt;
        byte    zero[8];&lt;br /&gt;
    } type-2-message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
                 0       1       2       3&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         0:  |  &amp;#039;N&amp;#039;  |  &amp;#039;T&amp;#039;  |  &amp;#039;L&amp;#039;  |  &amp;#039;M&amp;#039;  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         4:  |  &amp;#039;S&amp;#039;  |  &amp;#039;S&amp;#039;  |  &amp;#039;P&amp;#039;  |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         8:  |   2   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        12:  |   0   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        16:  |  message len  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        20:  | 0x01  | 0x82  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        24:  |                               |&lt;br /&gt;
             +          server nonce         |&lt;br /&gt;
        28:  |                               |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        32:  |   0   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        36:  |   0   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The nonce is used by the client to create the LanManager and NT responses (see [Password Hashes|http://www.innovation.ch/java/ntlm.html#hashes]). It is an array of 8 arbitrary bytes. The message length field contains the length of the complete message, which in this case is always 40.&lt;br /&gt;
&lt;br /&gt;
===Type-3 Message===&lt;br /&gt;
&lt;br /&gt;
This message contains the username, host name, NT domain name, and the two &amp;quot;responses&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    struct {&lt;br /&gt;
        byte    protocol[8];     // &amp;#039;N&amp;#039;, &amp;#039;T&amp;#039;, &amp;#039;L&amp;#039;, &amp;#039;M&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;S&amp;#039;, &amp;#039;P&amp;#039;, &amp;#039;\0&amp;#039;&lt;br /&gt;
        byte    type;            // 0x03&lt;br /&gt;
        byte    zero[3];&lt;br /&gt;
&lt;br /&gt;
        short   lm_resp_len;     // LanManager response length (always 0x18)&lt;br /&gt;
        short   lm_resp_len;     // LanManager response length (always 0x18)&lt;br /&gt;
        short   lm_resp_off;     // LanManager response offset&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   nt_resp_len;     // NT response length (always 0x18)&lt;br /&gt;
        short   nt_resp_len;     // NT response length (always 0x18)&lt;br /&gt;
        short   nt_resp_off;     // NT response offset&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   dom_len;         // domain string length&lt;br /&gt;
        short   dom_len;         // domain string length&lt;br /&gt;
        short   dom_off;         // domain string offset (always 0x40)&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   user_len;        // username string length&lt;br /&gt;
        short   user_len;        // username string length&lt;br /&gt;
        short   user_off;        // username string offset&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   host_len;        // host string length&lt;br /&gt;
        short   host_len;        // host string length&lt;br /&gt;
        short   host_off;        // host string offset&lt;br /&gt;
        byte    zero[6];&lt;br /&gt;
&lt;br /&gt;
        short   msg_len;         // message length&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        short   flags;           // 0x8201&lt;br /&gt;
        byte    zero[2];&lt;br /&gt;
&lt;br /&gt;
        byte    dom[*];          // domain string (unicode)&lt;br /&gt;
        byte    user[*];         // username string (unicode)&lt;br /&gt;
        byte    host[*];         // host string (unicode)&lt;br /&gt;
        byte    lm_resp[*];      // LanManager response&lt;br /&gt;
        byte    nt_resp[*];      // NT response&lt;br /&gt;
    } type-3-message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
                 0       1       2       3&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         0:  |  &amp;#039;N&amp;#039;  |  &amp;#039;T&amp;#039;  |  &amp;#039;L&amp;#039;  |  &amp;#039;M&amp;#039;  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         4:  |  &amp;#039;S&amp;#039;  |  &amp;#039;S&amp;#039;  |  &amp;#039;P&amp;#039;  |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
         8:  |   3   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        12:  |  LM-resp len  |  LM-Resp len  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        16:  |  LM-resp off  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        20:  |  NT-resp len  |  NT-Resp len  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        24:  |  NT-resp off  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        28:  | domain length | domain length |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        32:  | domain offset |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        36:  |  user length  |  user length  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        40:  |  user offset  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        44:  |  host length  |  host length  |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        48:  |  host offset  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        52:  |   0   |   0   |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        56:  |  message len  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        60:  | 0x01  | 0x82  |   0   |   0   |&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
        64:  | domain string                 |&lt;br /&gt;
             +                               +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +           +-------------------+&lt;br /&gt;
             |           | user string       |&lt;br /&gt;
             +-----------+                   +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +                 +-------------+&lt;br /&gt;
             |                 | host string |&lt;br /&gt;
             +-----------------+             +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +   +---------------------------+&lt;br /&gt;
             |   | LanManager-response       |&lt;br /&gt;
             +---+                           +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +            +------------------+&lt;br /&gt;
             |            | NT-response      |&lt;br /&gt;
             +------------+                  +&lt;br /&gt;
             .                               .&lt;br /&gt;
             .                               .&lt;br /&gt;
             +-------+-------+-------+-------+&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
The host, domain, and username strings are in Unicode (little-endian) and are not nul-terminated; the host and domain names are in upper case. The lengths of the response strings are 24.&lt;br /&gt;
&lt;br /&gt;
===Password Hashes===&lt;br /&gt;
&lt;br /&gt;
To calculate the two response strings two password hashes are used: the LanManager password hash and the NT password hash. These are described in detail in the Samba [ENCRYPTION.txt|ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt] document. However, a few things are not clear (such as what the magic constant for the LanManager hash is), so here is some almost-C code which calculates the two responses. Inputs are &amp;lt;VAR&amp;gt;passw&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nonce&amp;lt;/VAR&amp;gt;, the results are in &amp;lt;VAR&amp;gt;lm_resp&amp;lt;/VAR&amp;gt; and &amp;lt;VAR&amp;gt;nt_resp&amp;lt;/VAR&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    /* setup LanManager password */&lt;br /&gt;
&lt;br /&gt;
    char  lm_pw[14];&lt;br /&gt;
    int   len = strlen(passw);&lt;br /&gt;
    if (len &amp;gt; 14)  len = 14;&lt;br /&gt;
&lt;br /&gt;
    for (idx=0; idx&lt;br /&gt;
        lm_pw[idx] = toupper(passw[idx]);&lt;br /&gt;
    for (; idx&amp;lt;14; idx++)&lt;br /&gt;
        lm_pw[idx] = 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* create LanManager hashed password */&lt;br /&gt;
&lt;br /&gt;
    unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 };&lt;br /&gt;
    unsigned char lm_hpw[21];&lt;br /&gt;
    des_key_schedule ks;&lt;br /&gt;
&lt;br /&gt;
    setup_des_key(lm_pw, ks);&lt;br /&gt;
    des_ecb_encrypt(magic, lm_hpw, ks);&lt;br /&gt;
&lt;br /&gt;
    setup_des_key(lm_pw+7, ks);&lt;br /&gt;
    des_ecb_encrypt(magic, lm_hpw+8, ks);&lt;br /&gt;
&lt;br /&gt;
    memset(lm_hpw+16, 0, 5);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* create NT hashed password */&lt;br /&gt;
&lt;br /&gt;
    int   len = strlen(passw);&lt;br /&gt;
    char  nt_pw[2*len];&lt;br /&gt;
    for (idx=0; idx&lt;br /&gt;
    {&lt;br /&gt;
        nt_pw[2*idx]   = passw[idx];&lt;br /&gt;
        nt_pw[2*idx+1] = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    unsigned char nt_hpw[21];&lt;br /&gt;
    MD4_CTX context;&lt;br /&gt;
    MD4Init(&amp;amp;context);&lt;br /&gt;
    MD4Update(&amp;amp;context, nt_pw, 2*len);&lt;br /&gt;
    MD4Final(nt_hpw, &amp;amp;context);&lt;br /&gt;
&lt;br /&gt;
    memset(nt_hpw+16, 0, 5);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* create responses */&lt;br /&gt;
&lt;br /&gt;
    unsigned char lm_resp[24], nt_resp[24];&lt;br /&gt;
    calc_resp(lm_hpw, nonce, lm_resp);&lt;br /&gt;
    calc_resp(nt_hpw, nonce, nt_resp);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Helpers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    /*&lt;br /&gt;
     * takes a 21 byte array and treats it as 3 56-bit DES keys. The&lt;br /&gt;
     * 8 byte plaintext is encrypted with each key and the resulting 24&lt;br /&gt;
     * bytes are stored in the results array.&lt;br /&gt;
     */&lt;br /&gt;
    void calc_resp(unsigned char *keys, unsigned char *plaintext, unsigned char *results)&lt;br /&gt;
    {&lt;br /&gt;
        des_key_schedule ks;&lt;br /&gt;
&lt;br /&gt;
        setup_des_key(keys, ks);&lt;br /&gt;
        des_ecb_encrypt((des_cblock*) plaintext, (des_cblock*) results, ks, DES_ENCRYPT);&lt;br /&gt;
&lt;br /&gt;
        setup_des_key(keys+7, ks);&lt;br /&gt;
        des_ecb_encrypt((des_cblock*) plaintext, (des_cblock*) (results+8), ks, DES_ENCRYPT);&lt;br /&gt;
&lt;br /&gt;
        setup_des_key(keys+14, ks);&lt;br /&gt;
        des_ecb_encrypt((des_cblock*) plaintext, (des_cblock*) (results+16), ks, DES_ENCRYPT);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * turns a 56 bit key into the 64 bit, odd parity key and sets the key.&lt;br /&gt;
     * The key schedule ks is also set.&lt;br /&gt;
     */&lt;br /&gt;
    void setup_des_key(unsigned char key_56[], des_key_schedule ks)&lt;br /&gt;
    {&lt;br /&gt;
        des_cblock key;&lt;br /&gt;
&lt;br /&gt;
        key[0] = key_56[0];&lt;br /&gt;
        key[1] = ((key_56[0] &amp;lt;&amp;lt; 7) &amp;amp; 0xFF) | (key_56[1] &amp;gt;&amp;gt; 1);&lt;br /&gt;
        key[2] = ((key_56[1] &amp;lt;&amp;lt; 6) &amp;amp; 0xFF) | (key_56[2] &amp;gt;&amp;gt; 2);&lt;br /&gt;
        key[3] = ((key_56[2] &amp;lt;&amp;lt; 5) &amp;amp; 0xFF) | (key_56[3] &amp;gt;&amp;gt; 3);&lt;br /&gt;
        key[4] = ((key_56[3] &amp;lt;&amp;lt; 4) &amp;amp; 0xFF) | (key_56[4] &amp;gt;&amp;gt; 4);&lt;br /&gt;
        key[5] = ((key_56[4] &amp;lt;&amp;lt; 3) &amp;amp; 0xFF) | (key_56[5] &amp;gt;&amp;gt; 5);&lt;br /&gt;
        key[6] = ((key_56[5] &amp;lt;&amp;lt; 2) &amp;amp; 0xFF) | (key_56[6] &amp;gt;&amp;gt; 6);&lt;br /&gt;
        key[7] =  (key_56[6] &amp;lt;&amp;lt; 1) &amp;amp; 0xFF;&lt;br /&gt;
&lt;br /&gt;
        des_set_odd_parity(&amp;amp;key);&lt;br /&gt;
        des_set_key(&amp;amp;key, ks);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping the Connection Alive==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, this scheme authenticates &amp;lt;I&amp;gt;connections&amp;lt;/I&amp;gt;, not requests. This manifests itself in that the network connection must be kept alive during the second part of the handshake, i.e. between the receiving of the type-2 message from the server (step 4) and the sending of the type-3 message (step 5). Each time the connection is closed this second part (steps 3 through 6) must be repeated over the new connection (i.e. it&amp;#039;s not enough to just keep sending the last type-3 message). Also, once the connection is authenticated, the Authorization header need not be sent anymore while the connection stays open, no matter what resource is accessed.&lt;br /&gt;
&lt;br /&gt;
For implementations wishing to work with M$&amp;#039;s software this means that they must make sure they use either HTTP/1.0 keep-alive&amp;#039;s or HTTP/1.1 persistent connections, and that they must be prepared to do the second part of the handshake each time the connection was closed and is reopened. Server implementations must also make sure that HTTP/1.0 responses contain a Content-length header (as otherwise the connection must be closed after the response), and that HTTP/1.1 responses either contain a Content-length header or use the chunked transfer encoding.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
Here is an actual example of all the messages. Assume the host name is &amp;quot;LightCity&amp;quot;, the NT domain name is &amp;quot;Ursa-Minor&amp;quot;, the username is &amp;quot;Zaphod&amp;quot;, the password is &amp;quot;Beeblebrox&amp;quot;, and the server sends the nonce &amp;quot;SrvNonce&amp;quot;. Then the handshake is:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
    C -&amp;gt; S   GET ...&lt;br /&gt;
&lt;br /&gt;
    S -&amp;gt; C   401 Unauthorized&lt;br /&gt;
             WWW-Authenticate: NTLM&lt;br /&gt;
&lt;br /&gt;
    C -&amp;gt; S   GET ...&lt;br /&gt;
             Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S&lt;br /&gt;
&lt;br /&gt;
    S -&amp;gt; C   401 Unauthorized&lt;br /&gt;
             WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==&lt;br /&gt;
&lt;br /&gt;
    C -&amp;gt; S   GET ...&lt;br /&gt;
             Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT&lt;br /&gt;
&lt;br /&gt;
    S -&amp;gt; C   200 Ok&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the unencoded messages are:&lt;br /&gt;
&lt;br /&gt;
Type-1 Message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef&lt;br /&gt;
  0:  4e 54 4c 4d 53 53 50 00 01 00 00 00 03 b2 00 00  &amp;quot;NTLMSSP.........&amp;quot;&lt;br /&gt;
 10:  0a 00 0a 00 29 00 00 00 09 00 09 00 20 00 00 00  &amp;quot;....)....... ...&amp;quot;&lt;br /&gt;
 20:  4c 49 47 48 54 43 49 54 59 55 52 53 41 2d 4d 49  &amp;quot;LIGHTCITYURSA-MI&amp;quot;&lt;br /&gt;
 30:  4e 4f 52                                         &amp;quot;NOR&amp;quot;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type-2 Message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef&lt;br /&gt;
   0:  4e 54 4c 4d 53 53 50 00 02 00 00 00 00 00 00 00  &amp;quot;NTLMSSP.........&amp;quot;&lt;br /&gt;
  10:  28 00 00 00 01 82 00 00 53 72 76 4e 6f 6e 63 65  &amp;quot;(.......SrvNonce&amp;quot;&lt;br /&gt;
  20:  00 00 00 00 00 00 00 00                          &amp;quot;........&amp;quot;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Type-3 Message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef&lt;br /&gt;
   0:  4e 54 4c 4d 53 53 50 00 03 00 00 00 18 00 18 00  &amp;quot;NTLMSSP.........&amp;quot;&lt;br /&gt;
  10:  72 00 00 00 18 00 18 00 8a 00 00 00 14 00 14 00  &amp;quot;r...............&amp;quot;&lt;br /&gt;
  20:  40 00 00 00 0c 00 0c 00 54 00 00 00 12 00 12 00  &amp;quot;@.......T.......&amp;quot;&lt;br /&gt;
  30:  60 00 00 00 00 00 00 00 a2 00 00 00 01 82 00 00  &amp;quot;`...............&amp;quot;&lt;br /&gt;
  40:  55 00 52 00 53 00 41 00 2d 00 4d 00 49 00 4e 00  &amp;quot;U.R.S.A.-.M.I.N.&amp;quot;&lt;br /&gt;
  50:  4f 00 52 00 5a 00 61 00 70 00 68 00 6f 00 64 00  &amp;quot;O.R.Z.a.p.h.o.d.&amp;quot;&lt;br /&gt;
  60:  4c 00 49 00 47 00 48 00 54 00 43 00 49 00 54 00  &amp;quot;L.I.G.H.T.C.I.T.&amp;quot;&lt;br /&gt;
  70:  59 00 ad 87 ca 6d ef e3 46 85 b9 c4 3c 47 7a 8c  &amp;quot;Y....m..F...&lt;br /&gt;
  80:  42 d6 00 66 7d 68 92 e7 e8 97 e0 e0 0d e3 10 4a  &amp;quot;B..f}h.........J&amp;quot;&lt;br /&gt;
  90:  1b f2 05 3f 07 c7 dd a8 2d 3c 48 9a e9 89 e1 b0  &amp;quot;...?....-&amp;lt;H.....&amp;gt;&lt;br /&gt;
  a0:  00 d3                                            &amp;quot;..&amp;quot;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference, the intermediate hashed passwords are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
  lm_hpw (LanManager hashed password): 91 90 16 f6 4e c7 b0 0b a2 35 02 8c a5 0c 7a 03 00 00 00 00 00&lt;br /&gt;
  nt_hpw (NT hashed password):         8c 1b 59 e3 2e 66 6d ad f1 75 74 5f ad 62 c1 33 00 00 00 00 00&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
* Squid&amp;#039;s NLTM authentication project [http://squid.sourceforge.net/ntlm/]&lt;br /&gt;
* Encryption description for Samba [ftp://ftp.samba.org/pub/samba/docs/textdocs/ENCRYPTION.txt]&lt;br /&gt;
* Info on the MSIE security hole [http://oliver.efri.hr/%7Ecrv/security/bugs/NT/ie6.html]&lt;br /&gt;
* FAQ: NT Cryptographic Password Attacks &amp;amp; Defences [http://www.ntbugtraq.com/default.asp?sid=1&amp;amp;pid=47&amp;amp;aid=17]&lt;br /&gt;
* M$&amp;#039;s hotfix to disable the sending of the LanManager response [ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/NT40/hotfixes-postSP3/lm-fix]&lt;br /&gt;
* A description of M$&amp;#039;s hotfix [http://www.tryc.on.ca/archives/bugtraq/1997_3/0070.html]&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
&lt;br /&gt;
Special thanks to the following people who helped with the collection and debugging of the above information:&lt;br /&gt;
&lt;br /&gt;
* [Jon Lennard|mailto:jlennard@dsg.com]&lt;br /&gt;
* [Paul Ashton|mailto:paul@argo.demon.co.uk]&lt;br /&gt;
* [Jeremy Allison|mailto:samba-bugs@samba.anu.edu.au]&lt;br /&gt;
&lt;br /&gt;
Ronald Tschalär / 14. March 2001 / [mailto:ronald@innovation.ch]&lt;/div&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
</feed>