<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Microsoft Open Specifications Support Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/openspecification/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/openspecification/feed.xml</link>
    <description>The official blog of the Engineers supporting the Microsoft Open Specifications Documentation</description>
    <lastBuildDate>Fri, 30 Jun 2017 21:04:42 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SMB 2 and SMB 3 security in Windows 10: the anatomy of signing and cryptographic keys</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/smb-2-and-smb-3-security-in-windows-10-the-anatomy-of-signing-and-cryptographic-keys</link>
      <pubDate>Fri, 26 May 2017 05:11:50 GMT</pubDate>
      <dc:creator><![CDATA[Edgar A Olougouna]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/?p=1155</guid>
      <description><![CDATA[Signing is an integral security feature in SMB2 since its inception. Encryption starts in SMB3 as an...]]></description>
      <content:encoded><![CDATA[<div>Signing is an integral security feature in SMB2 since its inception. Encryption starts in SMB3 as an important security enhancement. This article reviews the security evolution of the authenticated session as well as computation of keys used in SMB 2.x through 3.1.1 dialects. It provides test vectors for key computation in SMB 3.0 and SMB 3.1.1. The samples illustrate the multichannel scenario and include step-by-step key calculation with pre-authentication integrity. Finally, the article highlights why Kerberos should be preferred over NTLMv2 whenever possible.</div>
<div></div>
<div>Table of Contents</div>
<div></div>
<div>Introduction 2
Windows versions and chronology of dialects in MS-SMB2 3</div>
<div style="padding-left: 30px">Deprecating SMB1 3
Dialects in Windows 10 v1703 implementation of MS-SMB2 4
Chronology of crypto algorithms in MS-SMB2 5</div>
<div>Security considerations in SMB2 and SMB3 5</div>
<div style="padding-left: 30px">Key consideration 5
SessionKey 5
NTLM SessionKey 5
Kerberos SessionKey 6
GSS_GetMIC() and GSS_Wrap() or their Ex() extensions 7</div>
<div>MS-SMB2 message integrity 7</div>
<div style="padding-left: 30px">Signed session 7
Secure dialect negotiation in SMB 3.0.x 8
Pre-authentication integrity in SMB 3.1.1 8</div>
<div>Keys in SMB 2.x through 3.1.1 8</div>
<div style="padding-left: 30px">Dialects 2.0.2 and 2.1 8
Dialects 3.x 8
Dialects 3.0 and 3.0.2 9
Dialect 3.1.1 9</div>
<div>SMB 3.x key derivation function 9</div>
<div style="padding-left: 30px">Parameters for Dialects 3.0 and 3.0.2 cryptographic keys 10
Parameters for Dialect 3.1.1 cryptographic keys 10
SMB 3.x Session binding 10
SMB 3.1.1 Session binding and pre-authentication integrity 11</div>
<div>Signing algorithms 11</div>
<div style="padding-left: 30px">Signing in dialects 2.0.2 and 2.1 11
Signing in dialects 3.0, 3.0.2, 3.1.1 11</div>
<div>When is the message signed? 12</div>
<div style="padding-left: 30px">Signing negotiation 12
Signing configuration 12
Requiring signing 13
Signing the message 13
Which SigningKey is used? 13</div>
<div>When is the message encrypted in SMB 3.x? 14</div>
<div style="padding-left: 30px">Encryption negotiation in SMB 3.0 14
Encryption in SMB 3.0: A protocol perspective 14
Encryption negotiation in SMB 3.1.1 14
SMB 3.1.1 Encryption in Windows 10 14
Encryption configuration summary 14
Built-in signing in SMB 3.x encryption 15</div>
<div>Conclusion 15
Appendix: Key derivation examples 16</div>
<div style="padding-left: 30px">Key derivation example for SMB 3.0 multichannel 16
Key derivation example for SMB 3.1.1 multichannel 17
NTLMv2 SessionKey calculation example 32</div>
<div>References 38</div>
<div></div>
<h1>Introduction</h1>
<div>The security model in MS-SMB2 relies upon authenticating the client-user identity before accessing a share on the server. Once the user is authenticated, the server may mandate message signing or encryption. The server also controls access to the share based on which users, groups, or claims are authorized to have various levels of access. This blog does not discuss authorization model.
This article focuses on how MS-SMB2 achieves message integrity and confidentially for the authenticated user. We elaborate on the link as well as the distinction between the GSS-authenticated user session and the SMB2 session.
SMB2 message integrity ensures that packets are not tampered or replayed while in-flight. Signing has always been part of the SMB2 protocol since its beginning in dialect 2.0.2 (Windows Vista). SMB 3.0 (Windows 8) adds a new signing algorithm and key calculation.
Confidentiality provides secure data access over untrusted networks by preventing data inspection. SMB 3.0 introduces end-to-end encryption built in the protocol. In SMB 3.1.1 (Windows 10), the encryption algorithm can be negotiated, and the cryptographic key computation is enhanced with pre-authentication integrity.
This article provides a tutorial regarding SMB2 and SMB3 security features:</div>
<ul>
 	<li>Security considerations in the specification.</li>
 	<li>Signing and encryption operations.</li>
 	<li>Algorithms used for each security feature for a given dialect.</li>
 	<li>Keys in SMB2 and SMB3 protocols.</li>
 	<li>Specifics of key derivation in SMB 3.0.x and 3.1.1.</li>
 	<li>Illustration of key calculation steps for multichannel.</li>
 	<li>Illustration of the (out-of-favor yet) popular NTLMv2 session key calculation.</li>
</ul>
<h1>Windows versions and chronology of dialects in MS-SMB2</h1>
<div>When a new Windows version introduces a new SMB dialect, all previous dialects are mostly available for backward compatibility with older versions. Although SMBv1 dialect is still around, it is on the way of being gradually phased out.</div>
<h2>Deprecating SMB1</h2>
<div>We have been asking the world to stop using the legacy SMBv1. Recently, US-CERT issued a security bulletin advising to disable SMBv1 and move to SMB 2.x or preferably SMB 3.x.
Windows XP and Windows 2003 have SMBv1 only. As you are probably aware, Windows XP support ended on April 8, 2014. Windows Server 2003 extended support ended on July 14, 2015. These non-serviced operating systems still command some footprint and everybody has not migrated yet from Windows XP and Windows Server 2003.
It will take an industry effort to overcome some of the challenges on the deprecation path. These challenges include old printers, scanners and NAS devices.
How to enable and disable SMBv1, SMBv2, and SMBv3 in Windows and Windows Server
https://support.microsoft.com/en-us/help/2696547/how-to-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and-windows-server
The Deprecation of SMB1 – You should be planning to get rid of this old SMB1 dialect
https://blogs.technet.microsoft.com/josebda/2015/04/21/the-deprecation-of-smb1-you-should-be-planning-to-get-rid-of-this-old-smb-dialect/
https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/
[US-CERT] SMB Security Best Practices
https://www.us-cert.gov/ncas/current-activity/2017/01/16/SMB-Security-Best-Practices
Features Removed or Deprecated in Windows Server 2012 R2
https://technet.microsoft.com/en-us/library/dn303411.aspx</div>
<h2>Dialects in Windows 10 v1703 implementation of MS-SMB2</h2>
<div>In the following table, as in the rest of this article, we are only focusing on SMB protocols version 2 and 3 specified in MS-SMB2.
Client      ----   server   ----   dialect
---------------------------------------------
Vista       ---    2008         ---   2.0.2
7              ---    2008 R2   ---   2.1
8              ---    2012         ---   3.0
8.1          ---    2012 R2    ---   3.0.2
10           ---    2016          ---   3.1.1
For a general discussion on SMB dialects in Windows 8.1 and Server 2012 R2, we encourage the reader to consult the following blog.</div>
<div>https://blogs.technet.microsoft.com/josebda/2013/10/02/windows-server-2012-r2-which-version-of-the-smb-protocol-smb-1-0-smb-2-0-smb-2-1-smb-3-0-or-smb-3-02-are-you-using/
Windows 10 v1703 sends SMB2 Negotiate with supported dialects: 2.0.2, 2.1, 3.0, 3.0.2, 3.1.1 (i.e. Dialects array on the wire: 02 02 10 02 00 03 02 03 11 03). Windows Server 2016 responds with dialect revision: 3.1.1 (i.e. network bytes 11 03), whereas Windows 2012 R2 responds with dialect revision: 3.0.2 (i.e. 02 03), and so on for other versions.
The dialect is negotiated along with supported capabilities between the client and server (e.g. signing, encryption) among the capabilities defined in the scope of that dialect. SMB2 Negotiate is however unsigned since it occurs prior to authentication. This poses the problem of a man-in-the-middle (MITM) downgrading the dialect or tampering with the capabilities. SMB 3.0 attempted to solve this issue with a post-authentication validation of the Negotiate. SMB 3.1.1 integrated pre-authentication integrity into all the keys derived for the protocol.</div>
<h2>Chronology of crypto algorithms in MS-SMB2</h2>
<div>Dialect    ---   Key derivation   ---   Signing ---   Encryption
---------------------------------------------------------------------------------------------------------------------------------
2.0.2       ---    GSS-API SessionKey  ---   HMAC-SHA256   ---    N/A
2.1          ---    GSS-API SessionKey   ---   HMAC-SHA256   ---    N/A
3.0          ---    GSS-API SessionKey &amp; KDF [SP800-108]  ---   AES-128-CMAC ---    AES-128-CCM
3.0.2       ---    GSS-API SessionKey &amp; KDF [SP800-108]  ---   AES-128-CMAC ---    AES-128-CCM
3.1.1       ---   SHA-512 &amp; GSS-API SessionKey &amp; KDF [SP800-108]  ---   AES-128-CMAC ---  AES-128-CCM and AES-128-GCM
Ref: GSS-API [RFC2743]; KDF [SP800-108]; SHA-512 [FIPS180-4]; HMAC-SHA256 [FIPS180-2] and [RFC2104]; AES-128-CMAC [RFC4493]; AES-CCM and AES-GCM [RFC5084]</div>
<h1>Security considerations in SMB2 and SMB3</h1>
<h2>Key consideration</h2>
<div>All cryptographic keys used in SMB 2.x and 3.x are derived from the SessionKey. Therefore, the security of SMB 2/3 signing and encryption relies in part on the session key. This key must be unique, kept secret, and genuinely impossible to guess.
The server should choose an authentication mechanism that provides unique and randomly generated session keys to ensure the security of the signing key, encryption key, and decryption key.</div>
<h2>SessionKey</h2>
<div>The SessionKey is set to the first 16 bytes of the cryptographic key queried from the GSS protocol (e.g. Kerberos [MS-KILE], NTLM [MS-NLMP]) for this authenticated context. If the cryptographic key is less than 16 bytes, it is right-padded with zero bytes.
Extracting the session key from GSS-API is implementation-dependent. In SSPI (Microsoft’s implementation of GSS-API), the session key is extracted by using QueryContextAttributes with SECPKG_ATTR_SESSION_KEY.</div>
<h2>NTLM SessionKey</h2>
<div>In NTLM security provider, the SessionKey is the ExportedSessionKey described in MS-NLMP.
NTLM is a challenge response protocol and its session key is based on password hashing that relies on weak cryptography.</div>
<ul>
 	<li>NTLM does not support any modern cryptographic methods, such as AES or SHA-256. Its key derivation from the password is based on MD4 [RFC1320], DES [FIPS46-2], HMAC_MD5, and RC4.</li>
 	<li>NTLM does not use any salt. It is possible to observe a network packet trace and produce the same key if the attacker knows password, as shown in the appendix by an example of NTLMv2 session key calculation.</li>
 	<li>NTLM does not offer mutual authentication between client and server. The is no so such flag in the protocol.</li>
 	<li>The password length and complexity should be chosen carefully to mitigate brute force attacks.</li>
 	<li>At a minimum, NTLMv2 should be used, and auditing should be in place.</li>
</ul>
<div>Despite its weakness, NTLM remains a widely-used authentication mechanism in non-domain environments.
Auditing and restricting NTLM usage guide
https://technet.microsoft.com/en-us/library/jj865674.aspx
See the following blog post for a discussion NTLM keys.</div>
<div>https://blogs.msdn.microsoft.com/openspecification/2010/04/19/ntlm-keys-and-sundry-stuff/
Note: Extended protection for authentication exists for NTLM over TLS. This binds the TLS session to the NTLM session. Unfortunately, SMB2 does use extended protection authentication because there is no outer authenticated session.
NTLM and Channel Binding Hash (aka Extended Protection for Authentication)
https://blogs.msdn.microsoft.com/openspecification/2013/03/26/ntlm-and-channel-binding-hash-aka-extended-protection-for-authentication/</div>
<h2>Kerberos SessionKey</h2>
<div>In Kerberos [RFC4120] security provider, the SessionKey is either the sub-session key (subkey) if it was negotiated during KRB_AP_REQ/KRB_AP_REP exchange, or the session key from the ticket if no subkey was negotiated.
When the KDC issues a service ticket, it generates a random session key. Rather than using a pseudo-random number generator (PRNG), the session key should use a truly random number generator, such as one based on measurements of random physical phenomena.  See [RFC4086] for an in-depth discussion of randomness.
For the subkey, it is also strongly encouraged that any key derived by an application for subsequent use include the full key entropy derived from the KDC-generated session key carried in the ticket.
The KDC issues tickets with the strongest encryption type (etype) to protect the session key. The etype is based on configuration of what the KDC enforces and what client and server principals can support (AES256_HMAC_SHA1, AES128_HMAC_SHA1, RC4_HMAC_MD5, DES_CBC_MD5, DES_CBC_CRC).</div>
<div>https://blogs.msdn.microsoft.com/openspecification/2010/11/17/encryption-type-selection-in-kerberos-exchanges/</div>
<div>https://blogs.msdn.microsoft.com/openspecification/2011/05/30/windows-configurations-for-kerberos-supported-encryption-type/
https://blogs.technet.microsoft.com/petergu/2013/04/14/interpreting-the-supportedencryptiontypes-registry-key/.
Beyond the etype, the security of the Kerberos SessionKey is substantially strengthened if all preceding Kerberos exchanges ([RFC4120] or [MS-KILE]) that lead to the service ticket have reinforced protection. For instance, the authentication service may leverage public key cryptography to protect the initial authentication (PKInit), as specified in [RFC4556], [MS-PKCA], e.g. for smart card authentication.
In its basic form, the security of the Kerberos authentication service depends on the strength of the password used to protect it.</div>
<h2>GSS_GetMIC() and GSS_Wrap() or their Ex() extensions</h2>
<div>Signing in SMB2 and SMB3 uses their respective algorithms HMAC-SHA256 and AES-128-CMAC. SMB2/3 signing does not use GSS-API GSS_GetMIC() or GSS_GetMICEx().
Likewise, SMB 3.x encryption uses its own encryption algorithms, i.e. AES-128-CCM and AES-128-GCM as introduced earlier in this article. GSS-API GSS_Wrap() or GSS_WrapEx() are not pertinent for SMB3 encryption.
The GSS-API keys should not be confused with SMB2/3 keys, though the latter are derived from the session key. In case of NTLM authentication, NTLM has his own signing and sealing keys, which serve for GSS_GetMICEx(), GSS_VerifyMICEx(), GSS_WrapEX(), GSS_UnwrapEX(). The same remarks apply for Kerberos GSS-API keys, and Kerberos GSS functions.</div>
<h1>MS-SMB2 message integrity</h1>
<div>SMB2 message integrity manifests on a signed session where signed packets flow from client to server. What happens to message integrity until the session is established?</div>
<h2>Signed session</h2>
<div>On a signed session, every signed packet includes a signature that the receiver can validate. Unlike SMB1 signing which uses MD5 [RFC1321] as hashing algorithm, SMB2 uses a better hashing for signing. SMB 2.02 and SMB 2.1 use HMAC SHA-256, whereas SMB 3.0 upgrades to AES-128-CMAC for its signing.
Before signing can happen, the client and server need to negotiate signing; and the client needs authenticate first to have a SessionKey from which a SigningKey is derived (more details on this later). SMB 2.x did not have a mechanism to detect MITM downgrading of negotiated capabilities.</div>
<h2>Secure dialect negotiation in SMB 3.0.x</h2>
<div>Dialect 3.0 implements secure dialect negotiation (SMB 3.0, 3.02) to protect against security-downgrade attacks. When SMB 3.0 is negotiated, the client must send a mandatory signed request to validate the Negotiate information. The validation occurs post-authentication and after the Tree Connect exchange.
https://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx
SMB 3.1.1 introduces pre-authentication integrity which supersedes the SMB 3.0.x secure dialect negotiation.</div>
<h2>Pre-authentication integrity in SMB 3.1.1</h2>
<div>SMB 3.1.1 pre-authentication integrity enhances protection against security-downgrade attacks by verifying the integrity of all messages preceding the session establishment. This mandatory feature protects against any tampering with Negotiate and Session Setup messages by leveraging cryptographic hashing SHA-512 [FIPS180-4]. Pre-authentication integrity also integrates a salt transmitted on the wire as part of the hash calculation. In Windows implementation, the pre-auth-integrity negotiate context has a salt of 32 bytes. The salt is randomly generated (e.g. PRNG) and not reused, otherwise it would allow surface attacks.
https://blogs.msdn.microsoft.com/openspecification/2015/08/11/smb-3-1-1-pre-authentication-integrity-in-windows-10/</div>
<h1>Keys in SMB 2.x through 3.1.1</h1>
<h2>Dialects 2.0.2 and 2.1</h2>
<h2></h2>
<div>Prior to SMB 3.0, the 16-bytes SessionKey was the primary key.
SigningKey: Session.SigningKey is the same as Session.SessionKey.
Application’s session key for an authenticated context: the client returns Session.SessionKey.</div>
<h2>Dialects 3.x</h2>
<div>In SMB 3.x, two new keys are added to serve for encryption. The application’s session key for an authenticated context has become a key on its own.
The SMB 3.x keys have the following properties:</div>
<ul>
 	<li>Key size: 128-bit i.e. 16 bytes each.</li>
 	<li>Session.SigningKey: Key used for signing the SMB2 messages on this session.</li>
 	<li>Channel.SigningKey: Key used for signing the SMB2 messages on this channel when session binding is used for multiple channels.
o If the session is setup with SMB2_SESSION_FLAG_BINDING, Channel.SigningKey must be generated. Both master session and binding session must be from the same security principal, i.e. same security identifier (SID).
o If SMB2_SESSION_FLAG_BINDING is not set, Channel.SigningKey is set to Session.SigningKey. Note that two security principals can still multiplex separate channels on the same connection.</li>
 	<li>Session.ApplicationKey: Key mainly queried by higher-layer applications. An example is SAMR protocol over named pipe SMB2 transport [MS-SAMR]. ApplicationKey is generated for non-binding sessions.</li>
 	<li>Session.EncryptionKey: Key used by the sender for encrypting messages. There is one encryption key for all sessions bound to a master session. This enables to send encrypted messages on any channel.</li>
 	<li>Session.DecryptionKey: Key used by the receiver for decrypting messages. Likewise, the decryption key is the same for all sessions bound to a master session. If a decrypted message contains compounded related SMB2 messages, these later must all belong to the same SessionId.</li>
</ul>
<div>Upon authentication, SigningKey, and ApplicationKey are calculated. If encryption is supported (even if not negotiated), EncryptionKey and DecryptionKey are computed.
All these keys are derived using the SP800-108 key derivation function (KDF) (see more details</div>
<div>later in this article). SessionKey is the key derivation key (KDK), a parameter to the KDF.</div>
<h2>Dialects 3.0 and 3.0.2</h2>
<div>Apart from the KDK input, i.e. SessionKey, the other parameters to the KDF are constants defined for each type of key. (more details in subsequent Sections).</div>
<h2>Dialect 3.1.1</h2>
<div>SessionKey remains the KDF’s KDK. The context parameter is no longer a constant, instead it is PreauthIntegrityHashValue (see blog “SMB 3.1.1 Pre-authentication Integrity”). The remaining parameters to the KDF are constant, but they differ from the constants used in SMB 3.0.x key derivation. (see specifics in subsequent Sections).</div>
<h1>SMB 3.x key derivation function</h1>
<div>Ko = SMB3KDF (Ki, Label, Context)
SMB3KDF() is defined as the key derivation function (KDF) in Counter Mode, as specified in [SP800-108] section 5.1, with 'r' value of 32 and 'L' value of 128, and HMAC-SHA256 as the PRF.
Ki – The SessionKey is the key derivation key (KDK), used as an input to the KDF, for SMB 3.x.
Label – the purpose of this derived key, encoded as string and length for SMB 3.x.
Context – the context information of this derived key, encoded as string and length for SMB 3.x.
L – An integer that specifies the length of the derived keying material Ko, L is 128 bits for SMB 3.x cryptographic keys. Note that L is a constant since all SMB 3.x keys are 16 bytes in length.
Ko – Keying material output from the KDF, a binary string of length L, where Ko is the leftmost L bits of KDF result.</div>
<h2>Parameters for Dialects 3.0 and 3.0.2 cryptographic keys</h2>
<div>Label and context are constants for each type of cryptographic key.</div>
<ul>
 	<li>SigningKey = SMB3KDF ( SessionKey, "SMB2AESCMAC\0", "SmbSign\0")</li>
 	<li>ApplicationKey = SMB3KDF (SessionKey, "SMB2APP\0", "SmbRpc\0")</li>
 	<li>EncryptionKey (Client) = DecryptionKey (Server) =  SMB3KDF (SessionKey, "SMB2AESCCM\0", "ServerIn \0")</li>
 	<li>EncryptionKey (Server) = DecryptionKey (Client) = SMB3KDF (SessionKey, "SMB2AESCCM\0", "ServerOut\0")</li>
</ul>
<h2>Parameters for Dialect 3.1.1 cryptographic keys</h2>
<div>A new label is defined for each type of cryptographic key. The context is Session.PreauthIntegrityHashValue, as described in the “SMB 3.1.1 pre-authentication integrity” blog.</div>
<ul>
 	<li>SigningKey = SMB3KDF (SessionKey, "SMBSigningKey\0", Session.PreauthIntegrityHashValue)</li>
 	<li>ApplicationKey = SMB3KDF (SessionKey, "SMBAppKey\0", Session.PreauthIntegrityHashValue)</li>
 	<li>EncryptionKey (Client) = DecryptionKey (Server) = SMB3KDF (SessionKey, "SMBC2SCipherKey\0", Session.PreauthIntegrityHashValue)</li>
 	<li>DecryptionKey (Client) = EncryptionKey (Server) = SMB3KDF (SessionKey, "SMBS2CCipherKey\0", Session.PreauthIntegrityHashValue)</li>
</ul>
<h2>SMB 3.x Session binding</h2>
<div>SMB2_SESSION_FLAG_BINDING bit is set in the Flags field of the Session Setup request.
For session binding to multiple connections (multichannel), the server needs to call GSS_Accept_sec_context for each additional channel. This requires creating a new-temporary security context to have a SessionKey and derive a SigningKey for the binding channel. Note that the session binding request must be signed with the master session’s SigningKey, as described later in this article.
However, EncryptionKey, DecryptionKey, and ApplicationKey remain the same from the main channel, i.e. remain the same for all related channels.</div>
<h2>SMB 3.1.1 Session binding and pre-authentication integrity</h2>
<div>If this is a master or binding session setup and the dialect is 3.1.1 or higher, we allocate and initialize the session's pre-authentication integrity hash value starting with the connection's pre-authentication integrity hash. We always start with the pre-authentication hash resulting from processing Negotiate on that connection.
The client side logic is summarized below.
Set Session.PreauthIntegrityHashValue to Connection.PreauthIntegrityHashValue.
Update Session.PreauthIntegrityHashValue with the SessionSetup request.
if it's STATUS_MORE_PROCESSING_REQUIRED, update Session.PreauthIntegrityHashValue with the response, and process subsequent session setup exchange leg.
if it's STATUS_SUCCESS, use Session.PreauthIntegrityHashValue to generate cryptographic keys, then verify the signature of the SessionSetup response.
For the server side, the logic is similar except that we use Session.PreauthIntegrityHashValue when SMB2_SESSION_FLAG_BINDING is NOT set, and
PreauthSession.PreauthIntegrityHashValue when SMB2_SESSION_FLAG_BINDING is set.
This is important because there is no guarantee in which order session bindings will be processed. That way, each session setup processing is isolated from the other, but all use the connection's pre-authentication hash as the starting point.</div>
<h1>Signing algorithms</h1>
<div>For a signed message, the sender sets the Signature field and the SMB2_FLAGS_SIGNED bit in the Flags field of the SMB2 header. The sender calculates the signature as follows.</div>
<h2>Signing in dialects 2.0.2 and 2.1</h2>
<div>The signer computes a 32-byte hash by using HMAC-SHA256 over the entire message, beginning with the SMB2 header with the signature field zeroed, and using the provided SigningKey. The HMAC-SHA256 hash is specified in [FIPS180-2] and [RFC2104]
The signature is the first 16-bytes of the hash.</div>
<h2>Signing in dialects 3.0, 3.0.2, 3.1.1</h2>
<div>The signer computes the 16-byte signature by using AES-128-CMAC over the entire message, beginning with the SMB2 header with the signature field zeroed, and using the SigningKey provided. The AES-128-CMAC is specified in [RFC4493].
For dialect 3.x family, the server must sign the final SessionSetup Response. This excludes guest and anonymous sessions since there is no SigningKey available in those types of contexts.
Signing of the final SMB 3.x SessionSetup Response:</div>
<ul>
 	<li>Connection.Dialect belongs to the 3.x dialect family:</li>
 	<li>If SMB2_SESSION_FLAG_BINDING is set in the SessionSetup, use Channel.SigningKey.</li>
 	<li>Otherwise, use Session.SigningKey.</li>
</ul>
<div>For Dialect SMB 3.x, the session binding request is signed with the master session’s SigningKey.</div>
<h1>When is the message signed?</h1>
<h2>Signing negotiation</h2>
<div>The client and server negotiate signing by using the SecurityMode field in the SMB2 Negotiate request and response exchange. The client also communicates the SecurityMode in the SessionSetup Request.
SMB2_NEGOTIATE_SIGNING_ENABLED (0x0001)
SMB2_NEGOTIATE_SIGNING_REQUIRED (0x0002)
Windows SMB 2/3 clients always set SMB2_NEGOTIATE_SIGNING_ENABLED flag in the negotiate request and Windows-based servers set it likewise in the response since they all support signing.
MS-SMB2 require all SMB 2/3 servers to implement signing, regardless of whether they set the SMB2_NEGOTIATE_SIGNING_ENABLED flag.</div>
<h2>Signing configuration</h2>
<div>By default, Windows client and server have the following settings.
Get-SmbClientConfiguration  | fl EnableSecuritySignature,RequireSecuritySignature
EnableSecuritySignature  : True
RequireSecuritySignature : False
The corresponding registry keys on the client are under HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
Get-SmbServerConfiguration | fl EnableSecuritySignature,RequireSecuritySignature
EnableSecuritySignature  : False
RequireSecuritySignature : False
The corresponding registry keys on the server are under HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
For additional details on signing configuration and effective behavior, please consult the following blog:
The Basics of SMB Signing (covering both SMB1 and SMB2)
https://blogs.technet.microsoft.com/josebda/2010/12/01/the-basics-of-smb-signing-covering-both-smb1-and-smb2/</div>
<h2>Requiring signing</h2>
<div>The session will have Session.SigningRequired = TRUE if one the following conditions is met:</div>
<ul>
 	<li>Signing has been required by negotiation.</li>
 	<li>The server configuration requires message signing.</li>
 	<li>The SessionSetup requires signing.</li>
</ul>
<div>NOTE: Signing cannot be required for guest or anonymous sessions as they do not have proper security context.</div>
<h2>Signing the message</h2>
<div>To sign a message, the first two prerequisites are:</div>
<ul>
 	<li>Existence of the signing key: SessionId field has a non-zero value, otherwise there would be no possible signing key. The exception is a guest or anonymous session, which does not have a signing key even there’s a SessionId.</li>
 	<li>Signing requirement: SessionId requires signing, i.e. its Session.SigningRequired is equal to TRUE as outlined previously.</li>
</ul>
<div>If those two prerequisites are met, the sender signs the message under these specific conditions:</div>
<ul>
 	<li>It’s a TREE_CONNECT or the message belongs to an un-encrypted TreeId, i.e. its TreeConnect.EncryptData is equal to FALSE. If we are not encrypting, we begin to sign messages as soon the session is established, i.e. the signing key is available and the session requires signing.</li>
 	<li>Connection.Dialect is "3.1.1", and it’s a TREE_CONNECT and SessionId is not an encrypted session, i.e. its Session.EncryptData is equal to FALSE. If 3.1.1 dialect is negotiated, the protocol requires signing or encrypting all TREE_CONNECT sent in non-guest, non-anonymous sessions. When the whole session is not encrypted, we always sign the TREE_CONNECT since all SMB2/3 servers support signing.</li>
</ul>
<div>There is one notable exception to the “Session.SigningRequired is equal to TRUE” prerequisite. Irrespective of Session.SigningRequired, FSCTL_VALIDATE_NEGOTIATE_INFO should always be signed. Note that if Session.EncryptData is equal to TRUE, the server would not need to verify the signature of FSCTL_VALIDATE_NEGOTIATE_INFO message (see Section “Built-in signing in SMB 3.x encryption”).</div>
<h2>Which SigningKey is used?</h2>
<div>With SMB 2.x, the signing key is Session.SessionKey.
With SMB 3.x, the notions of multichannel and session binding introduce new rules for whichever of Session.SessionKey or Channel.SigningKey is used.</div>
<ul>
 	<li>For SessionSetup request, the signing key is Session.SessionKey. For instance, the signing key for session setup request for session binding (SMB2_SESSION_FLAG_BINDING) is Session.SessionKey.</li>
 	<li>For session set up response, if the status code is NOT equal to STATUS_SUCCESS, the signing key is Session.SessionKey. If the session setup response has STATUS_SUCCESS, the signing key is Channel.SigningKey.</li>
 	<li>For any other command, the signing key is Channel.SigningKey. Note that the session can be multiplexed on multiple channels across multiple connections. Since, each channel has their signing key, the sender looks up the Channel in Session.ChannelList that matches the same connection.</li>
</ul>
<h1>When is the message encrypted in SMB 3.x?</h1>
<div>A detailed discussion is provided in the blogs mentioned in the following sub-sections.</div>
<h2>Encryption negotiation in SMB 3.0</h2>
<div>SMB 3.0.x client and server advertise encryption support via the SMB2_GLOBAL_CAP_ENCRYPTION capability flag during the NEGOTIATE. If encryption is enforced on the whole server, each session enables encryption by setting SMB2_SESSION_FLAG_ENCRYPT_DATA in the SessionFlags of SessionSetup response. For a per-share enabled encryption, ShareFlags of TreeConnect response includes SMB2_SHAREFLAG_ENCRYPT_DATA.
SMB 3.0 and SMB 3.0.2 support only the encryption algorithm AES-128-CCM.</div>
<h2>Encryption in SMB 3.0: A protocol perspective</h2>
<div>https://blogs.msdn.com/b/openspecification/archive/2012/10/05/encryption-in-smb-3-0-a-protocol-perspective.aspx</div>
<h2>Encryption negotiation in SMB 3.1.1</h2>
<div>SMB 3.1.1 client and server negotiate encryption support by exchanging supported cipher IDs 0x0002 (AES-128-GCM) and 0x0001 (AES-128-CCM) in SMB2_ENCRYPTION_CAPABILITIES negotiate context in the NEGOTIATE request and response.</div>
<h2>SMB 3.1.1 Encryption in Windows 10</h2>
<div>https://blogs.msdn.microsoft.com/openspecification/2015/09/09/smb-3-1-1-encryption-in-windows-10/</div>
<h2>Encryption configuration summary</h2>
<div>As discussed in the abovementioned blogs, the configuration items that affect encryption on Windows 8 / Windows Server 2012 and onward are:
Global level encryption on the server:
Set-SmbServerConfiguration -EncryptData &lt;0|1&gt;
If enabled, SessionSetup.Response.SessionFlags includes SMB2_SESSION_FLAG_ENCRYPT_DATA.
Share level encryption:
New-SmbShare -Name &lt;share name&gt; -Path &lt;pathname&gt; -EncryptData 1
Set-SmbShare -Name &lt;share name&gt; -EncryptData &lt;0|1&gt;
If enabled, TreeConnect.Response.ShareFlags sets SMB2_SHAREFLAG_ENCRYPT_DATA.
Server-wide encryption has precedence over share level encryption. If global encryption is enabled, you cannot selectively disable encryption for certain shares.
Keep in mind that a dynamic change of the share’s EncryptData property would mean different encryption experience if existing TreeIds prior to the change remain connected. New TreeId connections after the change would reflect the new value of the share’s EncryptData property. Thus, when the administrator reconfigures Share.EncryptData, is it recommended to force disconnection of all current connections to allow clients to pick the new configuration.
Unencrypted access:
Set-SmbServerConfiguration -RejectUnencryptedAccess &lt;0|1&gt;
This is for down-level clients. See discussion on security impact in Section “Unencrypted Access: RejectUnencryptedAccess” of blog entry “SMB 3.1.1 Encryption in Windows 10”.</div>
<h2>Built-in signing in SMB 3.x encryption</h2>
<div>Integrity (message authentication) is built into the algorithms used for encryption in SMB 3.x, i.e. AES-128-CCM and AES-128-GCM. These encryption algorithms incorporate the benefit of a message authentication code. Successful decryption means that SMB3 crypto processing has checked the integrity of the encrypted message. The receiver does not need to validate the signature of the inner SMB2 message itself. In general, signing the SMB2 message before encrypting it would be a waste of CPU cycles without any additional security.
SMB 3.x encryption supplants regular signing: it does not and should not turn off message signing. When SMB 3.x encryption is in use, we do not need regular signing. However, “RejectUnencryptedAccess set to FALSE” should not disable signing, i.e. does not mean bypass RequireMessageSigning. A message that is not encrypted shall be subject to the rules of regular signing.</div>
<h1>Conclusion</h1>
<div>We have discussed the anatomy of signing and cryptographic keys used in MS-SMB2 protocol for all dialects supported by Windows 10. These keys – directly or indirectly – support the following security features:
In SMB 2.0.2 and 2.1 dialects:</div>
<ul>
 	<li>Message integrity across an authenticated session.</li>
</ul>
<div>In SMB 3.0 dialect:</div>
<ul>
 	<li>Message integrity (with a stronger algorithm) across an authenticated session.</li>
 	<li>Encryption of traffic between client and server.</li>
 	<li>Session binding to multiple connections (multichannel).</li>
 	<li>Validation of negotiated information.</li>
</ul>
In SMB 3.1.1 dialect:
<ul>
 	<li>All the above 3.0 dialect security features, except the validation of negotiated information.</li>
 	<li>Negotiation of encryption and integrity algorithms.</li>
 	<li>Protection of negotiation and session establishment.</li>
</ul>
<h1>Appendix: Key derivation examples</h1>
<div>This sample data should be considered “as-is”. It should also be noted that examples do not replace normative protocol specifications. The reference must be [MS-SMB2].</div>
<h2>Key derivation example for SMB 3.0 multichannel</h2>
<div>--- Master session (first channel) ---</div>
<div>Input cryptographicKey 0x7CD451825D0450D235424E44BA6E78CC
(queried from GSS authenticated context)</div>
<div>--- Dialect 0x0300 ---
SessionKey 0x7CD451825D0450D235424E44BA6E78CC
SigningKey 0x0B7E9C5CAC36C0F6EA9AB275298CEDCE
EncryptionKey 0xFAD27796665B313EBB578F388632B4F7
DecryptionKey 0xB0F0427F7CEB416D1D9DCC0CD4F99447
ApplicationKey 0xBB23A4575AA26C721AF525AF15A87B4F</div>
<div>--- Second channel (session binding) ---</div>
<div>Input cryptographicKey 0x4E01A2B313BCF660CC250BEF021AEDE6
(queried from GSS authenticated context)
Alternate channel: generate Channel.SigningKey.
Alternate channel: Copy encryption/decryption keys from main channel</div>
<div>--- Dialect 0x0300 ---
SessionKey 0x4E01A2B313BCF660CC250BEF021AEDE6
SigningKey 0xBA1A17DBBFEC349BCA105563D598952F
EncryptionKey 0xFAD27796665B313EBB578F388632B4F7
DecryptionKey 0xB0F0427F7CEB416D1D9DCC0CD4F99447
ApplicationKey 0xBB23A4575AA26C721AF525AF15A87B4F</div>
<div></div>
<h2>Key derivation example for SMB 3.1.1 multichannel</h2>
<div>--- Master session (first channel) ---</div>
<div>Header.Command 0x0000 NEGOTIATE</div>
<div>Preauth integrity hash capabilities ---
PreauthIntegrityCaps.HashAlgorithmCount 0x1
PreauthIntegrityCaps.SaltLength 0x20
PreauthIntegrityCaps.HashAlgorithms 0x0001
PreauthIntegrityCaps.Salt
FA49E6578F1F3A9F4CD3E9CC14A67AA884B3D05844E0E5A118225C15887F32FF</div>
<div>Encryption capabilites ---
EncryptionCaps.CipherCount 0x2
EncryptionCaps.Ciphers[0] 0x0002
EncryptionCaps.Ciphers[1] 0x0001</div>
<div>Connection.PreauthIntegrityHashId 0x0001</div>
<div>NEGOTIATE Request</div>
<div>Preauth integrity hash ---
Current
Connection.PreauthIntegrityHashValue
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
Negotiate request packet
FE534D4240000100000000000000800000000000000000000100000000000000FFFE000000000000
00000000000000000000000000000000000000000000000024000500000000003F000000ECD86F32
6276024F9F7752B89BB33F3A70000000020000000202100200030203110300000100260000000000
010020000100FA49E6578F1F3A9F4CD3E9CC14A67AA884B3D05844E0E5A118225C15887F32FF0000
0200060000000000020002000100
Concatenate Connection.PreauthIntegrityHashValue and Negotiate request packet
SHA-512 Input Hash Data
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000FE534D42400001000000000000008000
00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000
000000000000000024000500000000003F000000ECD86F326276024F9F7752B89BB33F3A70000000
020000000202100200030203110300000100260000000000010020000100FA49E6578F1F3A9F4CD3
E9CC14A67AA884B3D05844E0E5A118225C15887F32FF00000200060000000000020002000100
New
Connection.PreauthIntegrityHashValue
DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0
CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426</div>
<div>NEGOTIATE Response</div>
<div>Updating Preauth integrity hash ---
Current
Connection.PreauthIntegrityHashValue
DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0
CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426
Negotiate response packet
FE534D4240000100000000000000010001000000000000000100000000000000FFFE000000000000
000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942
BDCE5D60F09AB3FB2F000000000080000000800000008000D8DAE5ADCBAED00109094AB095AED001
80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182
3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000
60000000700000007C7CC0FD06D6362D02DDE1CF343BFE292900F49750B4AA97934D9C4296B26E51
FD370471B235E15A50DAE15BD5489C87000000000000000060000000010000000000000000000000
5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000
7C7CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000
3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562
6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075
626C6963204B6579010026000000000001002000010060A3C3B95C3C7CCD51EC536648D9B3AC74C4
83CA5B65385A251117BEB30712E50000020004000000000001000200
Concatenate Connection.PreauthIntegrityHashValue and Negotiate response packet
SHA-512 Input Hash Data
DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0
CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426FE534D42400001000000000000000100
01000000000000000100000000000000FFFE00000000000000000000000000000000000000000000
0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2F00000000008000
0000800000008000D8DAE5ADCBAED00109094AB095AED00180004001C00100006082013C06062B06
01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A
A282010C048201084E45474F45585453010000000000000060000000700000007C7CC0FD06D6362D
02DDE1CF343BFE292900F49750B4AA97934D9C4296B26E51FD370471B235E15A50DAE15BD5489C87
0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308
4E45474F45585453030000000100000040000000980000007C7CC0FD06D6362D02DDE1CF343BFE29
5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F
06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130
1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000
01002000010060A3C3B95C3C7CCD51EC536648D9B3AC74C483CA5B65385A251117BEB30712E50000
020004000000000001000200
New
Connection.PreauthIntegrityHashValue
324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99
7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513</div>
<div>Add NEW SessionId 0x100000000019 to Preauth Integrity hash table with value
Connection.PreauthIntegrityHashValue
324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99
7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513</div>
<div>SESSION SETUP Request
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99
7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513
SessionSetup request packet
FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000
00000000000000000000000000000000000000000000000019000001010000000000000058004A00
0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A
04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000
000F
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet
SHA-512 Input Hash Data
324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99
7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513FE534D42400001000000000001008000
00000000000000000200000000000000FFFE00000000000000000000000000000000000000000000
000000000000000019000001010000000000000058004A000000000000000000604806062B060105
0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782
08E200000000000000000000000000000000060380250000000F
PreauthSession.PreauthIntegrityHashValue
AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33
197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9</div>
<div>SESSION SETUP Response</div>
<div> --- STATUS_MORE_PROCESSING_REQUIRED - Updating Preauth integrity hash ---
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33
197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9
SessionSetup response packet
FE534D4240000100160000C00100010001000000000000000200000000000000FFFE000000000000
190000000010000000000000000000000000000000000000090000004800B300A181B03081ADA003
0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038
00000015828AE20D1D8BA31179D008000000000000000050005000440000000A0092270000000F53
005500540033003100310002000C0053005500540033003100310001000C00530055005400330031
00310004000C0053005500540033003100310003000C0053005500540033003100310007000800A1
A1F5ADCBAED00100000000
SessionSetup response header signature 0x00000000000000000000000000000000
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup response packet
SHA-512 Input Hash Data
AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33
197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9FE534D4240000100160000C001000100
01000000000000000200000000000000FFFE00000000000019000000001000000000000000000000
0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202
0AA281970481944E544C4D53535000020000000C000C003800000015828AE20D1D8BA31179D00800
0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053
005500540033003100310001000C0053005500540033003100310004000C00530055005400330031
00310003000C0053005500540033003100310007000800A1A1F5ADCBAED00100000000
PreauthSession.PreauthIntegrityHashValue
2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336
4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387</div>
<div>SESSION SETUP Request
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336
4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387
SessionSetup request packet
FE534D4240000100000000000100800000000000000000000300000000000000FFFE000000000000
1900000000100000000000000000000000000000000000001900000101000000000000005800CF01
0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000
001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000
001000100096010000158288E2060380250000000FECAC77A5F385A8BF9C38C706EEEDDCD3530055
005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049
0056004500520033003100310000000000000000000000000000000000000000000000000063078E
B639FE03E20A231C3AE3BF23080101000000000000A1A1F5ADCBAED001BC4AD05F223CC90F000000
0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055
00540033003100310003000C0053005500540033003100310007000800A1A1F5ADCBAED001060004
00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B
8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016
0063006900660073002F005300550054003300310031000000000000000000000000003B9BDFF38F
5EE8F9663F11A0F4C03A78A31204100100000063775A9A5FD97F0600000000
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet
SHA-512 Input Hash Data
2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336
4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387FE534D42400001000000000001008000
00000000000000000300000000000000FFFE00000000000019000000001000000000000000000000
00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7
A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000
000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380
250000000FECAC77A5F385A8BF9C38C706EEEDDCD3530055005400330031003100610064006D0069
006E006900730074007200610074006F007200440052004900560045005200330031003100000000
00000000000000000000000000000000000000000063078EB639FE03E20A231C3AE3BF2308010100
0000000000A1A1F5ADCBAED001BC4AD05F223CC90F0000000002000C005300550054003300310031
0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055
00540033003100310007000800A1A1F5ADCBAED00106000400020000000800300030000000000000
000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0
CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054
003300310031000000000000000000000000003B9BDFF38F5EE8F9663F11A0F4C03A78A312041001
00000063775A9A5FD97F0600000000
PreauthSession.PreauthIntegrityHashValue
0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97
51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01</div>
<div>SESSION SETUP Response
SessionId 0x100000000019 COMPLETED
SessionSetup response packet
FE534D4240000100000000000100800009000000000000000300000000000000FFFE000000000000
1900000000100000EBE146DA120BA25FC3376A49DFE31BC10900000048001D00A11B3019A0030A01
00A3120410010000003B453CDC3524164200000000
SessionSetup response header signature 0xEBE146DA120BA25FC3376A49DFE31BC1
PreauthSession.PreauthIntegrityHashValue
0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97
51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01</div>
<div>Input cryptographicKey (SessionKey) 0x270E1BA896585EEB7AF3472D3B4C75A7
(queried from GSS authenticated context)</div>
<div>--- Dialect 0x0311 ---
preauthIntegrityHashValue
0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97
51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01
CypherId 0x0002
SessionKey 0x270E1BA896585EEB7AF3472D3B4C75A7
SigningKey 0x73FE7A9A77BEF0BDE49C650D8CCB5F76
EncryptionKey 0x629BCBC54422A0F572B97F45989B6073
DecryptionKey 0xE2AF0DCEFAC68DA71A0DFBD0D1350D74
ApplicationKey 0x6D7AD7954E9EC61E907B4D473DC178FF</div>
<div>--- second channel (session binding) ----</div>
<div>Header.Command 0x0000 NEGOTIATE</div>
<div>Preauth integrity hash capabilities ---
PreauthIntegrityCaps.HashAlgorithmCount 0x1
PreauthIntegrityCaps.SaltLength 0x20
PreauthIntegrityCaps.HashAlgorithms 0x0001
PreauthIntegrityCaps.Salt
3E38B8B81A9AFB172278056F4898FD09A1B9976A49B2D771161FCD4D40DF7D7D</div>
<div>Encryption capabilites ---
EncryptionCaps.CipherCount 0x2
EncryptionCaps.Ciphers[0] 0x0002
EncryptionCaps.Ciphers[1] 0x0001</div>
<div>Connection.PreauthIntegrityHashId 0x0001</div>
<div>NEGOTIATE Request</div>
<div>Preauth integrity hash ---
Current
Connection.PreauthIntegrityHashValue
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
Negotiate request packet
FE534D4240000100000000000000800000000000000000000100000000000000FFFE000000000000
00000000000000000000000000000000000000000000000024000500010000003F000000ECD86F32
6276024F9F7752B89BB33F3A70000000020000000202100200030203110300000100260000000000
0100200001003E38B8B81A9AFB172278056F4898FD09A1B9976A49B2D771161FCD4D40DF7D7D0000
0200060000000000020002000100
Concatenate Connection.PreauthIntegrityHashValue and Negotiate request packet
SHA-512 Input Hash Data
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000FE534D42400001000000000000008000
00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000
000000000000000024000500010000003F000000ECD86F326276024F9F7752B89BB33F3A70000000
0200000002021002000302031103000001002600000000000100200001003E38B8B81A9AFB172278
056F4898FD09A1B9976A49B2D771161FCD4D40DF7D7D00000200060000000000020002000100
New
Connection.PreauthIntegrityHashValue
F035C2B2BAB116E0DCF6A74E26670604D1BF6DDA065913AF7C30E93C1F025AC3CE2DD44D4DE26524
A785E5D8E06AF0BE1C74296FEF05B045C3793A12B32C49DF</div>
<div>NEGOTIATE Response</div>
<div>Updating Preauth integrity hash ---
Current
Connection.PreauthIntegrityHashValue
F035C2B2BAB116E0DCF6A74E26670604D1BF6DDA065913AF7C30E93C1F025AC3CE2DD44D4DE26524
A785E5D8E06AF0BE1C74296FEF05B045C3793A12B32C49DF
Negotiate response packet
FE534D4240000100000000000000010001000000000000000100000000000000FFFE000000000000
000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942
BDCE5D60F09AB3FB2F000000000080000000800000008000A76533AECBAED00109094AB095AED001
80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182
3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000
60000000700000007E7CC0FD06D6362D02DDE1CF343BFE29172BA8482F8B7BE4DBA9F69A8DEBBA83
36E453F3EE58983492F66354ED01A5BE000000000000000060000000010000000000000000000000
5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000
7E7CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000
3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562
6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075
626C6963204B657901002600000000000100200001002521FE7288989F816EE6D3D6C55921FBEF2C
C239789E83B8A0EC29E8D84EBAB80000020004000000000001000200
Concatenate Connection.PreauthIntegrityHashValue and Negotiate response packet
SHA-512 Input Hash Data
F035C2B2BAB116E0DCF6A74E26670604D1BF6DDA065913AF7C30E93C1F025AC3CE2DD44D4DE26524
A785E5D8E06AF0BE1C74296FEF05B045C3793A12B32C49DFFE534D42400001000000000000000100
01000000000000000100000000000000FFFE00000000000000000000000000000000000000000000
0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2F00000000008000
0000800000008000A76533AECBAED00109094AB095AED00180004001C00100006082013C06062B06
01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A
A282010C048201084E45474F45585453010000000000000060000000700000007E7CC0FD06D6362D
02DDE1CF343BFE29172BA8482F8B7BE4DBA9F69A8DEBBA8336E453F3EE58983492F66354ED01A5BE
0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308
4E45474F45585453030000000100000040000000980000007E7CC0FD06D6362D02DDE1CF343BFE29
5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F
06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130
1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000
0100200001002521FE7288989F816EE6D3D6C55921FBEF2CC239789E83B8A0EC29E8D84EBAB80000
020004000000000001000200
New
Connection.PreauthIntegrityHashValue
E267AB1AA0403082AA2A9FEB0224AF3EA92E53CAA50A893A9635F0659F93591F81391737E68DB0C9
AD878C56449C36A6895EBCF435A7D97072C7B596B8AF3817</div>
<div>Add NEW SessionId 0x100000000019 to Preauth Integrity hash table with value
Connection.PreauthIntegrityHashValue
E267AB1AA0403082AA2A9FEB0224AF3EA92E53CAA50A893A9635F0659F93591F81391737E68DB0C9
AD878C56449C36A6895EBCF435A7D97072C7B596B8AF3817</div>
<div>SESSION SETUP Request
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
E267AB1AA0403082AA2A9FEB0224AF3EA92E53CAA50A893A9635F0659F93591F81391737E68DB0C9
AD878C56449C36A6895EBCF435A7D97072C7B596B8AF3817
SessionSetup request packet
FE534D4240000100000000000100800008000000000000000200000000000000FFFE000000000000
190000000010000068BD0C58F613CE1334B1EB51C68D39EA19000101010000000000000058004A00
0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A
04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000
000F
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet
SHA-512 Input Hash Data
E267AB1AA0403082AA2A9FEB0224AF3EA92E53CAA50A893A9635F0659F93591F81391737E68DB0C9
AD878C56449C36A6895EBCF435A7D97072C7B596B8AF3817FE534D42400001000000000001008000
08000000000000000200000000000000FFFE000000000000190000000010000068BD0C58F613CE13
34B1EB51C68D39EA19000101010000000000000058004A000000000000000000604806062B060105
0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782
08E200000000000000000000000000000000060380250000000F
PreauthSession.PreauthIntegrityHashValue
8346469934A59E951A3F2DA7FA4C2C29F0F6B13A6B0951D4CD5279F8D40FD84FF98157937613C6BE
9514582E44344B1710DD5BFCE3BB023D28C6EA512E0ADEBD</div>
<div>SESSION SETUP Response</div>
<div> --- STATUS_MORE_PROCESSING_REQUIRED - Updating Preauth integrity hash ---
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
8346469934A59E951A3F2DA7FA4C2C29F0F6B13A6B0951D4CD5279F8D40FD84FF98157937613C6BE
9514582E44344B1710DD5BFCE3BB023D28C6EA512E0ADEBD
SessionSetup response packet
FE534D4240000100160000C00100010009000000000000000200000000000000FFFE000000000000
1900000000100000014A71CAE724995E612430E2BE87578C090000004800B300A181B03081ADA003
0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038
00000015828AE23823DA68E32D2FE1000000000000000050005000440000000A0092270000000F53
005500540033003100310002000C0053005500540033003100310001000C00530055005400330031
00310004000C0053005500540033003100310003000C005300550054003300310031000700080041
3B42AECBAED00100000000
SessionSetup response header signature 0x014A71CAE724995E612430E2BE87578C
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup response packet
SHA-512 Input Hash Data
8346469934A59E951A3F2DA7FA4C2C29F0F6B13A6B0951D4CD5279F8D40FD84FF98157937613C6BE
9514582E44344B1710DD5BFCE3BB023D28C6EA512E0ADEBDFE534D4240000100160000C001000100
09000000000000000200000000000000FFFE0000000000001900000000100000014A71CAE724995E
612430E2BE87578C090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202
0AA281970481944E544C4D53535000020000000C000C003800000015828AE23823DA68E32D2FE100
0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053
005500540033003100310001000C0053005500540033003100310004000C00530055005400330031
00310003000C0053005500540033003100310007000800413B42AECBAED00100000000
PreauthSession.PreauthIntegrityHashValue
6DAD1BA61CAF5FDFBB46D995463FF5780F7248D692E70CE87D8B58B2FBEFD438937E1BCBEC3676F2
6F7EE374E169F8AFB17671FB9A47AB88EE2C079DB2B2C7D3</div>
<div>SESSION SETUP Request
PreauthSession.SessionId 0x100000000019
Current
PreauthSession.PreauthIntegrityHashValue
6DAD1BA61CAF5FDFBB46D995463FF5780F7248D692E70CE87D8B58B2FBEFD438937E1BCBEC3676F2
6F7EE374E169F8AFB17671FB9A47AB88EE2C079DB2B2C7D3
SessionSetup request packet
FE534D4240000100000000000100800008000000000000000300000000000000FFFE000000000000
19000000001000003CA64529ACAE57B26DCEC17B14E477D71900010101000000000000005800CF01
0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000
001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000
001000100096010000158288E2060380250000000FED00E0F3D901F7B77E98071474F83009530055
005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049
00560045005200330031003100000000000000000000000000000000000000000000000000A46794
DA5D2033965D5339E1A675B79B0101000000000000413B42AECBAED0018E4D343661BA6A75000000
0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055
00540033003100310003000C0053005500540033003100310007000800413B42AECBAED001060004
00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B
8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016
0063006900660073002F00530055005400330031003100000000000000000000000000C8C61D67CE
697693891336917655DDD3A3120410010000005122F070A7314A9B00000000
Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet
SHA-512 Input Hash Data
6DAD1BA61CAF5FDFBB46D995463FF5780F7248D692E70CE87D8B58B2FBEFD438937E1BCBEC3676F2
6F7EE374E169F8AFB17671FB9A47AB88EE2C079DB2B2C7D3FE534D42400001000000000001008000
08000000000000000300000000000000FFFE00000000000019000000001000003CA64529ACAE57B2
6DCEC17B14E477D71900010101000000000000005800CF010000000000000000A18201CB308201C7
A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000
000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380
250000000FED00E0F3D901F7B77E98071474F83009530055005400330031003100610064006D0069
006E006900730074007200610074006F007200440052004900560045005200330031003100000000
000000000000000000000000000000000000000000A46794DA5D2033965D5339E1A675B79B010100
0000000000413B42AECBAED0018E4D343661BA6A750000000002000C005300550054003300310031
0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055
00540033003100310007000800413B42AECBAED00106000400020000000800300030000000000000
000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0
CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054
00330031003100000000000000000000000000C8C61D67CE697693891336917655DDD3A312041001
0000005122F070A7314A9B00000000
PreauthSession.PreauthIntegrityHashValue
EA3BF912B11CBFEC5B1889E8209614218687F82FA5294521AD3063425E49E88A10BD022124CE2512
3BC9111F52D9566BA88BF46344E6063DC5E3FF0389026F6C</div>
<div>SESSION SETUP Response
SessionId 0x100000000019 COMPLETED
SessionSetup response packet
FE534D4240000100000000000100800009000000000000000300000000000000FFFE000000000000
19000000001000008D604217FFBACF40635BF9D8729921500900000048001D00A11B3019A0030A01
00A312041001000000CFB046FC5D368E2200000000
SessionSetup response header signature 0x8D604217FFBACF40635BF9D872992150
PreauthSession.PreauthIntegrityHashValue
EA3BF912B11CBFEC5B1889E8209614218687F82FA5294521AD3063425E49E88A10BD022124CE2512
3BC9111F52D9566BA88BF46344E6063DC5E3FF0389026F6C</div>
<div>Input cryptographicKey (SessionKey) 0x84B9DBB730116A8FA6E9889555C265F9
(queried from GSS authenticated context)</div>
<div>Alternate channel: generate Channel.SigningKey.
Alternate channel: Copy encryption/decryption keys from main channel</div>
<div>--- Dialect 0x0311 ---
preauthIntegrityHashValue
EA3BF912B11CBFEC5B1889E8209614218687F82FA5294521AD3063425E49E88A10BD022124CE2512
3BC9111F52D9566BA88BF46344E6063DC5E3FF0389026F6C
CypherId 0x0002
SessionKey 0x84B9DBB730116A8FA6E9889555C265F9
SigningKey 0xC962BCA1A9DD1697B030644199705431
EncryptionKey 0x629BCBC54422A0F572B97F45989B6073
DecryptionKey 0xE2AF0DCEFAC68DA71A0DFBD0D1350D74
ApplicationKey 0x6D7AD7954E9EC61E907B4D473DC178FF</div>
<div></div>
<h2>NTLMv2 SessionKey calculation example</h2>
<div>These steps show how the SessionKey is calculated for the master session used in the SMB 3.1.1 multichannel example.
These steps show that with the knowledge of the password and a packet sniff, one can derive the NTLM SessionKey.
The steps follow MS-NLMP, compute NTLMv2 SessionKey, and verify that it matches the ExportedSessionKey.
Recall the cryptographicKey (SessionKey) 0x270E1BA896585EEB7AF3472D3B4C75A7
(queried from GSS authenticated context)</div>
<div>Inputs ==========</div>
<div>ChallengeMessage.ServerChallenge</div>
<div>       - ResponseToken: NTLM CHALLENGE MESSAGE
- NLMP: NTLM CHALLENGE MESSAGE
Signature: NTLMSSP
MessageType: Challenge Message (0x00000002)
+ TargetNameFields: Length: 12, Offset: 56
+ NegotiateFlags: 0xE28A8215 (NTLM v2, 128-bit encryption, Always Sign)
+ ServerChallenge: 0D1D8BA31179D008
Reserved: Binary Large Object (8 Bytes)
+ TargetInfoFields: Length: 80, Offset: 68
+ Version: Windows 10.0 Build 10130 NLMPv15
TargetNameString: SUT311
- AvPairs: 6 pairs
+ AvPair: SUT311 (Server NetBIOS domain name)
+ AvPair: SUT311 (Server NetBIOS computer name)
+ AvPair: SUT311 (The FQDN (2) of the domain.)
+ AvPair: SUT311 (The fully qualified domain name (FQDN (1)) of the computer.)
+ AvPair: 10:18:21 PM 6/24/2015 (Server local time)
+ AvPair: NULL</div>
<div>ChallengeMessage.ServerChallenge = "0D 1D 8B A3 11 79 D0 08 "</div>
<div>From the NtChallengeResponse, the Response needs to match the calculated NTProofStr .
NtChallengeResponse = ConcatenationOf(NTProofStr, temp)</div>
<div>       - ResponseToken: NTLM AUTHENTICATE MESSAGE Version:NTLM v2, Domain: SUT311, User: administrator, Workstation: DRIVER311
- NLMP: NTLM AUTHENTICATE MESSAGE Version:NTLM v2, Domain: SUT311, User: administrator, Workstation: DRIVER311
Signature: NTLMSSP
MessageType: Authenticate Message (0x00000003)
+ LmChallengeResponseFields: Length: 24, Offset: 144
+ NtChallengeResponseFields: Length: 238, Offset: 168
+ DomainNameFields: Length: 12, Offset: 88
+ UserNameFields: Length: 26, Offset: 100
+ WorkstationFields: Length: 18, Offset: 126
+ EncryptedRandomSessionKeyFields: Length: 16, Offset: 406
+ NegotiateFlags: 0xE2888215 (NTLM v2, 128-bit encryption, Always Sign)
+ Version: Windows 6.3 Build 9600 NLMPv15
+ MessageIntegrityCheck: ECAC77A5F385A8BF9C38C706EEEDDCD3
DomainNameString: SUT311
UserNameString: administrator
WorkstationString: DRIVER311
+ LmChallengeResponseStruct: 000000000000000000000000000000000000000000000000
- NTLMV2ChallengeResponse: 63078EB639FE03E20A231C3AE3BF2308
+ Response: 63078EB639FE03E20A231C3AE3BF2308
ResponseVersion: 1 (0x1)
HiResponseVersion: 1 (0x1)
+ Z1:
Time: 06/24/2015, 22:18:21.389456 UTC
+ ClientChallenge: BC4AD05F223CC90F
+ Z2:
- AvPairs: 10 pairs
+ AvPair: SUT311 (Server NetBIOS domain name)
+ AvPair: SUT311 (Server NetBIOS computer name)
+ AvPair: SUT311 (The FQDN (2) of the domain.)
+ AvPair: SUT311 (The fully qualified domain name (FQDN (1)) of the computer.)
+ AvPair: 10:18:21 PM 6/24/2015 (Server local time)
+ AvPair: 0x2 (Server configuration)
+ AvPair: 0x3000 (Token restrictions)
+ AvPair: 0x3000 (A channel bindings hash)
+ AvPair: cifs/SUT311 (The SPN of the target server)
+ AvPair: NULL
Padding: Binary Large Object (8 Bytes)
+ SessionKeyString: 3B9BDFF38F5EE8F9663F11A0F4C03A78
+ Tag3:
+ OctetStringHeader:
+ MechListMic: Version: 1</div>
<div>Based on NtChallengeResponseFields: Length: 238, Offset: 168, extract the bytes:
AuthenticateMessage: Ntlmv2ChallengeResponse
63 07 8E B6 39 FE 03 E2 0A 23 1C 3A E3 BF 23 08 01 01 00 00 00 00 00 00 A1 A1 F5 AD CB AE D0
01 BC 4A D0 5F 22 3C C9 0F 00 00 00 00 02 00 0C 00 53 00 55 00 54 00 33 00 31 00 31 00 01 00
0C 00 53 00 55 00 54 00 33 00 31 00 31 00 04 00 0C 00 53 00 55 00 54 00 33 00 31 00 31 00 03
00 0C 00 53 00 55 00 54 00 33 00 31 00 31 00 07 00 08 00 A1 A1 F5 AD CB AE D0 01 06 00 04 00
02 00 00 00 08 00 30 00 30 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 B6 1F EF CA A8 57 EA
57 BF 1E DC EB F8 97 4B 8E 0E BA 5A 6D FD 9D 07 A3 1D 11 B5 48 F8 C9 D0 CC 0A 00 10 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 16 00 63 00 69 00 66 00 73 00 2F 00 53 00
55 00 54 00 33 00 31 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00</div>
<div>AuthenticateMessage: Ntlmv2ChallengeResponse.Response:
63 07 8E B6 39 FE 03 E2 0A 23 1C 3A E3 BF 23 08
( or for future reference 63078EB639FE03E20A231C3AE3BF2308  )</div>
<div>From Ntlmv2ChallengeResponse of AuthenticateMessage, strip off the Response field:
temp =
01 01 00 00 00 00 00 00 A1 A1 F5 AD CB AE D0 01 BC 4A D0 5F 22 3C C9 0F 00 00 00
00 02 00 0C 00 53 00 55 00 54 00 33 00 31 00 31 00 01 00 0C 00 53 00 55 00 54 00
33 00 31 00 31 00 04 00 0C 00 53 00 55 00 54 00 33 00 31 00 31 00 03 00 0C 00 53
00 55 00 54 00 33 00 31 00 31 00 07 00 08 00 A1 A1 F5 AD CB AE D0 01 06 00 04 00
02 00 00 00 08 00 30 00 30 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 B6 1F EF
CA A8 57 EA 57 BF 1E DC EB F8 97 4B 8E 0E BA 5A 6D FD 9D 07 A3 1D 11 B5 48 F8 C9
D0 CC 0A 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 16 00 63
00 69 00 66 00 73 00 2F 00 53 00 55 00 54 00 33 00 31 00 31 00 00 00 00 00 00 00
00 00 00 00 00 00</div>
<div>AuthenticateMessage.SessionKeyString
EncryptedRandomSessionKey = 3B 9B DF F3 8F 5E E8 F9 66 3F 11 A0 F4 C0 3A 78</div>
<div>Supply all parameters to the key calculation algorithm defined in MS-NLMP.
Passwd = Password01!
Username = ADMINISTRATOR
Domain = SUT311</div>
<div>=== key calculation steps: [MS-NLMP] 3.3.2 NTLM v2 Authentication</div>
<div>        UNICODE(Passwd)) = FFFE500061007300730077006F0072006400300031002100
NtHash = MD4(UNICODE(Passwd)) = 7C4FE5EADA682714A036E39378362BAB
UUserDom = UNICODE(ConcatenationOf( Uppercase(User), UserDom ) )
UUserDom = UNICODE(ADMINISTRATORSUT311)  =
FFFE410044004D0049004E004900530054005200410054004F00520053005500540033003100
3100
NTOWFv2(Passwd, User, UserDom) = HMAC_MD5(NtHash, UUserDom)  =
AEE3959B44A815F1EB28C9511B4F533B
ResponseKeyNT = NTOWFv2 = AEE3959B44A815F1EB28C9511B4F533B
temp = ConcatenationOf(Responserversion,
HiResponserversion, Z(6), Time, ClientChallenge, Z(4), ServerName, Z(4))
temp = 0101000000000000A1A1F5ADCBAED001BC4AD05F223CC90F0000000002000C00530055005400
33003100310001000C0053005500540033003100310004000C005300550054003300310031000
3000C0053005500540033003100310007000800A1A1F5ADCBAED001060004000200000008003
00030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DF
D9D07A31D11B548F8C9D0CC0A001000000000000000000000000000000000000900160063006
900660073002F00530055005400330031003100000000000000000000000000
CHALLENGE_MESSAGE.ServerChallenge = 0D1D8BA31179D008
NTProofStr = HMAC_MD5(ResponseKeyNT,
ConcatenationOf(CHALLENGE_MESSAGE.ServerChallenge, temp)</div>
<div>

        NTProofStr = 63078EB639FE03E20A231C3AE3BF2308

SessionBaseKey = HMAC_MD5(ResponseKeyNT, NTProofStr)
NTLMv2 KeyExchangeKey = SessionBaseKey
KeyExchangeKey= B4CF22566926B1C069ACD80E4D73C814

</div>
<div>Because NTLMSSP_NEGOTIATE_KEY_EXCH
AND (NTLMSSP_NEGOTIATE_SIGN OR NTLMSSP_NEGOTIATE_SEAL):
ExportedSessionKey = RC4.Encrypt(KeyExchangeKey,
AUTHENTICATE_MESSAGE.EncryptedRandomSessionKey)</div>
<div>   ExportedSessionKey = 270E1BA896585EEB7AF3472D3B4C75A7
(this matches the key queried from GSS-API)</div>
<div></div>
<div>For completeness, we also show here the computation of the remaining NTLM keys. Note those keys have no use in SMB2/3.</div>
<div>Check SIGNKEY() algorithm in MS-NLMP for specific details.</div>
<div>Because we have NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY flag set:
Client Signing key = MD5(ConcatenationOf(ExportedSessionKey,
"session key to client-to-server signing key magic constant"))
Server Signing key = MD5(ConcatenationOf(ExportedSessionKey,
"session key to server-to-client signing key magic constant"))</div>
<div>Server Signing key = E1BD8B416B0B709D295E12F2CF18E6C5
Client Signing key = D43F36C44BCE0630250A09EA0C2E8C2C</div>
<div>Check SEALKEY() algorithm in MS-NLMP for specific details.</div>
<div>Because NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY flag is set and
NTLMSSP_NEGOTIATE_128 is set:
Client Sealing Key = MD5(ConcatenationOf(ExportedSessionKey,
"session key to client-to-server sealing key magic constant"))
Server Sealing Key = MD5(ConcatenationOf(ExportedSessionKey,
"session key to server-to-client sealing key magic constant"))</div>
<div>Server Sealing Key = B0F5A0B32C81FF34A878E1409B3B0EF2
Client Sealing Key = 31E5557D99BE13F1B2665C7C7C52CE70</div>
<h1>References</h1>
<div>[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3 Specification
https://msdn.microsoft.com/en-us/library/cc246482.aspx
[SP800-108] National Institute of Standards and Technology. "Special Publication 800-108, Recommendation for Key Derivation Using Pseudorandom Functions", October 2009, https://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf
[RFC5084] Housley, R., "Using AES-CCM and AES-GCM Authenticated Encryption in the Cryptographic Message Syntax (CMS)", RFC 5084, November 2007, https://www.ietf.org/rfc/rfc5084.txt
[FIPS180-4] FIPS PUBS, "Secure Hash Standards (SHS)", March 2012, https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
[RFC4493]. The AES-CMAC Algorithm, https://www.ietf.org/rfc/rfc4493.txt
Windows Server 2012 R2: Which version of the SMB protocol (SMB 1.0, SMB 2.0, SMB 2.1, SMB 3.0 or SMB 3.02) are you using?</div>
<div>https://blogs.technet.microsoft.com/josebda/2013/10/02/windows-server-2012-r2-which-version-of-the-smb-protocol-smb-1-0-smb-2-0-smb-2-1-smb-3-0-or-smb-3-02-are-you-using/
The Basics of SMB Signing (covering both SMB1 and SMB2)
https://blogs.technet.microsoft.com/josebda/2010/12/01/the-basics-of-smb-signing-covering-both-smb1-and-smb2/</div>
<div></div>]]></content:encoded>
    </item>
    <item>
      <title>How Kerberos user-to-user authentication works?</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/how-kerberos-user-to-user-authentication-works</link>
      <pubDate>Wed, 24 May 2017 19:17:36 GMT</pubDate>
      <dc:creator><![CDATA[Edgar A Olougouna]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/?p=1145</guid>
      <description><![CDATA[The Kerberos user-to-user (U2U) authentication mechanism enables a client to authenticate to a...]]></description>
      <content:encoded><![CDATA[<div>The Kerberos user-to-user (U2U) authentication mechanism enables a client to authenticate to a service that is not in possession of the long-term secret key. U2U allows one principal to authenticate using a ticket encrypted with the session key from a TGT issued to another principal. This article discusses the messages involved in the mechanism. It illustrates various scenarios and applicability settings. It finally provides samples of packet exchanges.</div>
<div></div>
<div>

Table of Contents

</div>
<div>

Preamble 2
Glossary 2
Refresher: Basic Kerberos authentication 2

</div>
<div style="padding-left: 30px">The Authentication Service Exchange 2
The Ticket-Granting Service Exchange 3
The Client / Application Server Exchange 3</div>
<div>User-to-User Authentication Exchange 3</div>
<div style="padding-left: 30px">User-to-User Mechanism 3
User-to-User GSS-API messages 4
User-to-User tickets are not cached 5</div>
<div>How is U2U authentication initiated? 5</div>
<div style="padding-left: 30px">Deliberate client awareness 5
U2U via KDC policy 5
U2U via server policy 5</div>
<div>U2U illustrations 5</div>
<div style="padding-left: 30px">Deliberate Kerberos U2U from client: CredSSP in Remote Desktop Session 5
Kerberos U2U: Enabling SSO with NTLM for smart card sign-in 6
Kerberos U2U via KDC policy: Offering Remote Assistance 6</div>
<div>Conclusion 7</div>
<div>Appendix 1. Related Kerberos Error codes 7
Appendix 2. Steps of standard CredSSP’s Kerberos U2U from client 8
Appendix 3. Steps of Kerberos U2U via KDC policy in Offering Remote Assistance 24
References 48</div>
<div>
<h1><a>Preamble</a></h1>
This article is not about Public Key Cryptography Based User-to-User (PKU2U). PKU2U is used in homegroup environments to authenticate peers by leveraging local certificates between peer computers.
This article is not about Service for User and Constrained Delegation, both referred to as S4U [MS-SFU]. S4U enables an application service to obtain a Kerberos service ticket on behalf of a user (S4U2Self, S4U2Proxy).
We assume the reader is familiar with Kerberos authentication [RFC4120] and GSS-API concepts [RFC2743]. We start the article with a terse overview of basic Kerberos authentication before elaborating on U2U.
<h1><a>Glossary</a></h1>
API – Application Program Interface
AP – Application server
AS – Authentication service
GSS – Generic Security Service
KDC - Key distribution center
PAC – Privilege Account Certificate
SPN - Service Principal Name
SPNEGO - Simple and Protected GSSAPI Negotiation Mechanism
TGT - Ticket granting ticket
TGS - Ticket granting service
U2U – User-to-user

</div>
<div>
<h1><a>Refresher: Basic Kerberos authentication</a></h1>
In its classic form, the Kerberos protocol supports authentication between a client and an application server. It consists of three main message exchanges.
<h2><a></a>The Authentication Service Exchange</h2>
The AS exchange consists of KRB_AS_REQ and KRB_AS_REP. In the KRB_AS_REQ, the client requests a TGT from the KDC’s Authentication Service (AS). In the KRB_AS_REP, the AS returns the TGT, which is the user's initial ticket meant only for use by the TGS. The TGT includes a session key that the client can use to encrypt communication with the TGS.
The TGT is encrypted with a key only known by the KDC (the KDC key is shared by all KDCs in the realm). Thus, the TGT is opaque to all entities except the KDC itself. The TGT has a short validity time (typically 10 hours).
The encrypted part of AS exchange uses the key that the client shares with the KDC.
<h2><a></a>The Ticket-Granting Service Exchange</h2>
The TGS exchange involves KRB_TGS_REQ and KRB_TGS_REP. The client requests the TGS to issue a service ticket for the target service. In the KRB_TGS_REQ, the client presents the TGT, an authenticator, and identifies the target service by its SPN.
The TGS validates the TGT and the authenticator. It then issues a service ticket. It encrypts the ticket with the long-term key that is shared by the KDC and the target service. The ticket includes the client's identity and a copy of the session key. The TGS encrypts the client's copy of the session key with the key that the KDC shares with the client.
<h2><a></a>The Client / Application Server Exchange</h2>
To authenticate to the server, the client composes KRB_AP_REQ and sends the service ticket along with a new authenticator to the target server. The server decrypts the ticket with its long-term key and validates the authenticator. In Windows, the service also creates an access token based on the user’s PAC.
Optionally, the client might have requested mutual authentication with the target server. If so, the target server retrieves the client’s timestamp from the authenticator, encrypts it with the session key, and returns it to the client as part of the KRB_AP_REP.

</div>
<div>
<h1><a>User-to-User Authentication Exchange</a></h1>
U2U authentication provides a method to perform authentication when the verifier does not have access to the service’s long-term key. The basic form of Kerberos authentication is not suitable for peer-to-peer authentication. The U2U variant of Kerberos enables authentication of such peers. The idea is to obtain a TGS ticket encrypted with the session key from another TGT issued to another user, instead of the long-term server key that would have not be accessible in the acceptor’s context.
The following sections summarize the user-to-user authentication sequence.

</div>
<h2><a>User-to-User Mechanism</a></h2>
<div>

The OID for user-to-user mechanism is:

1.2.840.113554.1.2.2.3

</div>
<div>It is a child OID of GSSAPI Kerberos OID 1.2.840.113554.1.2.2.</div>
<div>The U2U mech-type extends the conventional Kerberos GSS-API protocol and adds a round trip with the server to retrieve the TGT from the service.</div>
<h2><a>User-to-User GSS-API messages</a></h2>
<div>

In the GSS-API encapsulated message exchange for U2U Kerberos, the request token has an innerContextToken with a 2-octet TOK_ID field containing 04 00 (KERB-TGT-REQUEST) followed by the message:

KERB-TGT-REQUEST ::= SEQUENCE {
pvno[0]                         INTEGER,
msg-type[1]                     INTEGER,
server-name[2]                  PrincipalName OPTIONAL,
realm[3]                        Realm OPTIONAL

All fields are defined in the Kerberos RFC4120 and informational RFC draft for U2U [U2UDraft].
msg-type is KRB_TGT_REQ (16).

</div>
<div>

The response message is a KERB_TGT_REPLY token which has an innerContextToken with a 2-octet TOK_ID field containing 04 01 (KERB-TGT-REPLY) followed by the message as follows:

KERB-TGT-REPLY ::= SEQUENCE {
pvno[0]                         INTEGER,
msg-type[1]                     INTEGER,
ticket[2]                       Ticket
}
msg-type is KRB_TGT_REP (17). The ticket contains the TGT for the service.

</div>
<div>Upon receipt of the service TGT, the client initiator can now request the KDC to issue a service ticket by using a KERB-TGS-REQ with the KDC-Options ENC-TKT-IN-SKEY and the service TGT in the additional-tickets of the KDC-REQ-BODY.</div>
<div>Because ENC-TKT-IN-SKEY option is present in the KRB_KDC_REQ, the Sname may be absent. However, the Sname for U2U ticket is typically set to the principal name (i.e. user name) whose TGT the server supplied to the client. If Sname is absent, the KDC will use the name from the client in the additional ticket.</div>
<div>The TGS honors the request and issues the ticket (KERB-TGS-REP). It encrypts the ticket with the session key of the TGT in the additional ticket.</div>
<div>The client finally continues with the AP exchange. In the KERB-AP-REQ, the client sets USE-SESSION-KEY flag in the AP-Options to indicate to the server that U2U authentication is in use, and that the service ticket is encrypted in the session key from the server's TGT rather than in the server's long-term key.</div>
<div>
<h2><a></a>User-to-User tickets are not cached</h2>
</div>
<div>U2U service tickets are not cacheable. A U2U ticket is only usable to one instance of a client application. On the other hand, to cache a ticket, it must be valid to all instances of the service that share that SPN. Multiple authentications that share a cacheable service ticket will likewise share a session key.</div>
<div>How is U2U authentication initiated?</div>
<div>The Kerberos protocol does not specify the client’s trigger to U2U authentication. It is in the application protocol sequence that the client obtains the server’s TGT. Once this pre-requisite is fulfilled, the client can initiate user-to-user authentication as previously described.
U2U is often used in cases where SPNEGO starts Kerberos and then fails either with KDC_ERR_MUST_USE_USER2USER from the KDC or with KRB_AP_ERR_USER_TO_USER_REQUIRED from the server.</div>
<div>
<h2><a></a>Deliberate client awareness</h2>
</div>
<div>When the client is aware that the application server requires user-to-user authentication, it will explicitly request U2U mechanism in the first call to GSS_Init_Sec_Context.</div>
<h2>U2U via KDC policy</h2>
<div>The KDC may implement a policy on user accounts to reject conventional service ticket requests. When a KERB_TGS_REQ that does not include a second ticket with an ENC_TKT_IN_SKEY KDC Option, the KDC will respond with KDC_ERR_MUST_USE_USER2USER (0x1B).</div>
<h2>U2U via server policy</h2>
<div>When a client sends a conventional KRB_AP_REQ and the service requires U2U authentication, the server will respond with KRB_AP_ERR_USER_TO_USER_REQUIRED (0x45). The server may provide its TGT in the data of the error message.</div>
<h1>U2U illustrations</h1>
<h2>Deliberate Kerberos U2U from client: CredSSP in Remote Desktop Session</h2>
<div>For Kerberos under CredSSP, the client chooses to do U2U on its own without a prior error about U2U being required. The client initiates U2U because CredSSP calls InitializeSecurityContext with the ISC_REQ_USE_SESSION_KEY flag. That flag requires a new session key, which Kerberos honors by doing U2U.
When one observes network packets of Windows-based CredSPP, the Kerberos exchanges start with a conventional TGS ticket request, which is unexpected. This conventional TGS exchange could be explained by the fact that the code that forces to transition to U2U is emulating the reception of the user-to-user required error, and thus after the point where we get the normal ticket.  That initial TGS preceding the first CredSSP TSRequest is a useless ticket retrieval. Indeed, that ticket is not presented in the TSRequest. Instead the client deliberately decides to send a U2U inside an SPNEGO token of the TSRequest.
CredSSP resorts to U2U mechanism because U2U service tickets are not cacheable. When CredSSP uses U2U, it gets a unique session key to encrypt credentials and this remains private to the process instance. Had that connection used Kerberos without U2U, then the session key used to protect the credentials would have been available to any process running as the user that shares the user’s ticket cache.
Note that the SPNEGO token of the first CSSP TSRequest has UserToUserMechanism in the MechToken = InitialContextToken{ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3) . . .}
Even though the MechTypes list contains:
MechTypes: {MsKerberosToken (1.2.840.48018.1.2.2); KerberosToken (1.2.840.113554.1.2.2); Negoex (1.3.6.1.4.1.311.2.2.30); NLMP (1.3.6.1.4.1.311.2.2.10)}
Here, the MechType is not really being negotiated.
In the appendix, we provide illustrative packets of the exchange. The outer TLS session of the CredSSP packets has been decrypted.</div>
<h2>Kerberos U2U: Enabling SSO with NTLM for smart card sign-in</h2>
<div>Kerberos U2U helps to provide single-sign-on (SSO) with NTLM for a smart card sign-in. When the user logs in a client with a smartcard, Kerberos U2U enables SSO to network services that require NTLM. One such scenario is a remote desktop connection to a non-domain-joined server where the client needs to delegate its credentials to the server which is not capable of Kerberos authentication.
The client uses Kerberos U2U to retrieve the NTOWF hash of the user’s password. It starts with a PKINIT exchange of KERB_AS_REQ / KERB_AS_REP with AS-PK-REQ / AS-PK-REP as specified in [MS-PKCA]. By using the PIN to unlock the smartcard, the client reads the principal name and certificate, then signs the AS-REQ which the KDC will validate before issuing the TGT.
The client then retrieves a U2U TGS with the user name as Sname. In the U2U TGS’s KDC-REQ-BODY, the client uses the ENC-TKT-IN-SKEY option and supplies its TGT in the additional tickets. This allows to decrypt the resulting PAC (with the session key) and get the NTOWF in NTLM_SUPPLEMENTAL_CREDENTIAL.
The encrypted NTOWF is part of the PAC and thus gets propagated to service tickets that the user acquires, but only the system to which the user logs on interactively can decrypt it. This allows a user that logs on with a smartcard to acquire credentials necessary to access resources that require NTLM.
Note that the encrypted NTOWF in the PAC is not due to U2U. The client uses Kerberos U2U because a U2U ticket is un-cacheable. The session key remains privy to that process instance. When another authentication is needed, there is a separate ticket request.</div>
<h2>Kerberos U2U via KDC policy: Offering Remote Assistance</h2>
<div>This example illustrates U2U authentication with the trigger via KDC policy. It uses the scenario of an Expert providing an unsolicited Remote Assistance (RA) to a Novice. The Expert initiates the RA offer with “msra /offerRA &lt;Novice-FQDN&gt;” command.
To establish the RA session to the host identified by the Novice-FQDN, the Expert needs to obtain a Kerberos ticket to the user account of the Novice.
First, the Expert’s computer tries to obtain a Kerberos ticket for the user account on the Novice's computer. The user account does not have any service principal name (SPN) that is registered. Thus, the KDC service on the DC returns the error KDC_S_PRINCIPAL_UNKNOWN. The extended error information conveys the client should fall back to U2U authentication (the KDC reply indicates KDC_ERR_MUST_USE_USER2USER in its extended error information).
The Expert computer sends the U2U token to the Novice’s computer and obtain the user’s TGT. In this scenario, this U2U token exchange happens as part of the MSRPC Bind because the RA session goes over DCOM (MSRPC).
The Expert computer uses an SPN with "RestrictedKrbHost" service class because it has the server name but not the identity of the service. This SPN is meant to authenticate with the server and not the service.
Afterwards, it proceeds U2U authentication exchange, as previously described.
In the appendix, we show an example of parsed packets of the exchange.</div>
<h1>Conclusion</h1>
<div>In this article, we discussed how Kerberos user-to-user authentication works. It is often an unspoken extension to Kerberos. We described the message exchange and provided examples of applications. The appendixes provide samples of U2U authentication exchanges.</div>
<h1>Appendix 1. Related Kerberos Error codes</h1>
<div>Error code, Error macro, Description</div>
<div>0x6, KDC_ERR_C_PRINCIPAL_UNKNOWN, Client not found in Kerberos database
0x7, KDC_ERR_S_PRINCIPAL_UNKNOWN, Server not found in Kerberos database
0x1B, KDC_ERR_MUST_USE_USER2USER, Server principal valid for user2user only
0x45, KRB_AP_ERR_USER_TO_USER_REQUIRED, User-to-user authorization is required
A network packet capture generally shows the error codes in KERB-ERROR responses. To further diagnose, the Kerberos Event log can be useful, notably when there is extended error information.
For diagnostic purpose, you can set the following registry to enable Kerberos events. This should not be left enabled on live production, otherwise it will fill up unnecessary disk space.
https://support.microsoft.com/en-us/help/262177/how-to-enable-kerberos-event-logging
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters
Registry Value: LogLevel
Value Type: REG_DWORD
Value Data: 0x1</div>
<h1>Appendix 2. Steps of standard CredSSP’s Kerberos U2U from client</h1>
<div>This client’s TGT will be used later during U2U TGS.</div>
<div>KerberosV5 KerberosV5:AS Request Cname: Administrator Realm: contoso4 Sname: krbtgt/contoso4
KerberosV5 KerberosV5:KRB_ERROR  - KDC_ERR_PREAUTH_REQUIRED (25)
KerberosV5 KerberosV5:AS Request Cname: Administrator Realm: contoso4 Sname: krbtgt/contoso4
KerberosV5 KerberosV5:AS Response Ticket[Realm: CONTOSO4.COM, Sname: krbtgt/CONTOSO4.COM]</div>
<div></div>
<div>The following TGS ticket (to Sname: TERMSRV/sut01tp4.contoso4.com) will not be used, although it is retrieved.</div>
<div></div>
<div>KerberosV5 KerberosV5:TGS Request Realm: CONTOSO4.COM Sname: TERMSRV/sut01tp4.contoso4.com
KerberosV5 KerberosV5:TGS Response Cname: Administrator</div>
<div>The client initiates U2U.</div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag1:
- NegoTokens:
+ SequenceOfHeader:
+ SequenceHeader:
+ Tag0:
+ AsnOctetStringHeader:
- NegoToken:
- InitialContextToken:
+ ApplicationHeader:
+ ThisMech: SpnegoToken (1.3.6.1.5.5.2)
- InnerContextToken: 0x1
- SpnegoToken: 0x1
+ ChoiceTag:
- NegTokenInit:
+ SequenceHeader:
+ Tag0:
- MechTypes: Prefer MsKerberosToken (1.2.840.48018.1.2.2)
+ SequenceHeader:
+ MechType: MsKerberosToken (1.2.840.48018.1.2.2)
+ MechType: KerberosToken (1.2.840.113554.1.2.2)
+ MechType: Negoex (1.3.6.1.4.1.311.2.2.30)
+ MechType: NLMP (1.3.6.1.4.1.311.2.2.10)
+ Tag2:
+ OctetStringHeader:
- MechToken: unused (0)
- MsKerberosToken: unused (0)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: unused (0)
- KerberosToken: unused (0)
TokId: 0x400
- UsertoUserSessionReq: KRB_TGT_REQ (0x10)
+ SequenceHeader:
+ Tag0:
+ pvno: 5
+ Tag1:
+ MessageType: 16
+ Tag2:
+ ServerName: TERMSRV/sut01tp4.contoso4.com</div>
<div>the client receives the TGT form the server.</div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag1:
- NegoTokens:
+ SequenceOfHeader:
+ SequenceHeader:
+ Tag0:
+ AsnOctetStringHeader:
- NegoToken:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag1:
+ SupportedMech: MsKerberosToken (1.2.840.48018.1.2.2)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: unused (0)
- MsKerberosToken: unused (0)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: unused (0)
- KerberosToken: unused (0)
TokId: 0x401
- UsertoUserSessionRep: KRB_TGT_REP (0x11)
+ SequenceHeader:
+ Tag0:
+ pvno: 5
+ Tag1:
+ MessageType: 17
+ Tag2:
- Ticket: Realm: CONTOSO4.COM, Sname: krbtgt/CONTOSO4.COM
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO4.COM
+ Tag2: 0x1
+ Sname: krbtgt/CONTOSO4.COM
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag1:
+ KvNo: 2
+ Tag2:
+ Cipher: h:Ì°a---------------12Bz"?Uâ*sä‘:ñ‹?ç;†·8µFnDê1@È\wÐV8–ÄÔ÷uÊdÈvqÙÜ0 ---------------/¤&lt;Ï¼»¢þkÎgÈmíXeðoôfòWòùÝ?$5.---------------´äŒ^´ÛÝïcJõ@ûdY’.®?`Ä×53+iw˜
¿ÞFv´&amp;q'`™Íü…01W
PÎø.ºOç3|+g`"CRaØ]#\ÊñÞ(xªþ›•â¸ôå±¡MŠå.05HÓö“¶ZÆQ†·&amp;-------------------------------------------------------------¾}7^a•çúÅ£Ù.´sÕL†ÖãR1---------------œ{íºÄ/)\" Lò[áqœU</div>
<div></div>
<div>The client requests service ticket for U2U authentication.</div>
<div>KerberosV5 KerberosV5:TGS Request Realm: CONTOSO4.COM Sname: TERMSRV/sut01tp4.contoso4.com</div>
<div></div>
<div>- Kerberos: TGS Request Realm: CONTOSO4.COM Sname: TERMSRV/sut01tp4.contoso4.com
+ Length: Length = 2674
- TgsReq: Kerberos TGS Request
+ ApplicationTag:
- KdcReq: KRB_TGS_REQ (12)
+ SequenceHeader:
+ Tag1:
+ Pvno: 5
+ Tag2:
+ MsgType: KRB_TGS_REQ (12)
+ Tag3:
- PaData:
+ SequenceOfHeader:
- PaData: PA-TGS-REQ (1)
+ SequenceHeader:
+ Tag1:
+ PaDataType: PA-TGS-REQ (1)
+ Tag2:
+ OctetStringHeader:
- KrbApReq: KRB_AP_REQ (14)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REQ (14)
+ Tag2: 0x1
+ ApOptions:
+ Tag3:
- Ticket: Realm: CONTOSO4.COM, Sname: krbtgt/CONTOSO4.COM
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO4.COM
+ Tag2: 0x1
+ Sname: krbtgt/CONTOSO4.COM
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag1:
+ KvNo: 2
+ Tag2:
+ Cipher: ¯++ä¨OQòåc ¦¹ÿÑãIªã&lt;»Xðë.`¾bÌÎØI?N¦ÛIXzCXaº´Æ}±?­Õ6
›D£ði­ñËÕ?ÉeÕ?J0W¬šÚDÚù ¸aŠNxDÉ»’ÓQŠh øË˜öÕ¡¼wÊ?$æŒªya}|^líà@—ÎëÚ÷.\ê¯z™Ÿðîö¢N‡Ù†¥¦2l QÑ=úG²R¨Mj/lÕ¾­éŒL&lt;?—·…¸Ñ=?ãšF;ùÿ\\¸Ìr“ "
ôägùÖ°k…ÐÈÜG.Qƒ¼»IÐG¼9˜‚yDÿx«åÿ[+H=Ç\ýmù›QÐ
+ Tag4:
+ Authenticator:
+ PaData: PA-PAC-OPTIONS (167)
+ Tag4:
- ReqBody:
+ SequenceHeader:
+ Tag0:
- KdcOptions: 0x40810008
+ KerberosFlagsHeader:
+ Padding:
- KrbFlags: 0x40810008
Reserved:              (0...............................)
Forwardable:           (.1..............................) Ticket to be issued is to have its FORWARDABLE flag set
Forwarded:             (..0.............................) This is not a request for forwarding
Proxiable:             (...0............................) Ticket to be issued is not to have its PROXIABLE flag set
Proxy:                 (....0...........................) This is not a request for a proxy
AllowPostDate:         (.....0..........................) Ticket to be issued is not to have its MAY_POSTDATE flag set
PostDated:             (......0.........................) This is not a request for a postdated ticket
Unused7:               (.......0........................)
Renewable:             (........1.......................) Ticket to be issued is to have its RENEWABLE flag set
Unused9:               (.........0......................)
Unused10:              (..........0.....................)
OptHardwareAuth:       (...........0....................)
Unused12:              (............0...................)
Unused13:              (.............0..................)
CnameInAddlTkt:        (..............0.................) This is not a request for S4U2proxy functionality
Canonicalize:          (...............1................)
Unused16:              (................0000000000......)
DisableTransitedCheck: (..........................0.....) Checking of the transited field is enabled
RenewableOk:           (...........................0....) Renewable ticket is not acceptable
EncTktInSkey:          (............................1...) Indicates that the ticket for the end server is to be encrypted in the session key from the additional TGT provided
Unused29:              (.............................0..)
Renew:                 (..............................0.) Present request is not for a renewal
Validate:              (...............................0) Request is not to validate a postdated ticket
+ Tag2: 0x1
+ Realm: CONTOSO4.COM
+ Tag3:
+ Sname: TERMSRV/sut01tp4.contoso4.com
+ Tag5: 0x1
+ Till: 09/13/2037 02:48:05 UTC
+ Tag7:
+ Nonce: 794422766 (0x2F59EDEE)
+ Tag8:
+ Etype:
+ TagA:
+ EncAuthorizationData:
+ TagB:
- AdditionalTickets:
+ SequenceOfHeader:
- Ticket: Realm: CONTOSO4.COM, Sname: krbtgt/CONTOSO4.COM
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO4.COM
+ Tag2: 0x1
+ Sname: krbtgt/CONTOSO4.COM
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag1:
+ KvNo: 2
+ Tag2:
+ Cipher: h:Ì°a---------------12Bz"?Uâ*sä‘:ñ‹?ç;†·8µFnDê1@È\wÐV8–ÄÔ÷uÊdÈvqÙÜ0 ---------------/¤&lt;Ï¼»¢þkÎgÈmíXeðoôfòWòùÝ?$5.---------------´äŒ^´ÛÝïcJõ@ûdY’.®?`Ä×53+iw˜
¿ÞFv´&amp;q'`™Íü…01W
PÎø.ºOç3|+g`"CRaØ]#\ÊñÞ(xªþ›•â¸ôå±¡MŠå.05HÓö“¶ZÆQ†·&amp;-------------------------------------------------------------¾}7^a•çúÅ£Ù.´sÕL†ÖãR1---------------œ{íºÄ/)\" Lò[áqœU</div>
<div></div>
<div>KerberosV5 KerberosV5:TGS Response Cname: Administrator</div>
<div>- Kerberos: TGS Response Cname: Administrator
+ Length: Length = 1638
- TgsRep: Kerberos TGS Response
+ ApplicationTag:
- KdcRep: KRB_TGS_REP (13)
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_TGS_REP (13)
+ Tag3:
+ Crealm: CONTOSO4.COM
+ Tag4:
+ Cname: Administrator
+ Tag5:
- Ticket: Realm: CONTOSO4.COM, Sname: TERMSRV/sut01tp4.contoso4.com
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO4.COM
+ Tag2: 0x1
+ Sname: TERMSRV/sut01tp4.contoso4.com
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag2:
+ Cipher: ­[¼ˆÀfÙ÷&amp;v.'æÿÒ~”´Ñ95D³3›Ø‹éæD@OÆæÆþ@œ¹oÙÁ}&amp;&amp;MáÛ`? ‘oh¼õÎýƒíˆû---------------÷68”öR®˜ÏïV‹?ö5¾_ú&gt;´I4˜
?ØDÏ‡Éš&amp;”ù«yaøýª·mv?ïa%ß À
+ Tag6:
+ EncPart:</div>
<div></div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag1:
- NegoTokens:
+ SequenceOfHeader:
+ SequenceHeader:
+ Tag0:
+ AsnOctetStringHeader:
- NegoToken:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: unused (0)
- KerberosToken: unused (0)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: unused (0)
- KerberosToken: unused (0)
TokId: Krb5ApReq (0x100)
- ApReq: KRB_AP_REQ (14)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REQ (14)
+ Tag2: 0x1
- ApOptions:
+ KerberosFlagsHeader:
+ Padding:
- KrbFlags: 0x60000000
Reserved:       (0...............................)
UseSessionKey:  (.1..............................)
MutualRequired: (..1.............................)
Unused:         (...00000000000000000000000000000)
+ Tag3:
- Ticket: Realm: CONTOSO4.COM, Sname: TERMSRV/sut01tp4.contoso4.com
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO4.COM
+ Tag2: 0x1
+ Sname: TERMSRV/sut01tp4.contoso4.com
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag2:
+ Cipher: ­[¼ˆÀfÙ÷&amp;v.'æÿÒ~”´Ñ95D³3›Ø‹éæD@OÆæÆþ@œ¹oÙÁ}&amp;&amp;MáÛ`? ‘oh¼õÎýƒíˆû---------------÷68”öR®˜ÏïV‹?ö5¾_ú&gt;´I4˜
?ØDÏ‡Éš&amp;”ù«yaøýª·mv?ïa%ß À
+ Tag4:
+ Authenticator:</div>
<div></div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag1:
- NegoTokens:
+ SequenceOfHeader:
+ SequenceHeader:
+ Tag0:
+ AsnOctetStringHeader:
- NegoToken:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: KRB_AP_REP (15)
- KerberosToken: KRB_AP_REP (15)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: KRB_AP_REP (15)
- KerberosToken: KRB_AP_REP (15)
TokId: Krb5ApRep (0x200)
+ ApRep: KRB_AP_REP (15)
+ Tag3:
+ OctetStringHeader:
+ MechListMic: KRB_AP_REP (15)</div>
<div></div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag1:
- NegoTokens:
+ SequenceOfHeader:
+ SequenceHeader:
+ Tag0:
+ AsnOctetStringHeader:
- NegoToken:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-completed (0)
+ Tag3:
+ OctetStringHeader:
- MechListMic: unused (0)
- KerberosToken: unused (0)
TokId: GSS_GetMIC (0x404)
- Krb5GssV2GetMic:
+ Flags: 4 (0x4)
Filler: Binary Large Object (5 Bytes)
SndSeq: 792999904 (0x2F4437E0)
SgnCksum: Binary Large Object (218 Bytes)</div>
<div></div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag3:
+ PubKeyAuth: Encrypted</div>
<div>CSSP CredSSP:TSRequest, Version: 3</div>
<div>  TLSSSLData: Transport Layer Security (TLS) Payload Data
+ TLS: TLS Rec Layer-1 SSL Application Data
- Cssp: CredSSP
- TsRequest:
+ SequenceHeader:
+ Tag0:
+ Version: 3
+ Tag2:
+ AuthInfo: Encrypted</div>
<h1>Appendix 3. Steps of Kerberos U2U via KDC policy in Offering Remote Assistance</h1>
<div>KerberosV5:AS Request Cname: myuser01 Realm: CONTOSO.COM Sname: krbtgt/CONTOSO.COM
KerberosV5:KRB_ERROR  - KDC_ERR_PREAUTH_REQUIRED (25)
KerberosV5:AS Request Cname: myuser01 Realm: CONTOSO.COM Sname: krbtgt/CONTOSO.COM
KerberosV5:AS Response Ticket[Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM]
KerberosV5:TGS Request Realm: CONTOSO.COM Sname: RestrictedKrbHost/sut2016rs1.contoso.com
KerberosV5:TGS Response Cname: myuser01
. . .
KerberosV5:TGS Request Realm: CONTOSO.COM Sname: krbtgt/CONTOSO
KerberosV5:TGS Response Cname: myuser01</div>
<div>KerberosV5:TGS Request Realm: CONTOSO.COM Sname: Administrator</div>
<div> - Kerberos: TGS Request Realm: CONTOSO.COM Sname: Administrator
+ Length: Length = 1542
- TgsReq: Kerberos TGS Request
+ ApplicationTag:
- KdcReq: KRB_TGS_REQ (12)
+ SequenceHeader:
+ Tag1:
+ Pvno: 5
+ Tag2:
+ MsgType: KRB_TGS_REQ (12)
+ Tag3:
- PaData:
+ SequenceOfHeader:
- PaData: PA-TGS-REQ (1)
+ SequenceHeader:
+ Tag1:
+ PaDataType: PA-TGS-REQ (1)
+ Tag2:
+ OctetStringHeader:
- KrbApReq: KRB_AP_REQ (14)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REQ (14)
+ Tag2: 0x1
+ ApOptions:
+ Tag3:
+ Ticket: Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM
+ Tag4:
+ Authenticator:
+ Tag4:
- ReqBody:
+ SequenceHeader:
+ Tag0:
+ KdcOptions: 0x40810000
+ Tag2: 0x1
+ Realm: CONTOSO.COM
+ Tag3:
+ Sname: Administrator
+ Tag5: 0x1
+ Till: 09/13/2037 02:48:05 UTC
+ Tag7:
+ Nonce: 1167598226 (0x45982292)
+ Tag8:
+ Etype:
+ TagA:
+ EncAuthorizationData:</div>
<div></div>
<div>KerberosV5:KRB_ERROR  - KDC_ERR_S_PRINCIPAL_UNKNOWN (7)</div>
<div>- Kerberos: KRB_ERROR  - KDC_ERR_S_PRINCIPAL_UNKNOWN (7)
+ Length: Length = 105
- KrbError: KRB_ERROR (30)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_ERROR (30)
+ Tag4:
+ Stime: 04/08/2017 06:06:33 UTC
+ Tag5:
+ SuSec: 429948
+ Tag6:
+ ErrorCode: KDC_ERR_S_PRINCIPAL_UNKNOWN (7)
+ Tag9:
+ Realm: CONTOSO.COM
+ TagA:
+ Sname: Administrator
+ TagC:
- EData:
- EData: 0
0  ---------------?¡------------------------------------------------------------
+ AsnOctetStringHeader:
OctetStream: 04 0D 30 0B 30 09 A0 03 02 01 80 A1 02 04 00</div>
<div></div>
<div>In the Kerberos error message, the extended error data has
Error Code: 0x1b KDC_ERR_MUST_USE_USER2USER</div>
<div></div>
<div>The Kerberos event log entry looks like the following:
- &lt;Event xmlns="https://schemas.microsoft.com/win/2004/08/events/event"&gt;
- &lt;System&gt;
&lt;Provider Name="Microsoft-Windows-Security-Kerberos" Guid="{98E6CFCB-EE0A-41E0-A57B-622D4E1B30B1}" EventSourceName="Kerberos" /&gt;
&lt;EventID Qualifiers="32768"&gt;3&lt;/EventID&gt;
&lt;Version&gt;0&lt;/Version&gt;
&lt;Level&gt;2&lt;/Level&gt;
&lt;Task&gt;0&lt;/Task&gt;
&lt;Opcode&gt;0&lt;/Opcode&gt;
&lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt;
&lt;TimeCreated SystemTime="2017-04-08T06:06:33.640231200Z" /&gt;
&lt;EventRecordID&gt;8201&lt;/EventRecordID&gt;
&lt;Correlation /&gt;
&lt;Execution ProcessID="0" ThreadID="0" /&gt;
&lt;Channel&gt;System&lt;/Channel&gt;
&lt;Computer&gt;client2016rs1.contoso.com&lt;/Computer&gt;
&lt;Security /&gt;
&lt;/System&gt;
- &lt;EventData&gt;
&lt;Data Name="LogonSession" /&gt;
&lt;Data Name="ClientTime" /&gt;
&lt;Data Name="ServerTime"&gt;6:6:33.0000 4/8/2017 Z&lt;/Data&gt;
&lt;Data Name="ErrorCode"&gt;0x1b&lt;/Data&gt;
&lt;Data Name="ErrorMessage"&gt;Unknown Error&lt;/Data&gt;
&lt;Data Name="ExtendedError" /&gt;
&lt;Data Name="ClientRealm" /&gt;
&lt;Data Name="ClientName" /&gt;
&lt;Data Name="ServerRealm"&gt;CONTOSO.COM&lt;/Data&gt;
&lt;Data Name="ServerName"&gt;Administrator&lt;/Data&gt;
&lt;Data Name="TargetName"&gt;Administrator@CONTOSO.COM&lt;/Data&gt;
&lt;Data Name="ErrorText" /&gt;
&lt;Data Name="File"&gt;9&lt;/Data&gt;
&lt;Data Name="Line"&gt;11b8&lt;/Data&gt;
&lt;Binary&gt;300B3009A003020180A1020400&lt;/Binary&gt;
&lt;/EventData&gt;
&lt;/Event&gt;</div>
<div></div>
<div>the client sends UsertoUserSessionReq: KRB_TGT_REQ (0x10) to the server.</div>
<div>- MSRPC: c/o Bind: unknown UUID{00000001-0000-0000-C000-000000000046}  Call=0x2  Assoc Grp=0x0  Xmit=0x16D0  Recv=0x16D0
- Bind: {00000001-0000-0000-C000-000000000046} unknown
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0B - Bind
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 304 (0x130)
AuthLength: 136 (0x88)
CallId: 2 (0x2)
MaxXmitFrag: 5840 (0x16D0)
MaxRecvFrag: 5840 (0x16D0)
AssocGroupId: 0 (0x0)
+ PContextElem:
- AuthVerifier: 0x1
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- InitialContextToken:
+ ApplicationHeader:
+ ThisMech: SpnegoToken (1.3.6.1.5.5.2)
- InnerContextToken: 0x1
- SpnegoToken: 0x1
+ ChoiceTag:
- NegTokenInit:
+ SequenceHeader:
+ Tag0:
- MechTypes: Prefer MsKerberosToken (1.2.840.48018.1.2.2)
+ SequenceHeader:
+ MechType: MsKerberosToken (1.2.840.48018.1.2.2)
+ MechType: KerberosToken (1.2.840.113554.1.2.2)
+ MechType: Negoex (1.3.6.1.4.1.311.2.2.30)
+ MechType: NLMP (1.3.6.1.4.1.311.2.2.10)
+ Tag2:
+ OctetStringHeader:
- MechToken: unused (0)
- MsKerberosToken: unused (0)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: unused (0)
- KerberosToken: unused (0)
TokId: 0x400
- UsertoUserSessionReq: KRB_TGT_REQ (0x10)
+ SequenceHeader:
+ Tag0:
+ pvno: 5
+ Tag1:
+ MessageType: 16
+ Tag2:
+ ServerName: Administrator
+ Tag3:
+ Realm: CONTOSO</div>
<div></div>
<div>The server requests TGT for the user from the KDC.</div>
<div></div>
<div>KerberosV5:AS Request Cname: Administrator Realm: CONTOSO.COM Sname: krbtgt/CONTOSO.COM
KerberosV5:KRB_ERROR  - KDC_ERR_PREAUTH_REQUIRED (25)</div>
<div>KerberosV5:AS Request Cname: Administrator Realm: CONTOSO.COM Sname: krbtgt/CONTOSO.COM</div>
<div>- Kerberos: AS Request Cname: Administrator Realm: CONTOSO.COM Sname: krbtgt/CONTOSO.COM
+ Length: Length = 312
- AsReq: Kerberos AS Request
+ ApplicationTag:
- KdcReq: KRB_AS_REQ (10)
+ SequenceHeader:
+ Tag1:
+ Pvno: 5
+ Tag2:
+ MsgType: KRB_AS_REQ (10)
+ Tag3:
+ PaData:
+ Tag4:
- ReqBody:
+ SequenceHeader:
+ Tag0:
+ KdcOptions: 0x40810010
+ Tag1:
+ Cname: Administrator
+ Tag2: 0x1
+ Realm: CONTOSO.COM
+ Tag3:
+ Sname: krbtgt/CONTOSO.COM
+ Tag5: 0x1
+ Till: 09/13/2037 02:48:05 UTC
+ Tag6:
+ Rtime: 09/13/2037 02:48:05 UTC
+ Tag7:
+ Nonce: 1118221639 (0x42A6B547)
+ Tag8:
+ Etype:
+ Tag9:
- Addresses:
+ SequenceOfHeader:
- Address: SUT2016RS1
+ SequenceHeader:
+ Tag0:
+ AddrType: Netbios address (20)
+ Tag1:
+ Address: SUT2016RS1</div>
<div></div>
<div>KerberosV5:AS Response Ticket[Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM]</div>
<div> - Kerberos: AS Response Ticket[Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM]
+ Length: Length = 1583
- AsRep: Kerberos AS Response
+ ApplicationTag:
- KdcRep: KRB_AS_REP (11)
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AS_REP (11)
+ Tag2:
+ Padata:
+ Tag3:
+ Crealm: CONTOSO.COM
+ Tag4:
+ Cname: Administrator
+ Tag5:
+ Ticket: Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM
+ Tag6:
+ EncPart:</div>
<div></div>
<div>the client receives UsertoUserSessionRep: KRB_TGT_REP (0x11) from the server</div>
<div>- MSRPC: c/o Bind Ack: unknown UUID{00000001-0000-0000-C000-000000000046} Call=0x2  Assoc Grp=0x55A4AC30  Xmit=0x16D0  Recv=0x16D0
- BindAck:
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0C - Bind Ack
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 1303 (0x517)
AuthLength: 1187 (0x4A3)
CallId: 2 (0x2)
MaxXmitFrag: 5840 (0x16D0)
MaxRecvFrag: 5840 (0x16D0)
AssocGroupId: 1436855344 (0x55A4AC30)
+ SecAddr: 54390
Pad2: 0x1
+ PResultList:
- AuthVerifier:
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag1:
+ SupportedMech: MsKerberosToken (1.2.840.48018.1.2.2)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: unused (0)
- MsKerberosToken: unused (0)
- KerberosInitToken:
+ ApplicationHeader:
+ ThisMech: UserToUserMechanism (1.2.840.113554.1.2.2.3)
- InnerContextToken: unused (0)
- KerberosToken: unused (0)
TokId: 0x401
- UsertoUserSessionRep: KRB_TGT_REP (0x11)
+ SequenceHeader:
+ Tag0:
+ pvno: 5
+ Tag1:
+ MessageType: 17
+ Tag2:
- Ticket: Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO.COM
+ Tag2: 0x1
+ Sname: krbtgt/CONTOSO.COM
+ Tag3: 0x1
+ EncPart:</div>
<div></div>
<div>The client request TGS from the KDC for the service's user.</div>
<div></div>
<div>KerberosV5:TGS Request Realm: CONTOSO.COM Sname: Administrator</div>
<div>- Kerberos: TGS Request Realm: CONTOSO.COM Sname: Administrator
+ Length: Length = 2692
- TgsReq: Kerberos TGS Request
+ ApplicationTag:
- KdcReq: KRB_TGS_REQ (12)
+ SequenceHeader:
+ Tag1:
+ Pvno: 5
+ Tag2:
+ MsgType: KRB_TGS_REQ (12)
+ Tag3:
- PaData:
+ SequenceOfHeader:
- PaData: PA-TGS-REQ (1)
+ SequenceHeader:
+ Tag1:
+ PaDataType: PA-TGS-REQ (1)
+ Tag2:
+ OctetStringHeader:
- KrbApReq: KRB_AP_REQ (14)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REQ (14)
+ Tag2: 0x1
+ ApOptions:
+ Tag3:
+ Ticket: Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM
+ Tag4:
+ Authenticator:
+ PaData: PA-PAC-OPTIONS (167)
+ Tag4:
- ReqBody:
+ SequenceHeader:
+ Tag0:
- KdcOptions: 0x40810008
+ KerberosFlagsHeader:
+ Padding:
- KrbFlags: 0x40810008
Reserved:              (0...............................)
Forwardable:           (.1..............................) Ticket to be issued is to have its FORWARDABLE flag set
Forwarded:             (..0.............................) This is not a request for forwarding
Proxiable:             (...0............................) Ticket to be issued is not to have its PROXIABLE flag set
Proxy:                 (....0...........................) This is not a request for a proxy
AllowPostDate:         (.....0..........................) Ticket to be issued is not to have its MAY_POSTDATE flag set
PostDated:             (......0.........................) This is not a request for a postdated ticket
Unused7:               (.......0........................)
Renewable:             (........1.......................) Ticket to be issued is to have its RENEWABLE flag set
Unused9:               (.........0......................)
Unused10:              (..........0.....................)
OptHardwareAuth:       (...........0....................)
Unused12:              (............0...................)
Unused13:              (.............0..................)
CnameInAddlTkt:        (..............0.................) This is not a request for S4U2proxy functionality
Canonicalize:          (...............1................)
Unused16:              (................0000000000......)
DisableTransitedCheck: (..........................0.....) Checking of the transited field is enabled
RenewableOk:           (...........................0....) Renewable ticket is not acceptable
EncTktInSkey:          (............................1...) Indicates that the ticket for the end server is to be encrypted in the session key from the additional TGT provided
Unused29:              (.............................0..)
Renew:                 (..............................0.) Present request is not for a renewal
Validate:              (...............................0) Request is not to validate a postdated ticket
+ Tag2: 0x1
+ Realm: CONTOSO.COM
+ Tag3:
+ Sname: Administrator
+ Tag5: 0x1
+ Till: 09/13/2037 02:48:05 UTC
+ Tag7:
+ Nonce: 1181218830 (0x4667F80E)
+ Tag8:
+ Etype:
+ TagA:
+ EncAuthorizationData:
+ TagB:
- AdditionalTickets:
+ SequenceOfHeader:
- Ticket: Realm: CONTOSO.COM, Sname: krbtgt/CONTOSO.COM
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO.COM
+ Tag2: 0x1
+ Sname: krbtgt/CONTOSO.COM
+ Tag3: 0x1
+ EncPart:</div>
<div></div>
<div>KerberosV5:TGS Response Cname: myuser01</div>
<div>- Kerberos: TGS Response Cname: myuser01
+ Length: Length = 1528
- TgsRep: Kerberos TGS Response
+ ApplicationTag:
- KdcRep: KRB_TGS_REP (13)
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_TGS_REP (13)
+ Tag3:
+ Crealm: CONTOSO.COM
+ Tag4:
+ Cname: myuser01
+ Tag5:
- Ticket: Realm: CONTOSO.COM, Sname: Administrator
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO.COM
+ Tag2: 0x1
+ Sname: Administrator
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag2:
+ Cipher: ©lELY³’Ç·ÝÁò·¸@»^_”@}?WSÀ|hÖ÷FÃrÑ«g†á†ü%º÷ ¢$ÌÿSÖŸ?×íEïB£_†¤tólëÄU
+ Tag6:
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag2:
+ Cipher: À{ÙcBØP}½§WcæT%3×„·îç”mù×v-=Y¹A%1Âšãˆr_·âh</div>
<div></div>
<div>the client does the AP exchange of Kerberos token with the server, and indicates in the APOptions USE-SESSION-KEY flag that the ticket is encrypted with the session key from the server's TGT.</div>
<div></div>
<div>- MSRPC: c/o Alter Cont: unknown  UUID{00000001-0000-0000-C000-000000000046}  Call=0x2
- AlterContext:
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0E - Alter Context
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 1659 (0x67B)
AuthLength: 1579 (0x62B)
CallId: 2 (0x2)
MaxXmitFrag: ignored
MaxRecvFrag: ignored
AssocGroupId: ignored
+ PContextElem:
- AuthVerifier: 0x1
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: unused (0)
- KerberosToken: unused (0)
- Kerberos: AP Request Ticket[Realm: CONTOSO.COM, Sname: Administrator]
- ApReq: KRB_AP_REQ (14)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REQ (14)
+ Tag2: 0x1
- ApOptions:
+ KerberosFlagsHeader:
+ Padding:
- KrbFlags: 0x60000000
Reserved:       (0...............................)
UseSessionKey:  (.1..............................)
MutualRequired: (..1.............................)
Unused:         (...00000000000000000000000000000)
+ Tag3:
- Ticket: Realm: CONTOSO.COM, Sname: Administrator
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ TktVno: 5
+ Tag1:
+ Realm: CONTOSO.COM
+ Tag2: 0x1
+ Sname: Administrator
+ Tag3: 0x1
- EncPart:
+ SequenceHeader:
+ Tag0:
+ EType: aes256-cts-hmac-sha1-96 (18)
+ Tag2:
+ Cipher: ©lELY³’Ç·ÝÁò·¸@»^_”@}?WSÀ|hÖ÷FÃrÑ«g†á†ü%º÷ ¢$ÌÿSÖŸ?×íEïB£_†¤tólëÄU
+ Tag4:
+ Authenticator:</div>
<div></div>
<div>Because MUTUAL-REQUIRED flag was set in AP-Options, the server includes KRB-AP-REP in its response.</div>
<div>- MSRPC: c/o Alter Cont Resp: unknown UUID{00000001-0000-0000-C000-000000000046} Call=0x2  Assoc Grp=0x55A4AC30  Xmit=0x16D0  Recv=0x16D0
- AlterContextResponse:
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0F - Alter Context Resp
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 216 (0xD8)
AuthLength: 152 (0x98)
CallId: 2 (0x2)
MaxXmitFrag: ignored
MaxRecvFrag: ignored
AssocGroupId: ignored
+ SecAddr:
+ Pad2: 0x1
+ PResultList:
- AuthVerifier:
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: KRB_AP_REP (15)
- KerberosToken: KRB_AP_REP (15)
- Kerberos: AP Response
- ApRep: KRB_AP_REP (15)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REP (15)
+ Tag2: 0x1
- AuthorizationData:
+ SequenceHeader:
+ Tag0:
+ EType: rc4-hmac (23)
+ Tag2:
+ Cipher: Uàs5˜3(,S
¥Ç×Ñ•Kìd/aò---------------Ã/}¦Œ«—ƒm–„Fzº4@¬q1[«u,OCÿ¦ÇŠ}µ˜?D¸j¹šÚÜ|!»[ç¤|/öon‡ˆ=i+ï†(šPpãúN….¼wÈ†‚™vºÉWõ</div>
<div></div>
<div>- MSRPC: c/o Alter Cont: unknown  UUID{00000001-0000-0000-C000-000000000046}  Call=0x2
- AlterContext:
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0E - Alter Context
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 216 (0xD8)
AuthLength: 136 (0x88)
CallId: 2 (0x2)
MaxXmitFrag: ignored
MaxRecvFrag: ignored
AssocGroupId: ignored
+ PContextElem:
- AuthVerifier: 0x1
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-incomplete (1)
+ Tag2:
+ OctetStringHeader:
- ResponseToken: KRB_AP_REP (15)
- KerberosToken: KRB_AP_REP (15)
- Kerberos: AP Response
- ApRep: KRB_AP_REP (15)
+ ApplicationTag:
+ SequenceHeader:
+ Tag0:
+ PvNo: 5
+ Tag1:
+ MsgType: KRB_AP_REP (15)
+ Tag2: 0x1
- AuthorizationData:
+ SequenceHeader:
+ Tag0:
+ EType: rc4-hmac (23)
+ Tag2:
+ Cipher: ówûdf__ÇßMk†¦;N”ß³“ºãu:ïýVwhû™F0ÔuDš&gt;©×¤‡Ÿ7@Pü¤º8MÚ­Ü 4H
+ Tag3:
+ OctetStringHeader:
- MechListMic: KRB_AP_REP (15)
- KerberosToken: KRB_AP_REP (15)
TokId: GSS_GetMIC (0x404)
- Krb5GssV2GetMic:
+ Flags: 4 (0x4)
Filler: Binary Large Object (5 Bytes)
SndSeq: 1181218827 (0x4667F80B)
SgnCksum: Binary Large Object (12 Bytes)</div>
<div></div>
<div>- MSRPC: c/o Alter Cont Resp: unknown UUID{00000001-0000-0000-C000-000000000046} Call=0x2  Assoc Grp=0x55A4AC30  Xmit=0x16D0  Recv=0x16D0
- AlterContextResponse:
RpcVers: 5 (0x5)
RpcVersMinor: 0 (0x0)
PType: 0x0F - Alter Context Resp
+ PfcFlags: 7 (0x7)
+ PackedDrep: 0x10
FragLength: 105 (0x69)
AuthLength: 41 (0x29)
CallId: 2 (0x2)
MaxXmitFrag: ignored
MaxRecvFrag: ignored
AssocGroupId: ignored
+ SecAddr:
+ Pad2: 0x1
+ PResultList:
- AuthVerifier:
AuthType: RPC_C_AUTHN_GSS_NEGOTIATE - The Simple and Protected GSS-API Negotiation (SPNEGO) mechanism selects either NT LAN Manager (NTLM) or Kerberos authentication.
AuthLevel: dce_c_authn_level_pkt_integrity - This level offers the dce_c_authn_level_pkt services plus per-PDU modification and deletion detection.
AuthPadLength: 0 (0x0)
AuthReserved: 0 (0x0)
AuthContextId: 0 (0x0)
- AuthValue:
- GssApi:
- NegotiationToken:
+ ChoiceTag:
- NegTokenResp:
+ SequenceHeader:
+ Tag0:
+ NegState: accept-completed (0)
+ Tag3:
+ OctetStringHeader:
- MechListMic: unused (0)
- KerberosToken: unused (0)
TokId: GSS_GetMIC (0x404)
- Krb5GssV2GetMic:
+ Flags: 5 (0x5)
Filler: Binary Large Object (5 Bytes)
SndSeq: 1096155632 (0x415601F0)
SgnCksum: Binary Large Object (12 Bytes)</div>
<h1>References</h1>
<div>[RFC4120] The Kerberos Network Authentication Service (V5)
https://tools.ietf.org/rfc/rfc4120.txt
[U2UDraft] User to User Kerberos Authentication using GSS-API
https://tools.ietf.org/html/draft-swift-win2k-krb-user2user-03
[RFC2743] "Generic Security Service Application Program Interface Version 2, Update 1"
https://tools.ietf.org/rfc/rfc2743.txt
[MS-CSSP]: Credential Security Support Provider (CredSSP) Protocol
https://msdn.microsoft.com/en-us/library/cc226764.aspx
[MS-SPNG]: Simple and Protected GSS-API Negotiation Mechanism (SPNEGO) Extension
https://msdn.microsoft.com/en-us/library/cc247021.aspx
[MS-RA]: Remote Assistance Protocol
https://msdn.microsoft.com/en-us/library/cc240013.aspx
[MS-PKCA]: Public Key Cryptography for Initial Authentication (PKINIT) in Kerberos Protocol
https://msdn.microsoft.com/en-us/library/cc238455.aspx
[PKU2U] Introducing PKU2U in Windows
https://technet.microsoft.com/en-us/library/dd560634(v=ws.10).aspx
[MS-SFU]: Kerberos Protocol Extensions: Service for User and Constrained Delegation Protocol
https://msdn.microsoft.com/en-us/library/cc246071.aspx</div>
<div></div>]]></content:encoded>
    </item>
    <item>
      <title>Verifying STUN Message Integrity for Lync and Skype for Business ICE Traffic</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/verifying-stun-message-integrity-for-lync-and-skype-for-business-ice-traffic</link>
      <pubDate>Tue, 23 Feb 2016 11:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Tom Jebo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2016/02/23/verifying-stun-message-integrity-for-lync-and-skype-for-business-ice-traffic/</guid>
      <description><![CDATA[Verifying STUN Message Integrity for Lync and Skype for Business ICE Traffic
&nbsp;
Recently there...]]></description>
      <content:encoded><![CDATA[<h2>Verifying STUN Message Integrity for Lync and Skype for Business ICE Traffic</h2>
<p>&nbsp;</p>
<p>Recently there have been some inquiries about how to verify the integrity of messages in STUN protocol conversations when used by Lync and Skype for Business.&nbsp; In this blog post, I will describe a common scenario based on a recent customer inquiry and explain how it was resolved.</p>
<h3>Background</h3>
<p>Interactive Connectivity Establishment (ICE)<sup>1</sup> is a protocol that allows endpoints to create a media based connection across multiple networks where NAT is used.&nbsp; ICE makes use of STUN<sup>2</sup> (Simple Traversal of UDP through NAT) and TURN<sup>3 </sup>(Traversal Using Relay NAT), two solutions to finding the internal addresses of remote endpoints when NAT is involved. Also useful in this discussion is the fact that the Open<br />Specifications include Microsoft&rsquo;s extensions to ICE, namely the [MS-ICE], [MS-ICE2] and [MS-ICE2BWM] documents. We will reference [MS-ICE2]<sup>4 </sup>in this discussion. <strong></strong></p>
<p>&nbsp;</p>
<h3>Scenario</h3>
<p>In this scenario, two Lync endpoints have established a connection via the ICE protocol and are in the process of connectivity checks per STUN. As part of the Binding Request message, an attribute is included called the MESSAGE-INTEGRITY. This contains an HMAC-SHA1<sup>5</sup> hash of the message called an HMAC.</p>
<p>In the network trace for this scenario, the STUN Binding Requests are being sent, having already shared the temporary username and password in previous Shared Secret Request.</p>
<p>Figure 1 MESSAGE-INTEGRITY Attribute</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/7827.message-integrityattribute.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/7827.message_2D00_integrityattribute.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/7827.message-integrityattribute.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/7827.message_2D00_integrityattribute.png" alt="" width="595" height="505" border="0" /></a></p>
<p>The calculation of the MESSAGE-INTEGRITY attribute is described in section 10.2.8 of the referenced STUN RFC. The HMAC-SHA1represents a hash of the message up to but not including the MESSAGE-INTEGRITY attribute itself.</p>
<p>To manually test this out, you can compute an HMAC using the jsSHA<sup>6</sup> tool. Following the description in STUN 10.2.8, an overview of the steps:</p>
<ol>
<li>Copy the message data from your network analysis tool as a hex stream from the beginning of the STUN Binding Request message to just before the MESSAGE-INTEGRITY attribute. Insert this into the &ldquo;Input Text:&rdquo; field of the HMAC Demo section in the jsSHA tool. Remember to pad the text with 0&rsquo;s to make up the 64-byte multiple length. Set the Input Type to HEX</li>
<li>Provide the Key from the previous Shared Secret Request (not included in this explanation)</li>
<li>Set the Key Type to TEXT</li>
<li>SHA Variant should be SHA-1 and Output Type should be HEX</li>
</ol>
<p>The resulting Output Hash field will update automatically and should match the value in the MESSAGE-INTEGRITY attribute.</p>
<p>In the above shown packet in figure 1, the text used to compute the HMAC is:</p>
<p>0x0000 000100542112A442</p>
<p>0x0008 BEEBD6F17710B6A1</p>
<p>0x0010 B6A92CBD0006000C</p>
<p>0x0018 764F614D3A667641</p>
<p>0x0020 7300000000240004</p>
<p>0x0028 6EFFFEFF80290008</p>
<p>0x0030 000000000001E6E4</p>
<p>0x0038 8054000431000000</p>
<p>0x0040 8070000400000002&nbsp;&lt;= stop just before the MESSAGE-INTEGRITY attribute</p>
<p>0x0048 0000000000000000&nbsp;&lt;= added 56 bytes of 0&rsquo;s from here to the end</p>
<p>0x0050 0000000000000000</p>
<p>0x0058 0000000000000000</p>
<p>0x0060 0000000000000000</p>
<p>0x0068 0000000000000000</p>
<p>0x0070 0000000000000000</p>
<p>0x0078 0000000000000000</p>
<p>The total length of this is 0x80 hex or 128 bytes. The key from the Shared Secret Request for this conversation was:</p>
<p><strong>ydYldnHIRgbOUr1MYUGy4t0g</strong></p>
<p>Given this data and the steps above, you can even verify the resulting HMAC yourself by using the jsSHA tool. What you should see as a result is:&nbsp;</p>
<p><strong>b87d4d8d56fc76794667aacae3593e58e1dbfe97<br /></strong></p>
<p>which matches the one in your trace.</p>
<p>However, in the customer scenario, for them it wasn&rsquo;t matching.</p>
<h3>Problem and Resolution</h3>
<p>The problem in this scenario was that the MESSAGE-INTEGRITY HMAC hash value was not comparing correctly with the value computed using the shared key and message data.</p>
<p>The customer in this scenario was following the newer STUN draft RFC (https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-08#section-14.4) which adds some verbiage to the message integrity validation process, specifically:</p>
<p>&nbsp;</p>
<p>&ldquo;Based on the rules above, the hash includes the length field from the STUN message header.&nbsp; This length indicates the length of the entire&nbsp;message, including the MESSAGE-INTEGRITY attribute itself.&nbsp; Consequently, the MESSAGE-INTEGRITY attribute MUST be inserted into the message (with dummy content) prior to the computation of the integrity check.&nbsp; Once the computation is performed, the value of the attribute can be filled in.&nbsp; This ensures the length has the correct&nbsp;value when the hash is performed.&nbsp; Similarly, when validating the MESSAGE-INTEGRITY, the length field should be adjusted to point to the end of the MESSAGE-INTEGRITY attribute prior to calculating the HMAC.&nbsp; Such adjustment is necessary when attributes, such as&nbsp;FINTERPRINT, appear after MESSAGE-INTEGRITY.&rdquo;</p>
<p>This is not in the old (obsoleted) STUN RFC (<a href="https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-02#section-10.2.8">https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-02#section-10.2.8</a>). The problem is that the Lync processing is using the older RFC for the MESSAGE-INTEGRITY attribute and doesn&rsquo;t include specifically the modification of the length in the message header before calculating the HMAC. The [MS-ICE2] open specification does reference the correct STUN RFC (i.e. the old one) in 2.2.2 but references (indirectly via ICE/NAT RFC<sup>1</sup> ) the newer one in 3.1.4.8.2.4 where it speaks directly about calculating the MESSAGE-INTEGRITY attribute. &nbsp;</p>
<p>So, the only change to make to get the correct result, was to stop modifying the length field in the message header before calculating the HMAC.</p>
<p>The main take away from this exercise is that Lync uses the original STUN RFC for MESSAGE-INTEGRITY. &nbsp;It&rsquo;s important to take note of the references provided in the Microsoft Open Specifications when parsing or coding to a protocol that is used by a Microsoft product. In this case [MS-ICE2] was misleading as it referred to the older STUN in 2.2.2 and the newer one (indirectly) in 3.1.4.8.2.4.</p>
<h3>References</h3>
<ol>
<li>ICE: <a href="https://tools.ietf.org/html/draft-ietf-mmusic-ice-19">https://tools.ietf.org/html/draft-ietf-mmusic-ice-19</a></li>
<li>STUN: <a href="https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-02">https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-02</a></li>
<li>New STUN: <a href="https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-08">https://tools.ietf.org/html/draft-ietf-behave-rfc3489bis-08</a></li>
<li>TURN: <a href="https://tools.ietf.org/html/draft-rosenberg-midcom-turn-08">https://tools.ietf.org/html/draft-rosenberg-midcom-turn-08</a></li>
<li>[MS-ICE2]: <a href="https://msdn.microsoft.com/en-us/library/dd907518(v=office.12).aspx">https://msdn.microsoft.com/en-us/library/dd907518(v=office.12).aspx</a></li>
<li>HMAC-SHA1: <a href="https://tools.ietf.org/html/rfc2104">https://tools.ietf.org/html/rfc2104</a></li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>OpenXML Styles 101 - Understanding Table Style Conditional Formatting</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/openxml-styles-101-understanding-table-style-conditional-formatting</link>
      <pubDate>Fri, 06 Nov 2015 10:16:00 GMT</pubDate>
      <dc:creator><![CDATA[JCurry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2015/11/06/openxml-styles-101-understanding-table-style-conditional-formatting/</guid>
      <description><![CDATA[IntroductionThis is the second in a series of articles covering various OpenXML topics. This article...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: large;">Introduction</span><br />This is the second in a series of articles covering various OpenXML topics. This article provides an example of creating some simple table styles that use conditional formatting, the pitfalls that you would probably encounter, and how to get the results you're expecting. We will be using an example created in Microsoft Word 2016 and then manually modifying the package contents.&nbsp;</p>
<p>By simply reading through this blog you should be able to grasp how to manually create your own custom table styles with conditional formatting. However, nothing beats getting some actual hands-on experience. I highly encourage you to perform the steps as they are presented here and experiment on your own.</p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Resources</span><br />This article will refer to information contained in <a href="https://aka.ms/xfxu1y" target="_blank">ISO/IEC 29500-1</a> and a few other documents as necessary. The latest version of <a href="https://aka.ms/xfxu1y" target="_blank">ISO/IEC 29500-1</a>, as of this article's release date, was published in September of 2012 and can be downloaded from the following location.</p>
<p><a href="https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html" target="_blank">https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html</a></p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Getting Started</span><br />We will start by creating a very simple document that contains a table. Use the Insert -&gt; Table ribbon button and select the maximum size table from the UI (10x8). You don't have to make the table this large if you don't want to, but I find that having more rows and columns makes it easier to see the changes that we will be making. Your document should look something like this.</p>
<p><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/1882.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/1882.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/1882.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/547x163/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/1882.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small; color: #808080;">Figure 1: A new document containing an empty table.</span></em><br /><br />Save the document and then rename the file with a .zip extension.<br /><br /><span style="text-decoration: underline;"><strong>Note:</strong></span> It is assumed that you already understand that the .DOCX, .XLSX, and .PPTX file formats are actually special .ZIP packages that contain all of the XML files used to construct the document. <a href="https://aka.ms/xfxu1y" target="_blank">ISO/IEC 29500-1</a> section 9 contains a summary of the package format. <a href="https://aka.ms/izj3hu" target="_blank">ISO/IEC 29500-2</a> deals exclusively with the Open Packaging Conventions (OPC) format.</p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Examining the Package Contents</span><br />Once you have renamed the file to have a .zip extension, go ahead and extract the contents. Open the folder and then examine the contents of the "word" folder. The contents should look similar to this.</p>
<p><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4152.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4152.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4152.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/437x192/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4152.Untitled-picture.png" alt="" border="0" /></a><br /><span style="color: #808080;"><em><span style="font-size: x-small;">Figure 2: The contents of the "word" folder.</span></em></span><br /><br />The two files that we will be working with are <em>document.xml</em> and <em>styles.xml</em>. Go ahead and open the document.xml and styles.xml files in a basic text editor. The first thing you will notice is that the contents are one big blob of text without any kind of formatting unless you are using an application that was designed specifically for editing XML files. There are a few different ways to fix this, but if you are a Visual Studio user you can use the Edit -&gt; Advanced -&gt; Format Document command.<br /><br />We will only be concerned with a few lines from the document.xml file. We won't be doing anything to it right away so you just need to locate them for now.<br /><br /><span style="text-decoration: underline;"><em>document.xml</em></span><br /> <span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:tblPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:tblStyle w:val="TableGrid"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:tblW w:w="0" w:type="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" </span><span style="font-family: 'courier new', courier;">w:firstColumn="1" <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;w:lastColumn="0" </span><span style="font-family: 'courier new', courier;">w:noHBand="0" w:noVBand="1"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:tblPr&gt;</span><br /><br />Most of the work we will be doing is going to be in the styles.xml file. We will be making changes to the built-in TableGrid style. Currently, the style does not have any conditional formatting specified. We will add that in the next section.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:style w:type="table" w:styleId="TableGrid"&gt;</span><br /><span style="font-family: 'courier new', courier;"> <span>&nbsp; &nbsp; &nbsp;&nbsp;</span>&lt;w:name w:val="Table Grid"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:basedOn w:val="TableNormal"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:uiPriority w:val="39"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:rsid w:val="00131252"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;w:spacing w:after="0" w:line="240" w:lineRule="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;/w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:tblPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;w:tblBorders&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/w:tblBorders&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;/w:tblPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:style&gt;</span><br /><br /><span style="text-decoration: underline;"><strong>Note:</strong></span> If you have read my previous article, <a href="https://aka.ms/td3hbb" target="_blank">Creating Custom Styles and Understanding Style Inheritance</a>, you may have noticed that the TableGrid style is based on the TableNormal style. However, we will not be making any changes to the TableNormal style and we are not concerned with any of the settings from it. You may still want to take a look it in order to understand the entire style that is being applied to the table though.</p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Table Styles and Row Banding</span><br /><a href="https://aka.ms/xfxu1y" target="_blank">ISO/IEC 29500-1</a> section 17.7.6 and its related subsections contain the majority of the information that you need to know in order to be able to create table styles that use conditional formatting for things such as row and column banding. The element that you use to define the type of conditional formatting being applied is the tblStylePr element (section 17.7.6.6). For example, if we add the following to the TableGrid style it should add a shaded background to the odd numbered rows.</p>
<p><span style="font-family: 'courier new', courier;">&lt;w:tblStylePr w:type="band1Horz"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:tcPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:shd w:val="clear" w:color="auto" w:fill="AAAAAA" /&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:tcPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:tblStylePr&gt;</span><br /><br /><span style="text-decoration: underline;"><strong>Note:</strong></span> Add this block of XML either right after the rsid element or after the pPr element block. If you add it after the tblPr element block that contains the tblBorders it won't show up correctly.<br /><br />If you're following along and implementing this as you're reading through this article you are now probably wondering why the row banding doesn't seem to be working. I've intentionally left something out to illustrate a very important point when working with the ISO/IEC 29500 specification, which is that the Office products don't always behave according to the spec. <br /><br />The issue here deals with tblStyleRowBandSize which is described in section 17.7.6.7. This element allows you specify how many rows will be grouped into a single band when conditional formatting is applied. If you look at the TableGrid style you'll notice that this element is not defined, and per the spec <em>"If this element is omitted, then the default number of rows in a single row band shall be assumed to be 1."</em> So, it shouldn't be a problem, right? Unfortunately, that's not the case here.<br /><br />The lesson to learn from this is the following: When you encounter behavior that differs from, or seems to contradict the specification, it's probably because Word/Excel/PowerPoint is doing something different, which is exactly what is happening here. <br /><br />The document to look at that describes these differences is <a href="https://aka.ms/ysa9vs" target="_blank">MS-OI29500</a>. <a href="https://aka.ms/etuf5o" target="_blank">Section 2.1</a>, Normative Variations, contains almost 2,000 sections with information about how the Office implementations differ from what is described in ISO/IEC 29500. In this case, section <a href="https://aka.ms/y1osec" target="_blank">2.1.251</a> contains notes about how Word treats the tblStyleRowBandSize element and the first 2 items are what we care about.<br /><br /><em>a. The standard says the default for tblStyleRowBandSize is 1.</em><br /><em>&nbsp; &nbsp; &nbsp;Word uses 0 as the default for tblStyleRowBandSize.</em><br /> <br /><em>b. The standard does not specify the meaning if tblStyleRowBandSize is set to 0.</em><br /><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If tblStyleRowBandSize is set to 0, Word does not apply any banded row conditional formatting.</em><br /> <br />That should be self-explanatory. But if you're still not sure, it means that we need to add the tblStyleRowBandSize element to our style and give it a value of 1 or greater. Just to be safe, we should go ahead and add the tblStyleColBandSize element as well since it behaves exactly the same way. Once you add those the complete style should look similar to the following.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:style w:type="table" w:styleId="TableGrid"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:name w:val="Table Grid"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:basedOn w:val="TableNormal"/&gt;</span><br /><span style="font-family: 'courier new', courier;"> <span>&nbsp; &nbsp; &nbsp;&nbsp;</span>&lt;w:uiPriority w:val="39"/&gt;</span><br /><span style="font-family: 'courier new', courier;"> <span>&nbsp; &nbsp; &nbsp;&nbsp;</span>&lt;w:rsid w:val="00131252"/&gt;</span><br /><strong><span style="font-family: 'courier new', courier;"> &nbsp; &nbsp; &nbsp;&nbsp;&lt;w:tblStyleRowBandSize w:val="1"/&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;"> &nbsp; &nbsp; &nbsp;&nbsp;&lt;w:tblStyleColBandSize w:val="1"/&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;"> &nbsp; &nbsp; &nbsp;&nbsp;&lt;w:tblStylePr w:type="band1Horz"&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;w:tcPr&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:shd w:val="clear" w:color="auto" w:fill="AAAAAA" /&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/w:tcPr&gt;</span></strong><br /><strong><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;/w:tblStylePr&gt;</span></strong><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;w:spacing w:after="0" w:line="240" w:lineRule="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;/w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:tblPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;w:tblBorders&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/w:tblBorders&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;/w:tblPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:style&gt;</span><br /><br />Now when you open the document in Word it should look something like this.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/47848.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/47848.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/47848.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/539x160/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/47848.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small; color: #888888;">Figure 3: A table with odd row banding applied.</span></em></p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Column Banding</span><br />In addition to row banding you can add column bands as well. It works almost exactly the same way as row banding in that you just need to add a tblStylePr element with the right type and that's <em>almost</em> all there is to it. Let's add odd column banding and set it to a slightly lighter shade of gray.</p>
<p><span style="font-family: 'courier new', courier;">&lt;w:tblStylePr w:type="band1Vert"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:tcPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:shd w:val="clear" w:color="auto" w:fill="CCCCCC" /&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:tcPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:tblStylePr&gt;</span><br /><br />Once again, if you're following along and testing each change we make you're probably wondering why the column banding isn't showing up. This is where we need to go back and look at the line from the document.xml file that looked like this.<br /><br /><span style="font-family: 'courier new', courier;">&lt;w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/&gt;</span><br /><br />The details about this element are in section 17.4.55. But if you examine the values for the different attributes in the line above the problem should jump out at you. The noVBand attribute is set to 1, or true. This means that <em>"the vertical banding conditional formatting shall not be applied to the table."</em> The fix should be equally as obvious, setting noVBand to 0 (similar to noHBand) tells word to apply any conditional formatting for columns. The table should now look like this.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/3438.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/3438.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/3438.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/540x156/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/3438.Untitled-picture.png" alt="" border="0" /></a><br /><span style="font-size: x-small;"><em><span style="color: #888888;">Figure 4: A table with both row and column banding applied.</span></em></span></p>
<p>&nbsp;</p>
<p><span style="font-size: large;">One Last Thing</span><br />The last issue may not be obvious and it&rsquo;s likely that most people would never notice or even care, but it's something that you should be aware of. Did you notice how the column banding is overwriting the row banding? Regardless of whether or not that was the behavior you we're expecting, that's the result. But why? If we take a look at the description of how the different conditional formatting options are applied (section 17.7.6.6) we see that is tells us the following:</p>
<p><em>When specified, these conditional formats shall be applied in the following order (therefore subsequent formats override properties on previous formats):</em></p>
<ul>
<li><em>Whole table</em></li>
<li><strong><em>Banded columns, even column banding</em></strong></li>
<li><strong><em>Banded rows, even row banding</em></strong></li>
<li><em>First row, last row</em></li>
<li><em>First column, last column</em></li>
<li><em>Top left, top right, bottom left, bottom right</em></li>
</ul>
<p>The problem should be a little more clear at this point. According to the specification, row banding should be applied after column banding. So why do we see the opposite behavior? This is another one of those cases where Word behaves differently from the spec. As we did previously, we should look in <a href="https://aka.ms/ysa9vs" target="_blank">MS-OI29500</a> to see if has anything to say about this, and it does. Section <a href="https://aka.ms/fnop9q" target="_blank">2.1.250</a> is the entry for the tblStylePr element and it states the following:</p>
<p style="padding-left: 30px;"><em>a. The standard specifies the precedence order in which conditional formatting should be applied.</em><br /><em>&nbsp; &nbsp; &nbsp;When specified, Office applies conditional formats in the following order (therefore subsequent formats override properties on previous formats):</em></p>
<ul>
<ul>
<li><em>Whole table</em></li>
<li><strong><em>Banded rows, even row banding</em></strong></li>
<li><strong><em>Banded columns, even column banding</em></strong></li>
<li><em>First column, last column</em></li>
<li><em>First row, last row</em></li>
<li><em>Top left, top right, bottom left, bottom right</em></li>
</ul>
</ul>
<p>As you can see, Word actually applies the column banding after the row banding which is why the table looks the way it does.</p>
<p>&nbsp;</p>
<p><span style="font-size: large;">Summary</span><br />Thank you for taking the time to read through this article. I hope that you found it useful and that it may have answered a few questions you had on table styles or how conditional formatting works.&nbsp;</p>
<p>I encourage you to send any feedback or questions regarding this article, or any other Open XML related topics to Microsoft Interoperability Support at <a href="https://aka.ms/cwte8g" target="_blank">dochelp@microsoft.com</a> or post on the <a href="https://aka.ms/qx2zo9" target="_blank">Office XML, ODF, and Binary File Formats</a> forum on MSDN.</p>]]></content:encoded>
    </item>
    <item>
      <title>OpenXML Styles 101 - Creating Custom Styles and Understanding Style Inheritance</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/openxml-styles-101-creating-custom-styles-and-understanding-style-inheritance</link>
      <pubDate>Wed, 16 Sep 2015 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[JCurry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2015/09/16/openxml-styles-101-creating-custom-styles-and-understanding-style-inheritance/</guid>
      <description><![CDATA[IntroductionThis will be the first in a series of articles on various OpenXML topics. This article...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: large;">Introduction</span><br />This will be the first in a series of articles on various OpenXML topics. This article provides an expanded description of how Style Inheritance works. We will be using an example created in Microsoft Word 2016 and then manually modifying the package contents. <br /><br />By simply reading through this blog you should be able to grasp how to manually create your own custom styles and how to build more complex styles using Style Inheritance. However, nothing beats getting some actual hands-on experience. I highly encourage you to perform the steps as they are presented here and experiment on your own.<br /><br /><br /><span style="font-size: large;">Resources</span><br />This article will refer exclusively to information contained in <a title="https://aka.ms/sl6tli" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/ISO/IEC 29500-1" target="_blank">ISO/IEC 29500-1</a>. The latest version, as of this article's release date, was published in September of 2012 and can be downloaded from the following location.<br /><br /><a title="https://aka.ms/em8mad" href="https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html" target="_blank">https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html</a><br /><br /><br /><span style="font-size: large;">Getting Started</span><br />We will start by creating a very simple document that contains three paragraphs. The actual contents of the paragraphs isn't very important, but it makes it easier to identify each one in the XML if they are numbered on some way.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5076.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5076.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5076.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/342x158/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5076.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small;">Figure 1: Three paragraphs in the default style.</span></em><br /><br />Save the document and then rename the file with a .zip extension.<br /><br /><span style="text-decoration: underline;"><strong>Note:</strong></span> It is assumed that you already understand that the .DOCX, .XLSX, and .PPTX file formats are actually special .ZIP packages that contain all of the XML files used to construct the document. <a title="https://aka.ms/sl6tli" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/ISO/IEC 29500-1" target="_blank">ISO/IEC 29500-1</a> section 9 contains a summary of the package format. <a title="https://aka.ms/bgdzkr" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/ISO/IEC 29500-2" target="_blank">ISO/IEC 29500-2</a> deals exclusively with the Open Packaging Conventions (OPC) format.<br /><br /><br /><span style="font-size: large;">Examining the Package Contents</span><br />Once you have renamed the file to have a .zip extension, go ahead and extract the contents. Open the folder and then examine the contents of the "word" folder. The contents should look similar to this.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5732.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5732.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5732.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/497x194/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5732.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small;">Figure 2: The contents of the "word" folder.</span></em><br /><br />The two files that we will be working with are document.xml and styles.xml. Go ahead and open the document.xml and styles.xml files in a basic text editor. The first thing you will notice is that the contents are one big blob of text without any kind of formatting unless you are using an application that was designed specifically for editing XML files. There are a few different ways to fix this, but if you are a Visual Studio user you can use the Edit -&gt; Advanced -&gt; Format Document command. <br /><br />The section of the document.xml file that we will be working with is in the middle that has our three paragraphs.<br /><br /><span style="text-decoration: underline;"><em>document.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="00BA6E33" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 1&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="009A7F68" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 2&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="009A7F68" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 3&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:bookmarkStart w:id="0" w:name="_GoBack"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:bookmarkEnd w:id="0"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><br />There isn't anything in the styles.xml file that we really care about right now. The only thing worth taking note of is the "Normal" style near the bottom of the file.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:style w:type="paragraph" w:default="1" w:styleId="Normal"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:name w:val="Normal"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:qFormat/&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:style&gt;</span><br /><br /><br /><span style="font-size: large;">Creating a New Style</span><br />Additional details on the style element can be found in <a title="https://aka.ms/sl6tli" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/ISO/IEC 29500-1" target="_blank">ISO/IEC 29500-1</a> section 17.7.4.17. For now, we will create a very simple style that is based on the Normal style, sets it to be Bold, and increases the font size.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:style w:type="paragraph" w:styleId="MyCustomStyle1"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:name w:val="My Custom Style 1"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:basedOn w:val="Normal"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:sz w:val="32"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:b w:val="true"/&gt;0</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:style&gt;</span><br /><br />Next, we will assign this style to the first paragraph of our document.<br /><br /><span style="text-decoration: underline;"><em>document.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="00BA6E33" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:pStyle w:val="MyCustomStyle1"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 1&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><br />After you make those changes and save the files you will need to update the package contents. It's important to understand that you can't just re-zip the main folder and put a .docx extension on it. It will be missing all of the metadata. The best way to update the package contents is to overwrite the existing files in the original .zip package with the updated ones and then rename back to the .docx extension. After you do that and open the file it Word it should look like this.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4174.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4174.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4174.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/363x163/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4174.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small;">Figure 3: MyCustomStyle1 applied to the first paragraph.</span></em><br /><br /><br /><span style="font-size: large;">Inheriting From a Custom Style</span><br />For the second paragraph lets create a new style that inherits from the one used in the first paragraph. We will add a new element and change an existing one to demonstrate how the style at the leaf level overrides the style(s) further up the inheritance tree.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:style w:type="paragraph" w:styleId="MyCustomStyle2"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:name w:val="My Custom Style 2"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:basedOn w:val="MyCustomStyle1"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:b w:val="false"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:color w:val="FF0000"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:style&gt;</span><br /><br />And assign the new style to the second paragraph&hellip;<br /><br /><span style="text-decoration: underline;"><em>document.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="009A7F68" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:pStyle w:val="MyCustomStyle2"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 2&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><br />Update the package contents again and let's take a look at the result.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/8816.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/8816.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/8816.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/372x161/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/8816.Untitled-picture.png" alt="" border="0" /></a><br /><br /><em><span style="font-size: x-small;">Figure 4: MyCustomStyle2 applied to the second paragraph</span></em><br /><br />As you can see the text in the second paragraph is still 16pt in size which was inherited from MyCustomStyle1, is no longer bold, and is now red.<br /><br /><br /><span style="font-size: large;">Overwriting Everything</span><br />Regardless of what is inherited from previous styles in the tree, it is possible to simply overwrite everything. There is no real practical use for this. Creating a new style that doesn't inherit from another style is probably a better choice and will give the same results, but we are doing this for demonstration purposes. Here is a third style that inherits from the second style that overwrites each property set previously.<br /><br /><span style="text-decoration: underline;"><em>styles.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:style w:type="paragraph" w:styleId="MyCustomStyle3"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:name w:val="My Custom Style 3"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:basedOn w:val="MyCustomStyle2"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:sz w:val="64"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:b w:val="true"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:color w:val="0000FF"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:rPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:style&gt;</span><br /><br />And apply it to the third paragraph&hellip;<br /><br /><span style="text-decoration: underline;"><em>document.xml</em></span><br /><span style="font-family: 'courier new', courier;">&lt;w:p w:rsidR="009A7F68" w:rsidRDefault="009A7F68"&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:pStyle w:val="MyCustomStyle3"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:pPr&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp; &nbsp; &lt;w:t&gt;Paragraph 3&lt;/w:t&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;/w:r&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:bookmarkStart w:id="0" w:name="_GoBack"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;w:bookmarkEnd w:id="0"/&gt;</span><br /><span style="font-family: 'courier new', courier;">&lt;/w:p&gt;</span><br /><br />And take a look at the result.<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/1581.Untitled%20picture.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/1581.Untitled-picture.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/1581.Untitled%20picture.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/364x198/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/1581.Untitled-picture.png" alt="" border="0" /></a><br /><em><span style="font-size: x-small;">Figure 5: MyCustomStyle3 applied to the third paragraph.</span></em><br /><br />As you can see the font size is now set to 32pt, bold has been turned on again, and the text is blue.<br /><br /><br /><span style="font-size: large;">Summary</span><br />Thank you for taking the time to read through this article. This was a simple introduction to how Style Inheritance works in Open XML. I hope that this was useful for you and answered any questions that you may have had on the subject. In future articles we will dig deeper into styles and explore other topics such as the Style Hierarchy, Linked Styles, and more. <br /><br />I encourage you to send you feedback or questions regarding this article, or any other Open XML related topics to Microsoft Interoperability Support at <a title="mailto:dochelp@microsoft.com" href="mailto:dochelp@microsoft.com">dochelp@microsoft.com</a> or posted on the Office XML, ODF, and Binary File Formats forum on MSDN.</p>]]></content:encoded>
    </item>
    <item>
      <title>MS-OXCFXICS - How to parse the FastTransfer Stream</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/ms-oxcfxics-how-to-parse-the-fasttransfer-stream</link>
      <pubDate>Wed, 16 Sep 2015 11:59:00 GMT</pubDate>
      <dc:creator><![CDATA[JCurry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2015/09/16/ms-oxcfxics-how-to-parse-the-fasttransfer-stream/</guid>
      <description><![CDATA[Note: This article was written using version 16.2 (10/30/2014) of the MS-OXCFXICS document as...]]></description>
      <content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>Note:</strong></span> This article was written using version 16.2 (10/30/2014) of the <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> document as reference and all links contained in this article reference sections of that version of the document. The current version of the MS-OXCFXICS document can be found here: <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx</a><br /><br /><br /><span style="font-size: large;">Resources:</span></p>
<ul>
<li>
<p><a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/[MS-OXCFXICS]" target="_blank">[MS-OXCFXICS]</a> - Bulk Data Transfer Protocol</p>
</li>
<li>
<p><a title="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/[MS-OXPROPS]" target="_blank">[MS-OXPROPS]</a> - Exchange Server Protocols Master Property List</p>
</li>
<li>
<p><a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/[MS-OXCDATA]" target="_blank">[MS-OXCDATA]</a> - Data Structures</p>
</li>
</ul>
<p><br /><span style="font-size: large;">Introduction:</span><br />The <a title="https://msdn.microsoft.com/en-us/library/ee160399(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/FastTransfer Stream" target="_blank">FastTransfer Stream</a> as described in <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> section <a title="https://msdn.microsoft.com/en-us/library/ee160399(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.4" target="_blank">2.2.4</a> and its related subsections can be an intimidating adversary if you are trying to implement a mail client or server that uses RPC as its primary method of communication (as opposed to ActiveSync or Exchange Web Services). The important thing to understand is that it is nothing more than a serialized collection of markers, properties, and values.<br /><br /><br /><span style="font-size: large;">Sample Data:</span><br />The following sample data is the first part of a much larger stream of bytes. However, for the purposes of this article, it contains enough different property types to give you a good idea of how it all works.<br /><br /><span style="font-family: 'courier new', courier;">0x0000: | 03 00 12 40 02 01 E1 65 00 00 00 00 02 01 E0 65 </span><br /><span style="font-family: 'courier new', courier;">0x0010: | 16 00 00 00 52 F6 85 EC 7D 43 2E 4A A9 60 34 50 </span><br /><span style="font-family: 'courier new', courier;">0x0020: | 88 53 D9 0A 00 00 00 00 03 F5 40 00 08 30 00 D0 </span><br /><span style="font-family: 'courier new', courier;">0x0030: | 9E A8 81 85 D0 01 02 01 E2 65 16 00 00 00 52 F6 </span><br /><span style="font-family: 'courier new', courier;">0x0040: | 85 EC 7D 43 2E 4A A9 60 34 50 88 53 D9 0A 00 00 </span><br /><span style="font-family: 'courier new', courier;">0x0050: | 00 00 20 7C 02 01 E3 65 17 00 00 00 16 52 F6 85 </span><br /><span style="font-family: 'courier new', courier;">0x0060: | EC 7D 43 2E 4A A9 60 34 50 88 53 D9 0A 00 00 00 </span><br /><span style="font-family: 'courier new', courier;">0x0070: | 00 20 7C 1F 00 01 30 0C 00 00 00 49 00 4E 00 42 </span><br /><span style="font-family: 'courier new', courier;">0x0080: | 00 4F 00 58 00 00 00 14 00 49 67 01 00 00 00 00 </span><br /><span style="font-family: 'courier new', courier;">0x0090: | 00 03 F4 03 00 39 66 FB 03 00 00 40 00 07 30 80 </span><br /><span style="font-family: 'courier new', courier;">0x00A0: | 39 06 A8 81 85 D0 01 0B 00 F4 10 00 00</span><br /><br /><br /><span style="font-size: large;">Breaking it Down:</span><br />The Lexical Structure of the FastTransfer Stream might look complicated at first but we can summarize it as follows: <br /><br /></p>
<ol>
<li>The stream consists of elements.&nbsp;</li>
<li>Each element is either a marker or a propValue.&nbsp;</li>
<ol>
<li>If the element matches an entry from the table in section <a title="https://msdn.microsoft.com/en-us/library/ee220023(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.4.1.4" target="_blank">2.2.4.1.4</a>, it&rsquo;s a Marker. If not, it's a propValue.</li>
</ol>
<li>propValues are either fixed or variable length.</li>
<ol>
<li>The first 2 bytes of the propValue represent the data type. Reference <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.11.1" target="_blank">2.11.1</a> to find out what type it is and whether it's fixed or variable length.</li>
<ol>
<li>If it's fixed length, read the next x number of bytes as indicated by the type.</li>
<li>If it's variable length, follow the description provided to correctly read the value.</li>
</ol></ol></ol>
<p><br /><br /><span style="font-size: large;">Markers:</span><br />Markers are the easiest to understand and come in 2 types. They are either stand-alone, or consist of a pair of start and end markers. They are nothing more than a 4-byte value that tells you something about the properties that come after it in the stream (unless it's an end marker). Taking a look at our example data stream from above let's look at the first element and try to determine if it's a marker or a propValue.<br /><br /><span style="font-family: 'courier new', courier;">Element[0]:</span><br /><span style="font-family: 'courier new', courier;">0x0000: | <span style="background-color: #00ff00;">03 00 12 40</span> 02 01 E1 65 00 00 00 00 02 01 E0 65</span><br /><br />The value of the first element is <strong>0x40120003</strong> (remember that int32 type values are transmitted in little-endian format). From looking at the table in <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee220023(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.4.1.4" target="_blank">2.2.4.1.4</a> we can see that this represents the <strong>IncrSyncChange</strong> Marker which <em>"signifies the start of ICS information pertaining to the message."</em> That's all there is to it. Moving on&hellip;<br /><br /><br /><span style="font-size: large;">propValues:</span><br />If the element isn't a Marker (the element value is NOT in the table in <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> section <a title="https://msdn.microsoft.com/en-us/library/ee220023(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.4.1.4" target="_blank">2.2.4.1.4</a>), it's a propValue. There are 2 types of propValues, fixed and variable length. The table in <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.11.1" target="_blank">2.11.1</a> contains all of the possible types. The list is fairly long so I will only talk about the ones that appear in our sample data. Let's take a look at the first one&hellip;<br /><br /><span style="font-family: 'courier new', courier;">Element[1]:</span><br /><span style="font-family: 'courier new', courier;">0x0000: | 03 00 12 40 <span style="background-color: #00ff00;">02 01 E1 65</span> <span style="background-color: #00ccff;">00 00 00 00</span> 02 01 E0 65</span><br /><br />The element value is <strong>0x65E10102</strong>, which is not a Marker (check the table!), which means it's a propValue. There are 2 things that you need to do with this. First, look up the type in <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.11.1" target="_blank">2.11.1</a>. In this case, the type 0x0102 means that the property is a <strong>PtypBinary</strong>. According to the description, this type is "Variable size; a COUNT field followed by that many bytes." The COUNT field is 4 bytes in length and should be read as an integer, which in this case is the value <strong>0x00000000</strong>, or simply 0. This also means that this is the end of this propType. Because the COUNT value is 0, no bytes follow it that belong to this property. But what does the property represent? That's the second thing to do, look up the Property ID in <a title="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXPROPS" target="_blank">MS-OXPROPS</a>. In this case, the Property ID 0x65E1 belongs to the <strong>PidTagParentSourceKey</strong> property (section <a title="https://msdn.microsoft.com/en-us/library/ee159636(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.850" target="_blank">2.850</a>).<br /><br />Taking a look at the next element&hellip;<br /><br /><span style="font-family: 'courier new', courier;">Element[2]:</span><br /><span style="font-family: 'courier new', courier;">0x0000: | 03 00 12 40 02 01 E1 65 00 00 00 00 <span style="background-color: #00ff00;">02 01 E0 65</span></span><br /><span style="font-family: 'courier new', courier;">0x0010: | <span style="background-color: #00ccff;">16 00 00 00</span> <span style="background-color: #ffff00;">52 F6 85 EC 7D 43 2E 4A A9 60 34 50</span></span><br /><span style="font-family: 'courier new', courier;">0x0020: | <span style="background-color: #ffff00;">88 53 D9 0A 00 00 00 00 03 F5</span> 40 00 08 30 00 D0</span><br /><br />You can probably tell by how many bytes I've highlighted above that there is definitely more going on with this next one. Following the same process as before, get the element (0x65E00201) which is a propValue. This is also a PtypBinary type so you know that the next thing you have to do is get the COUNT, which in this case is 0x00000016, or 22 in decimal format. This tells us that the next 22 bytes should be read as a byte array. That's easy, but what does that data actually represent? Going into that much depth with each property would be beyond the scope of this article, but here's a hint: Look up the Property ID (0x65E0) in <a title="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXPROPS" target="_blank">MS-OXPROPS</a> (PidTagSourceKey) and then check the defining reference (<a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> section <a title="https://msdn.microsoft.com/en-us/library/ee220110(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.1.2.5" target="_blank">2.2.1.2.5</a>).<br /><br />Let's parse a few more propValues&hellip;<br /><br /><span style="font-family: 'courier new', courier;">Element[3]:</span><br /><span style="font-family: 'courier new', courier;">0x0020: | 88 53 D9 0A 00 00 00 00 03 F5 <span style="background-color: #00ff00;">40 00 08 30</span> <span style="background-color: #ffff00;">00 D0</span></span><br /><span style="font-family: 'courier new', courier;">0x0030: | <span style="background-color: #ffff00;">9E A8 81 85 D0 01</span> 02 01 E2 65 16 00 00 00 52 F6</span><br /><br />propValue: 0x30080040<br />Property type: 0x0040 - PtypTime<br />Property ID: 0x3008 - PidTagLastModificationTime<br />Value: 05/03/2015 09:15:12<br /><span style="text-decoration: underline;"><strong>Note:</strong></span> See <a title="https://msdn.microsoft.com/en-us/library/cc230273.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-DTYP" target="_blank">MS-DTYP</a> section <a title="https://msdn.microsoft.com/en-us/library/cc230324.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.3.3" target="_blank">2.3.3</a> on how to interpret this type of value.<br /><br /><br /><span style="font-family: 'courier new', courier;">Element[4]:</span><br /><span style="font-family: 'courier new', courier;">0x0030: | 9E A8 81 85 D0 01 <span style="background-color: #00ff00;">02 01 E2 65</span> <span style="background-color: #00ccff;">16 00 00 00</span> <span style="background-color: #ffff00;">52 F6</span></span><br /><span style="font-family: 'courier new', courier;">0x0040: | <span style="background-color: #ffff00;">85 EC 7D 43 2E 4A A9 60 34 50 88 53 D9 0A 00 00</span></span><br /><span style="font-family: 'courier new', courier;">0x0050: | <span style="background-color: #ffff00;">00 00 20 7C</span> 02 01 E3 65 17 00 00 00 16 52 F6 85</span><br /><br />propValue: 0x65E20102<br />Property type: 0x0102 - PtypBinary<br />Property ID: 0x65E2 - PidTagChangeKey<br />Value: See <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> section <a title="https://msdn.microsoft.com/en-us/library/ee178773(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.1.2.7" target="_blank">2.2.1.2.7</a><br /><br /><br /><span style="font-family: 'courier new', courier;">Element[5]:</span><br /><span style="font-family: 'courier new', courier;">0x0050: | 00 00 20 7C <span style="background-color: #00ff00;">02 01 E3 65</span> <span style="background-color: #00ccff;">17 00 00 00</span> <span style="background-color: #ffff00;">16 52 F6 85</span></span><br /><span style="font-family: 'courier new', courier;">0x0060: | <span style="background-color: #ffff00;">EC 7D 43 2E 4A A9 60 34 50 88 53 D9 0A 00 00 00</span></span><br /><span style="font-family: 'courier new', courier;">0x0070: | <span style="background-color: #ffff00;">00 20 7C</span> 1F 00 01 30 0C 00 00 00 49 00 4E 00 42</span><br /><br />propValue: 0x65E30102<br />Property type: 0x0102 - PtypBinary<br />Property ID: 0x65E3 - PidTagPredecessorChangeList<br />Value: See <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> section <a title="https://msdn.microsoft.com/en-us/library/ee202808(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.1.2.8" target="_blank">2.2.1.2.8</a><br /><br /><br /><span style="font-family: 'courier new', courier;">Element[6]:</span><br /><span style="font-family: 'courier new', courier;">0x0070: | 00 20 7C <span style="background-color: #00ff00;">1F 00 01 30</span> <span style="background-color: #00ccff;">0C 00 00 00</span> <span style="background-color: #ffff00;">49 00 4E 00 42</span></span><br /><span style="font-family: 'courier new', courier;">0x0080: | <span style="background-color: #ffff00;">00 4F 00 58 00 00 00</span> 14 00 49 67 01 00 00 00 00</span><br /><br />propValue: 0x3001001F<br />Property type: 0x001F - PtypString<br />Property ID: 0x3001 - PidTagDisplayName<br />Value: "INBOX"<br />Note: Per <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.11.1" target="_blank">2.11.1</a> this <em>"a string of Unicode characters in UTF-16LE format encoding with terminating null character (0x0000)."</em><br /><br /><br /><span style="font-family: 'courier new', courier;">Element[7]:</span><br /><span style="font-family: 'courier new', courier;">0x0080: | 00 4F 00 58 00 00 00 <span style="background-color: #00ff00;">14 00 49 67</span> <span style="background-color: #ffff00;">01 00 00 00 00 </span></span><br /><span style="font-family: 'courier new', courier;">0x0090: | <span style="background-color: #ffff00;">00 03 F4</span> 03 00 39 66 FB 03 00 00 40 00 07 30 80</span><br /><br />propValue: 0x67490014<br />Property type: 0x0014 - PtypInteger64<br />Property ID: 0x6749 - PidTagParentFolderId<br />Value: -863846703525003263<br /><br /><br /><span style="font-family: 'courier new', courier;">Element[8]:</span><br /><span style="font-family: 'courier new', courier;">0x0090: | 00 03 F4 <span style="background-color: #00ff00;">03 00 39 66</span> <span style="background-color: #ffff00;">FB 03 00 00</span> 40 00 07 30 80</span><br /><br />propValue: 0x66390003<br />Property type: 0x0003 - PtypInteger32<br />Property ID: 0x6639 - PidTagRights<br />Value: 0x000003FB<br /><span style="text-decoration: underline;"><strong>Note:</strong></span> See <a title="https://msdn.microsoft.com/en-us/library/cc463904(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCPERM" target="_blank">MS-OXCPERM</a> section <a title="https://msdn.microsoft.com/en-us/library/ee201699(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.7" target="_blank">2.2.7</a> on how to interpret these flags.<br /><br /><br /><span style="font-family: 'courier new', courier;">Element[9]:</span><br /><span style="font-family: 'courier new', courier;">0x0090: | 00 03 F4 03 00 39 66 FB 03 00 00 <span style="background-color: #00ff00;">40 00 07 30</span> <span style="background-color: #ffff00;">80</span></span><br /><span style="font-family: 'courier new', courier;">0x00A0: | <span style="background-color: #ffff00;">39 06 A8 81 85 D0 01</span> 0B 00 F4 10 00 00</span><br /><br />propValue: 0x30070040<br />Property type: 0x0040 - PtypTime<br />Property ID: 0x3007 - PidTagCreationTime<br />Value: 05/03/2015 09:15:11<br /><span style="text-decoration: underline;"><strong>Note:</strong></span> See <a title="https://msdn.microsoft.com/en-us/library/cc230273.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-DTYP" target="_blank">MS-DTYP</a> section <a title="https://msdn.microsoft.com/en-us/library/cc230324.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.3.3" target="_blank">2.3.3</a> on how to interpret this type of value.<br /><br /><br /><span style="font-family: 'courier new', courier;">Element[10]:</span><br /><span style="font-family: 'courier new', courier;">0x00A0: | 39 06 A8 81 85 D0 01 <span style="background-color: #00ff00;">0B 00 F4 10</span> <span style="background-color: #ffff00;">00 00</span></span><br /><br />propValue: 0x10F4000B<br />Property type: 0x000B - PtypBoolean<br />Property ID: 0x3007 - PidTagAttributeHidden<br />Value: 0x0000 (False)<br /><span style="text-decoration: underline;"><strong>Note</strong></span>: If you look at the table in <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCDATA" target="_blank">MS-OXCDATA</a> section <a title="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.11.1" target="_blank">2.11.1</a> you will see that the description for PtypBoolean states that it is <em>"1 byte; restricted to 1 or 0."</em> However, you can see that I have 2 bytes highlighted. This is because PtypBoolean is serialized differently than is described there. This difference is described in <a title="https://msdn.microsoft.com/en-us/library/cc463916(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/MS-OXCFXICS" target="_blank">MS-OXCFXICS</a> in section <a title="https://msdn.microsoft.com/en-us/library/ee201502(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/2.2.4.1.3" target="_blank">2.2.4.1.3</a> where it states that the PtypBoolean type is <em>"2-bytes in FastTransfer streams, instead of 1-byte as specified in <a title="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/[MS-OXCDATA]" target="_blank">[MS-OXCDATA]</a>. Using little-endian byte ordering, "01 00" for TRUE and "00 00" for FALSE."</em><br /><br /><br />I hope this helps you to understand how the Fast Transfer stream is serialized. Even though we only looked at a few of the elements in this stream, it should give you a good idea on how to proceed to parse a complete FastTransfer stream.</p>]]></content:encoded>
    </item>
    <item>
      <title>SMB 3.1.1 Encryption in Windows 10</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/smb-3-1-1-encryption-in-windows-10</link>
      <pubDate>Wed, 09 Sep 2015 13:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Edgar A Olougouna]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2015/09/09/smb-3-1-1-encryption-in-windows-10/</guid>
      <description><![CDATA[SMB 3 encryption offers data packet confidentiality and prevents an attacker from both tampering...]]></description>
      <content:encoded><![CDATA[<span style="font-size: small">SMB 3 encryption offers data packet confidentiality and prevents an attacker from both tampering with and eavesdropping on any data packet. Encryption has been enhanced in SMB 3.1.1. The cipher can now be negotiated during connection establishment. In addition to AES-128-CCM for SMB 3.0.x compatibility, Windows 10 (and Windows Server 2016) added AES-128-GCM in SMB 3.1.1. The GCM mode offers a significant performance gain. Both ciphers [RFC5084] provide authenticated encryption, i.e. message integrity (signing). This blog takes a protocol walk on the enhancement and provides sample test vectors. </span>
<span style="font-size: small">NOTE: This is written based on Windows 10, and Windows Server 2016 Technical Preview 3.</span>
<h2>Encryption capability negotiate context</h2>
<ul>
 	<li><span style="font-size: small">SMB 3.1.1 client and server negotiate encryption support via SMB2_ENCRYPTION_CAPABILITIES negotiate context in the NEGOTIATE request and response. </span></li>
 	<li><span style="font-size: small">The client advertises its list of supported cipher IDs in the order of most preferred encryption algorithm. Windows 10 implements cipher IDs 0x0002 (AES-128-GCM) and 0x0001 (AES-128-CCM). </span></li>
 	<li><span style="font-size: small">If the client sends 3.0.x in the dialect array and supports encryption, it must advertise the SMB2_GLOBAL_CAP_ENCRYPTION capability flag as well since it does not know yet what dialect the server supports.</span></li>
 	<li><span style="font-size: small">If the server selects dialect 3.1.1 and supports encryption, it responds with the encryption negotiate context. SMB2_GLOBAL_CAP_ENCRYPTION capability flag should not be set because it is valid for the SMB 3.0 and 3.0.2 dialects.</span></li>
 	<li><span style="font-size: small">The encryption capability negotiate context has the same format in the Negotiate request and response, except that the response context must have CipherCount set to 1, and the cipher ID that conveys the server’s selection. </span></li>
</ul>
<h2>Multichannel encryption</h2>
<ul>
 	<li><span style="font-size: small">Session binding (multichannel) requires that all channels bound to a given session negotiate the same encryption cipher as the master session’s connection.</span></li>
 	<li><span style="font-size: small">As in SMB 3.0.x, all SMB 3.1.1 channels (primary and alternate) bound to a given master session share the same encryption and decryption keys.</span></li>
 	<li><span style="font-size: small">The cipher ID is kept consistent as multichannel traffic can be spread across channels.</span></li>
</ul>
<h2>Server-wide or per-share encryption</h2>
<ul>
 	<li><span style="font-size: small">For a global level encryption, SessionSetup_response.SessionFlags includes SMB2_SESSION_FLAG_ENCRYPT_DATA. Encryption is enforced on the whole server.</span></li>
 	<li><span style="font-size: small">For a per-share level encryption, TreeConnect_response.ShareFlags includes SMB2_SHAREFLAG_ENCRYPT_DATA.</span></li>
 	<li><span style="font-size: small">If server-wide encryption is configured, share level encryption will not have any effect. This means, when global encryption is enabled, you cannot selectively disable encryption for certain shares.</span></li>
 	<li><span style="font-size: small">Encryption enforcement can be bypassed if “unencrypted access” is allowed. See RejectUnencryptedAccess.</span></li>
</ul>
<h2>Configuration</h2>
<span style="font-size: small">PowerShell cmdlets can be used to configure encryption on both Windows 10 and Windows Server 2016:</span>

<span style="font-size: small">Global level encryption on the server: </span>
<span style="font-size: small">Set-SmbServerConfiguration -EncryptData &lt;0|1&gt;</span>

<span style="font-size: small">Share level encryption: </span>
<span style="font-size: small">Set-SmbShare -Name &lt;share name&gt; -EncryptData &lt;0|1&gt;</span>
<span style="font-size: small">Share level encryption enabled at creation:</span>
<span style="font-size: small">New-SmbShare -Name &lt;share name&gt; -Path &lt;pathname&gt; -EncryptData 1</span>

<span style="font-size: small">Unencrypted access:</span>
<span style="font-size: small">Set-SmbServerConfiguration -RejectUnencryptedAccess &lt;0|1&gt;</span>
<span style="font-size: small">See notes in Section “Unencrypted access”.</span>
<h2>Encryption keys</h2>
<span style="font-size: small">Upon successful SessionSetup (Session.EncryptData), or successful TreeConnect (Share.EncryptData), the server and client generate EncryptionKey and DecryptionKey as specified in [MS-SMB2]. </span>
<span style="font-size: small">The key derivation in SMB 3.1.1 uses the same function as in SMB 3.0.x with new labels and context as follows. The context Session.PreauthIntegrityHashValue is derived from pre-authentication integrity hashing. The respective labels are shown in the following key formulas.</span>
<ul>
 	<li><span style="font-size: small">EncryptionKey (Client) = DecryptionKey (Server) = SMB3KDF (SessionKey, "SMBC2SCipherKey\0", Session.PreauthIntegrityHashValue)</span></li>
 	<li><span style="font-size: small">DecryptionKey (Client) = EncryptionKey (Server) = SMB3KDF ( SessionKey, "SMBS2CCipherKey\0", Session.PreauthIntegrityHashValue)</span></li>
</ul>
<span style="font-size: small">Note that SMB3KDF() and the calculation of Session.PreauthIntegrityHashValue are described in the blog post:</span>
<span style="font-size: small">SMB 3.1.1 Pre-authentication integrity in Windows 10</span>
<span style="font-size: small"><a href="https://blogs.msdn.com/b/openspecification/archive/2015/08/11/smb-3-1-1-pre-authentication-integrity-in-windows-10.aspx">https://blogs.msdn.com/b/openspecification/archive/2015/08/11/smb-3-1-1-pre-authentication-integrity-in-windows-10.aspx</a></span>
<h2>Transformed message</h2>
<span style="font-size: small">A transformed message consists of a transform_header followed by its encrypted SMB2 message.</span>
<span style="font-size: small">A transform_header has the same size and most of the same fields as defined for dialect 3.0.x with two specific changes for dialect 3.1.1:</span>
<span style="font-size: small">ProtocolId (4 bytes):  0xFD534D42 (in network order)</span>
<span style="font-size: small">Signature (16 bytes):  Signature of the encrypted message.</span>
<span style="font-size: small">Nonce (16 bytes):  An implementation-specific value unique for this encrypted message. </span>
<span style="font-size: small">OriginalMessageSize (4 bytes):  The size in bytes of the SMB2 message.</span>
<span style="font-size: small">Reserved (2 bytes):  Set to zeros and ignored. </span>
<span style="font-size: small">Flags (2 bytes): This field indicates how the SMB2 message was transformed.</span>
<span style="font-size: small">SessionId (8 bytes):  Uniquely identifies the established session for the command.</span>

<span style="font-size: small">The two changes to the transform_header for SMB 3.1.1 are as follows:</span>

<span style="font-size: small">Nonce (16 bytes) field: If CipherId is AES-128-GCM, the nonce used for encryption is the leftmost 12 bytes of the Nonce field, AES128GCM_Nonce (12 bytes), and the remaining 4 bytes are reserved. If CipherId is AES-128-CCM, the nonce used for encryption is the leftmost 11 bytes of the Nonce field, AES128CCM_Nonce (11 bytes), and the remaining 5 bytes are reserved.</span>

<span style="font-size: small">Flags (2 bytes): this field repurposes the EncryptionAlgorithm (2 bytes) field used in SMB 3.0.x. When Flags’ value is set to 0x0001, it indicates that the message is encrypted using the negotiated cipher ID.</span>
<h2>Encrypting the message</h2>
<span style="font-size: small">The sender encrypts the message with these specifics:</span>
<span style="font-size: small">- The encryption algorithm specified by Connection.CipherId (AES-GCM or AES-CCM) is called with the following inputs:</span>
<span style="font-size: small">- AES key: Session.EncryptionKey.</span>
<span style="font-size: small">- AES-nonce or IV: AES128CCM_Nonce for AES-CCM, AES128GCM_Nonce for AES-GCM.</span>
<span style="font-size: small">- Plaintext: The SMB2 message including the header and the payload.</span>
<span style="font-size: small">- The optional authenticated data (AAD):  The SMB2 transform_header excluding the ProtocolId and Signature fields; these are the 32 bytes starting from the Nonce field.</span>

<span style="font-size: small">The AES-CCM or AES-GCM outputs are: </span>
<span style="font-size: small">- Ciphertext: the encrypted SMB2 message</span>
<span style="font-size: small">- Message authentication code: the Signature field of the transform_header.</span>

<span style="font-size: small">The sender appends the encrypted SMB2 message to the transform_header and sends it to the receiver.</span>
<h2>Decrypting the message</h2>
<span style="font-size: small">The message is decrypted using: </span>
<span style="font-size: small">- The encryption algorithm specified by Connection.CipherId.</span>
<span style="font-size: small">- The Session.DecryptionKey of the Session that corresponds to the SessionId in the transform_header.</span>
<span style="font-size: small">- The AAD passed to the algorithm is the transform_header excluding the ProtocolId and Signature fields.</span>
<span style="font-size: small">- The nonce passed to the algorithm is based on CipherId as previously described.</span>

<span style="font-size: small">The signature returned by the decryption algorithm is then verified against the Signature in the transform_header.</span>
<h2>Encryption clauses</h2>
<span style="font-size: small">The encryption clauses are generally the same as for SMB 3.0.x. See the blog post at:</span>
<span style="font-size: small">Encryption in SMB 3.0: A protocol perspective</span>
<span style="font-size: small"><a href="https://blogs.msdn.com/b/openspecification/archive/2012/10/05/encryption-in-smb-3-0-a-protocol-perspective.aspx">https://blogs.msdn.com/b/openspecification/archive/2012/10/05/encryption-in-smb-3-0-a-protocol-perspective.aspx</a></span>
<h2>Unencrypted Access: RejectUnencryptedAccess</h2>
<span style="font-size: small">Set-SmbServerConfiguration -RejectUnencryptedAccess &lt;0|1&gt;</span>
<span style="font-size: small">The behavior is mainly unchanged in Windows Server 2016. The default value of RejectUnencryptedAccess is TRUE. When encryption is required (per share or server wide), the server returns ACCESS_DENIED for an unencrypted access attempt. A value of FALSE allows access from clients which do not support encryption or are not encryption-capable (e.g. SMB 1, SMB2 dialects 2.02, 2.1, SMB 3.x without encryption).</span>
<span style="font-size: small">This configuration item is meant for a transition phase to support down-level clients which use older dialects (SMB 2.1 or earlier) by literally “allowing any unencrypted access" whenever the deployment scenario requires. </span>
<span style="font-size: small">Note that if RejectUnencryptedAccess is disabled (FALSE), it opens the possibility for a man-in-the-middle (MITM) attacker to prevent the connection from negotiating encryption. If SMB 3.x is negotiated, the Windows 10 client will leverage negotiate validation or pre-authentication integrity to verify the properties of the connection with the server. In SMB 2.x.x, the encryption feature is not available even if the Windows 10 client still performs secure negotiate validation.</span>
<span style="font-size: small">However, setting RejectUnencryptedAccess to FALSE makes it un-detectible if the MITM downgrades the connection's dialect to SMB1, thus preventing encryption negotiation and allowing “clear text” eavesdropping.  </span>
<span style="font-size: small">As a result, it is recommended to disable SMB1 on the client as soon as it is no longer needed.</span>
<h2>Conclusion</h2>
<span style="font-size: small">Encryption is a very important feature whenever data confidentiality is required. This is the case when transferring high business impact data over untrusted networks. The addition of encryption negotiate context in SMB 3.1.1 is an enhancement that would interest many implementers. It also makes the feature extensible as new cryptographic ciphers become available and adopted. Some benchmark testing showed that AES-128-GCM provides as much as two times performance improvement over AES-128-CCM, while providing authenticated encryption at the same time.</span>
<h2>Appendix A. Test vector for SMB 3.1.1 encryption</h2>
<span style="font-size: small">This sample data should be considered “as-is”. It should also be noted that examples do not replace normative protocol specifications. The authoritative reference is [MS-SMB2].</span>

<span style="font-size: small">The test client negotiates SMB 3.1.1 and communicates with a Windows 2016 server. It opens a file and WRITEs the following content. It then READs back the file. </span>
<span style="font-size: small">This is the content written and read:</span>
<span style="font-size: small">Smb3 encryption testing</span>
<span style="font-size: small">Hex value:</span>
<span style="font-size: small">536D623320656E6372797074696F6E2074657374696E67</span>

<span style="font-size: small">These outputs show pre-authentication integrity phase for key derivation, then the encryption and decryption of the WRITE and READ commands.</span>
<span style="font-size: small">The decrypted content is verified to be same at the end of the SMB2 READ response.</span>
<h3><span>Appendix A.1 Test vector with AES-GCM</span></h3>
<span style="font-size: small">--- Key derivation ---</span>

<span style="font-size: small">Header.Command 0x0000 NEGOTIATE</span>

<span style="font-size: small">Preauth integrity hash ---</span>
<span style="font-size: small">PreauthIntegrityCaps.HashAlgorithmCount 0x1</span>
<span style="font-size: small">PreauthIntegrityCaps.SaltLength 0x20</span>
<span style="font-size: small">PreauthIntegrityCaps.HashAlgorithms 0x0001</span>
<span style="font-size: small">PreauthIntegrityCaps.Salt </span>
<span style="font-size: small">D1709D7196E1BD0B6EBF95213D76553435763514392649FD6F216ED8BF269CD8</span>

<span style="font-size: small">Encryption capabilites ---</span>
<span style="font-size: small">EncryptionCaps.CipherCount 0x2</span>
<span style="font-size: small">EncryptionCaps.Ciphers[0] 0x0002</span>
<span style="font-size: small">EncryptionCaps.Ciphers[1] 0x0001</span>

<span style="font-size: small">Connection.PreauthIntegrityHashId 0x0001</span>

<span style="font-size: small">NEGOTIATE Request</span>

<span style="font-size: small">Preauth integrity hash ---</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">00000000000000000000000000000000000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">Negotiate request packet </span>
<span style="font-size: small">FE534D4240000100000000000000010000000000000000000000000000000000FFFE000000000000</span>
<span style="font-size: small">0000000000000000000000000000000000000000000000002400050001000000660000004F0D7FA0</span>
<span style="font-size: small">09F5B246B2EF62551D7D7C0970000000020000000202100200030203110300000100260000000000</span>
<span style="font-size: small">010020000100D1709D7196E1BD0B6EBF95213D76553435763514392649FD6F216ED8BF269CD80000</span>
<span style="font-size: small">0200060000000000020002000100</span>
<span style="font-size: small">Concatenate Connection.PreauthIntegrityHashValue and Negotiate request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">00000000000000000000000000000000000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000FE534D42400001000000000000000100</span>
<span style="font-size: small">00000000000000000000000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">00000000000000002400050001000000660000004F0D7FA009F5B246B2EF62551D7D7C0970000000</span>
<span style="font-size: small">020000000202100200030203110300000100260000000000010020000100D1709D7196E1BD0B6EBF</span>
<span style="font-size: small">95213D76553435763514392649FD6F216ED8BF269CD800000200060000000000020002000100</span>
<span style="font-size: small">New </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">550442DAF311412870AD9E58E602B0312D61328D6B1AC28F22AF46D6EA581F23A9BFABE0CC041197</span>
<span style="font-size: small">6BF3F9DA23D3433352CB48CF00B8659BC1A3695E1B1A52A8</span>

<span style="font-size: small">NEGOTIATE Response</span>

<span style="font-size: small">Updating Preauth integrity hash ---</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">550442DAF311412870AD9E58E602B0312D61328D6B1AC28F22AF46D6EA581F23A9BFABE0CC041197</span>
<span style="font-size: small">6BF3F9DA23D3433352CB48CF00B8659BC1A3695E1B1A52A8</span>
<span style="font-size: small">Negotiate response packet </span>
<span style="font-size: small">FE534D4240000100000000000000010001000000000000000000000000000000FFFE000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942</span>
<span style="font-size: small">BDCE5D60F09AB3FB27000000000080000000800000008000D1168E69CDAED00109094AB095AED001</span>
<span style="font-size: small">80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182</span>
<span style="font-size: small">3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000</span>
<span style="font-size: small">6000000070000000807CC0FD06D6362D02DDE1CF343BFE29C16AA4EA4741FB0EF645DC5C5D3C3E6A</span>
<span style="font-size: small">8DE5D0BAEF7A06DC070076174356EDA0000000000000000060000000010000000000000000000000</span>
<span style="font-size: small">5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000</span>
<span style="font-size: small">807CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000</span>
<span style="font-size: small">3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562</span>
<span style="font-size: small">6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075</span>
<span style="font-size: small">626C6963204B65790100260000000000010020000100B51C002C28941192737A08344B05CE90786E</span>
<span style="font-size: small">EC146D99CDB60AE44E5A86127D270000020004000000000001000200</span>
<span style="font-size: small">Concatenate Connection.PreauthIntegrityHashValue and Negotiate response packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">550442DAF311412870AD9E58E602B0312D61328D6B1AC28F22AF46D6EA581F23A9BFABE0CC041197</span>
<span style="font-size: small">6BF3F9DA23D3433352CB48CF00B8659BC1A3695E1B1A52A8FE534D42400001000000000000000100</span>
<span style="font-size: small">01000000000000000000000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2700000000008000</span>
<span style="font-size: small">0000800000008000D1168E69CDAED00109094AB095AED00180004001C00100006082013C06062B06</span>
<span style="font-size: small">01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A</span>
<span style="font-size: small">A282010C048201084E45474F4558545301000000000000006000000070000000807CC0FD06D6362D</span>
<span style="font-size: small">02DDE1CF343BFE29C16AA4EA4741FB0EF645DC5C5D3C3E6A8DE5D0BAEF7A06DC070076174356EDA0</span>
<span style="font-size: small">0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308</span>
<span style="font-size: small">4E45474F4558545303000000010000004000000098000000807CC0FD06D6362D02DDE1CF343BFE29</span>
<span style="font-size: small">5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F</span>
<span style="font-size: small">06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130</span>
<span style="font-size: small">1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000</span>
<span style="font-size: small">010020000100B51C002C28941192737A08344B05CE90786EEC146D99CDB60AE44E5A86127D270000</span>
<span style="font-size: small">020004000000000001000200</span>
<span style="font-size: small">New </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">ABE4DA6E875F6FB05033AF04DCC38C92888B4E13D1EAB7AA05CADE142064974CB3EAB0782600549B</span>
<span style="font-size: small">A27207AA213B0D190B9950FA36D45BE32A888BFEE8389B74</span>

<span style="font-size: small">Add NEW SessionId 0x100000000025 to Preauth Integrity hash table with value </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">ABE4DA6E875F6FB05033AF04DCC38C92888B4E13D1EAB7AA05CADE142064974CB3EAB0782600549B</span>
<span style="font-size: small">A27207AA213B0D190B9950FA36D45BE32A888BFEE8389B74</span>

<span style="font-size: small">SESSION SETUP Request </span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000025</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">ABE4DA6E875F6FB05033AF04DCC38C92888B4E13D1EAB7AA05CADE142064974CB3EAB0782600549B</span>
<span style="font-size: small">A27207AA213B0D190B9950FA36D45BE32A888BFEE8389B74</span>
<span style="font-size: small">SessionSetup request packet </span>
<span style="font-size: small">FE534D4240000100000000000100800000000000000000000100000000000000FFFE000000000000</span>
<span style="font-size: small">00000000000000000000000000000000000000000000000019000001010000000000000058004A00</span>
<span style="font-size: small">0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A</span>
<span style="font-size: small">04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000</span>
<span style="font-size: small">000F</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data  </span>
<span style="font-size: small">ABE4DA6E875F6FB05033AF04DCC38C92888B4E13D1EAB7AA05CADE142064974CB3EAB0782600549B</span>
<span style="font-size: small">A27207AA213B0D190B9950FA36D45BE32A888BFEE8389B74FE534D42400001000000000001008000</span>
<span style="font-size: small">00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000019000001010000000000000058004A000000000000000000604806062B060105</span>
<span style="font-size: small">0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782</span>
<span style="font-size: small">08E200000000000000000000000000000000060380250000000F</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">A5E8AB87E2ADB8FA5F4545D20F1FD2019D66CCD0F4DFD1F762F1DFC8DCB15B98D0BD1F1450F6A0AF</span>
<span style="font-size: small">C70F80B353C2D959217681949CF22DF35F31257A281C6A80</span>

<span style="font-size: small">SESSION SETUP Response</span>

<span style="font-size: small"> --- STATUS_MORE_PROCESSING_REQUIRED - Updating Preauth integrity hash ---</span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000025</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">A5E8AB87E2ADB8FA5F4545D20F1FD2019D66CCD0F4DFD1F762F1DFC8DCB15B98D0BD1F1450F6A0AF</span>
<span style="font-size: small">C70F80B353C2D959217681949CF22DF35F31257A281C6A80</span>
<span style="font-size: small">SessionSetup response packet </span>
<span style="font-size: small">FE534D4240000100160000C00100010001000000000000000100000000000000FFFE000000000000</span>
<span style="font-size: small">250000000010000000000000000000000000000000000000090000004800B300A181B03081ADA003</span>
<span style="font-size: small">0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038</span>
<span style="font-size: small">00000015828AE25FC0CB7F886E93D6000000000000000050005000440000000A0092270000000F53</span>
<span style="font-size: small">005500540033003100310002000C0053005500540033003100310001000C00530055005400330031</span>
<span style="font-size: small">00310004000C0053005500540033003100310003000C005300550054003300310031000700080024</span>
<span style="font-size: small">8D5C6CCDAED00100000000</span>
<span style="font-size: small">SessionSetup response header signature 0x00000000000000000000000000000000</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup response packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">A5E8AB87E2ADB8FA5F4545D20F1FD2019D66CCD0F4DFD1F762F1DFC8DCB15B98D0BD1F1450F6A0AF</span>
<span style="font-size: small">C70F80B353C2D959217681949CF22DF35F31257A281C6A80FE534D4240000100160000C001000100</span>
<span style="font-size: small">01000000000000000100000000000000FFFE00000000000025000000001000000000000000000000</span>
<span style="font-size: small">0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202</span>
<span style="font-size: small">0AA281970481944E544C4D53535000020000000C000C003800000015828AE25FC0CB7F886E93D600</span>
<span style="font-size: small">0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053</span>
<span style="font-size: small">005500540033003100310001000C0053005500540033003100310004000C00530055005400330031</span>
<span style="font-size: small">00310003000C0053005500540033003100310007000800248D5C6CCDAED00100000000</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">9A095455244172898902B0FBDF5FEFAFD8435BB66A47EB55CB7542732A423F58B12B3ED698BEF387</span>
<span style="font-size: small">8D8A346FD9F5CC882DA37AAF2A939290E98B935FC72B3944</span>

<span style="font-size: small">SESSION SETUP Request </span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000025</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">9A095455244172898902B0FBDF5FEFAFD8435BB66A47EB55CB7542732A423F58B12B3ED698BEF387</span>
<span style="font-size: small">8D8A346FD9F5CC882DA37AAF2A939290E98B935FC72B3944</span>
<span style="font-size: small">SessionSetup request packet </span>
<span style="font-size: small">FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000</span>
<span style="font-size: small">2500000000100000000000000000000000000000000000001900000101000000000000005800CF01</span>
<span style="font-size: small">0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000</span>
<span style="font-size: small">001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000</span>
<span style="font-size: small">001000100096010000158288E2060380250000000FA5E34268EF143BE5816251D02C564E9B530055</span>
<span style="font-size: small">005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049</span>
<span style="font-size: small">005600450052003300310031000000000000000000000000000000000000000000000000002C263D</span>
<span style="font-size: small">A5C2D54785E8EDA0552472D3A30101000000000000248D5C6CCDAED001BEA7A53E2DC098EB000000</span>
<span style="font-size: small">0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055</span>
<span style="font-size: small">00540033003100310003000C0053005500540033003100310007000800248D5C6CCDAED001060004</span>
<span style="font-size: small">00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B</span>
<span style="font-size: small">8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016</span>
<span style="font-size: small">0063006900660073002F00530055005400330031003100000000000000000000000000133FA6EA15</span>
<span style="font-size: small">4880BB44576C6E2490BDE7A31204100100000067890BD408F5680D00000000</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data  </span>
<span style="font-size: small">9A095455244172898902B0FBDF5FEFAFD8435BB66A47EB55CB7542732A423F58B12B3ED698BEF387</span>
<span style="font-size: small">8D8A346FD9F5CC882DA37AAF2A939290E98B935FC72B3944FE534D42400001000000000001008000</span>
<span style="font-size: small">00000000000000000200000000000000FFFE00000000000025000000001000000000000000000000</span>
<span style="font-size: small">00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7</span>
<span style="font-size: small">A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000</span>
<span style="font-size: small">000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380</span>
<span style="font-size: small">250000000FA5E34268EF143BE5816251D02C564E9B530055005400330031003100610064006D0069</span>
<span style="font-size: small">006E006900730074007200610074006F007200440052004900560045005200330031003100000000</span>
<span style="font-size: small">0000000000000000000000000000000000000000002C263DA5C2D54785E8EDA0552472D3A3010100</span>
<span style="font-size: small">0000000000248D5C6CCDAED001BEA7A53E2DC098EB0000000002000C005300550054003300310031</span>
<span style="font-size: small">0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055</span>
<span style="font-size: small">00540033003100310007000800248D5C6CCDAED00106000400020000000800300030000000000000</span>
<span style="font-size: small">000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0</span>
<span style="font-size: small">CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054</span>
<span style="font-size: small">00330031003100000000000000000000000000133FA6EA154880BB44576C6E2490BDE7A312041001</span>
<span style="font-size: small">00000067890BD408F5680D00000000</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">B23F3CBFD69487D9832B79B1594A367CDD950909B774C3A4C412B4FCEA9EDDDBA7DB256BA2EA30E9</span>
<span style="font-size: small">77F11F9B113247578E0E915C6D2A513B8F2FCA5707DC8770</span>

<span style="font-size: small">SESSION SETUP Response </span>
<span style="font-size: small">SessionId 0x100000000025 COMPLETED</span>
<span style="font-size: small">SessionSetup response packet </span>
<span style="font-size: small">FE534D4240000100000000000100800009000000000000000200000000000000FFFE000000000000</span>
<span style="font-size: small">25000000001000006B85A4519A0F3EEA35BA946DD3AFE6B80900000048001D00A11B3019A0030A01</span>
<span style="font-size: small">00A3120410010000003932A87523AB660100000000</span>
<span style="font-size: small">SessionSetup response header signature 0x6B85A4519A0F3EEA35BA946DD3AFE6B8</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">B23F3CBFD69487D9832B79B1594A367CDD950909B774C3A4C412B4FCEA9EDDDBA7DB256BA2EA30E9</span>
<span style="font-size: small">77F11F9B113247578E0E915C6D2A513B8F2FCA5707DC8770</span>

<span style="font-size: small">Input cryptographicKey (SessionKey) 0x419FDDF34C1E001909D362AE7FB6AF79</span>
<span style="font-size: small">(queried from GSS authenticated context)</span>

<span style="font-size: small">--- Dialect 0x0311 ---</span>
<span style="font-size: small">preauthIntegrityHashValue </span>
<span style="font-size: small">B23F3CBFD69487D9832B79B1594A367CDD950909B774C3A4C412B4FCEA9EDDDBA7DB256BA2EA30E9</span>
<span style="font-size: small">77F11F9B113247578E0E915C6D2A513B8F2FCA5707DC8770</span>
<span style="font-size: small">CypherId 0x0002</span>
<span style="font-size: small">SessionKey 0x419FDDF34C1E001909D362AE7FB6AF79</span>
<span style="font-size: small">SigningKey 0x8765949DFEAEE105CE9118B45BE988F0</span>
<span style="font-size: small">EncryptionKey 0xA2F5E80E5D59103034F32E52F698E5EC</span>
<span style="font-size: small">DecryptionKey 0x748C50868C90F302962A5C35F5F9A8BF</span>
<span style="font-size: small">ApplicationKey 0x099D610789FBE82055B313601C3E8CC4</span>

<span style="font-size: small">--- Encryption ---</span>

<span style="font-size: small">SessionId 0x100000000025</span>
<span style="font-size: small">SessionKey 0x419FDDF34C1E001909D362AE7FB6AF79</span>
<span style="font-size: small">SigningKey 0x8765949DFEAEE105CE9118B45BE988F0</span>
<span style="font-size: small">EncryptionKey 0xA2F5E80E5D59103034F32E52F698E5EC</span>
<span style="font-size: small">DecryptionKey 0x748C50868C90F302962A5C35F5F9A8BF</span>
<span style="font-size: small">ApplicationKey 0x099D610789FBE82055B313601C3E8CC4</span>
<span style="font-size: small">Header.Command 0x0009 WRITE</span>

<span style="font-size: small">Encryption of the request ---</span>

<span style="font-size: small">Key 0xA2F5E80E5D59103034F32E52F698E5EC</span>

<span style="font-size: small">Nonce Length 0xc</span>
<span style="font-size: small">AES-128-GCM nonce 0xC7D6822D269CAF48904C664C</span>

<span style="font-size: small">SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000900010008000000000000000500000000000000FFFE000001000000</span>
<span style="font-size: small">25000000001000000000000000000000000000000000000031007000170000000000000000000000</span>
<span style="font-size: small">0600000004000000010000000400000000000000000000007000000000000000536D623320656E63</span>
<span style="font-size: small">72797074696F6E2074657374696E67</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0xBD73D97D2BC9001BCAFAC0FDFF5FEEBC</span>
<span style="font-size: small">transform_header.Nonce 0xC7D6822D269CAF48904C664C00000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x87</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000025</span>
<span style="font-size: small">Encrypted message </span>
<span style="font-size: small">6ECDD2A7AFC7B47763057A041B8FD4DAFFE990B70C9E09D36C084E02D14EF247F8BDE38ACF6256F8</span>
<span style="font-size: small">B1D3B56F77FBDEB312FEA5E92CBCC1ED8FB2EBBFAA75E49A4A394BB44576545567C24D4C014D47C9</span>
<span style="font-size: small">FBDFDAFD2C4F9B72F8D256452620A299F48E29E53D6B61D1C13A19E91AF013F00D17E3ABC2FC3D36</span>
<span style="font-size: small">C8C1B6B93973253852DBD442E46EE8</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D42BD73D97D2BC9001BCAFAC0FDFF5FEEBCC7D6822D269CAF48904C664C0000000087000000</span>
<span style="font-size: small">0000010025000000001000006ECDD2A7AFC7B47763057A041B8FD4DAFFE990B70C9E09D36C08<span style="font-size: small">4E02</span></span>
<span style="font-size: small">D14EF247F8BDE38ACF6256F8B1D3B56F77FBDEB312FEA5E92CBCC1ED8FB2EBBFAA75E49A4A39<span style="font-size: small">4BB4</span></span>
<span style="font-size: small">4576545567C24D4C014D47C9FBDFDAFD2C4F9B72F8D256452620A299F48E29E53D6B61D1C13A<span style="font-size: small">19E9</span></span>
<span style="font-size: small">1AF013F00D17E3ABC2FC3D36C8C1B6B93973253852DBD442E46EE8</span>

<span style="font-size: small">Decryption of the response ---</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D42ACBE1CB7ED343ADF1725EF144D90D4B0E06831DD2E8EB7B4000000000000000050000000</span>
<span style="font-size: small">00000100250000000010000026BBBF949983A6C1C796559D0F2C510CB651D1F7B6AC8DED32A2A0B8</span>
<span style="font-size: small">F2D793A815C6F6B848D69767A215841A42D400AE6DDB5F0B44173A014973321FDD7950DA6179159B</span>
<span style="font-size: small">82E03C9E18A050FF0EA1C967</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0xACBE1CB7ED343ADF1725EF144D90D4B0</span>
<span style="font-size: small">transform_header.Nonce 0xE06831DD2E8EB7B40000000000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x50</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000025</span>

<span style="font-size: small">Key 0x748C50868C90F302962A5C35F5F9A8BF</span>

<span style="font-size: small">Nonce Length 0xc</span>
<span style="font-size: small">AES-128-GCM nonce 0xE06831DD2E8EB7B400000000</span>
<span style="font-size: small">Decrypted SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000900010001000000000000000500000000000000FFFE000001000000</span>
<span style="font-size: small">25000000001000000000000000000000000000000000000011000000170000000000000000000000</span>
<span style="font-size: small">Header.Command 0x0008 READ</span>

<span style="font-size: small">Encryption of the request ---</span>

<span style="font-size: small">Key 0xA2F5E80E5D59103034F32E52F698E5EC</span>

<span style="font-size: small">Nonce Length 0xc</span>
<span style="font-size: small">AES-128-GCM nonce 0xD7AA8C6D36859243B715E0A6</span>

<span style="font-size: small">SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000800010008000000000000000600000000000000FFFE000001000000</span>
<span style="font-size: small">25000000001000000000000000000000000000000000000031000000170000000000000000000000</span>
<span style="font-size: small">060000000400000001000000040000000000000000000000000000000000000000</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0x6DAC0B6FD85A3ED42BB917DA38FE0386</span>
<span style="font-size: small">transform_header.Nonce 0xD7AA8C6D36859243B715E0A600000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x71</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000025</span>
<span style="font-size: small">Encrypted message </span>
<span style="font-size: small">88A47BF09CA3C3141CDD7306BE9D9475AB24FCCB833D77461C041F8FB983D0C188F0729272B31D9D</span>
<span style="font-size: small">3D0DC6B687C069EEE0CC8EACA2C536D019ACC9E185D1EB630E0FCB793EEECEB06D82A1D77706E700</span>
<span style="font-size: small">DBEBFB4FEB54D7AD2D97E7288804F90757FE4D08D6A84A3FF433E7451E768E4699</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D426DAC0B6FD85A3ED42BB917DA38FE0386D7AA8C6D36859243B715E0A60000000071000000</span>
<span style="font-size: small">00000100250000000010000088A47BF09CA3C3141CDD7306BE9D9475AB24FCCB833D77461C04<span style="font-size: small">1F8F</span></span>
<span style="font-size: small">B983D0C188F0729272B31D9D3D0DC6B687C069EEE0CC8EACA2C536D019ACC9E185D1EB630E0F<span style="font-size: small">CB79</span></span>
<span style="font-size: small">3EEECEB06D82A1D77706E700DBEBFB4FEB54D7AD2D97E7288804F90757FE4D08D6A84A3FF433<span style="font-size: small">E745</span></span>
<span style="font-size: small">1E768E4699</span>

<span style="font-size: small">Decryption of the response ---</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D427F714B3B9D8FA1198584E71C2BAA1CB6E16831DD2E8EB7B4000000000000000067000000</span>
<span style="font-size: small">000001002500000000100000FECEDF4D03BB11A6CC5D8A53BE33D6D8701986342B4197D306E16F9C</span>
<span style="font-size: small">BB218E92F7F8281F51CE68BB85A20D87DE90EBBF80538066D1C37513C0A58D70936D537B624F5500</span>
<span style="font-size: small">202A612B6CD30D448A82791A0B2E049ED512AFAEFB06E98AB3D6F931D7D50DB2DBD36A</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0x7F714B3B9D8FA1198584E71C2BAA1CB6</span>
<span style="font-size: small">transform_header.Nonce 0xE16831DD2E8EB7B40000000000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x67</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000025</span>

<span style="font-size: small">Key 0x748C50868C90F302962A5C35F5F9A8BF</span>

<span style="font-size: small">Nonce Length 0xc</span>
<span style="font-size: small">AES-128-GCM nonce 0xE16831DD2E8EB7B400000000</span>
<span style="font-size: small">Decrypted SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000800010001000000000000000600000000000000FFFE000001000000</span>
<span style="font-size: small">25000000001000000000000000000000000000000000000011005000170000000000000000000000</span>
<span style="font-size: small">536D623320656E6372797074696F6E2074657374696E67</span>
<h3>Appendix A.2 Test vector with AES-CCM</h3>
<span style="font-size: small">--- Key derivation ---</span>

<span style="font-size: small">Header.Command 0x0000 NEGOTIATE</span>

<span style="font-size: small">Preauth integrity hash ---</span>
<span style="font-size: small">PreauthIntegrityCaps.HashAlgorithmCount 0x1</span>
<span style="font-size: small">PreauthIntegrityCaps.SaltLength 0x20</span>
<span style="font-size: small">PreauthIntegrityCaps.HashAlgorithms 0x0001</span>
<span style="font-size: small">PreauthIntegrityCaps.Salt </span>
<span style="font-size: small">1A05A92392E1554C072AE7B186EE7DC02CB90BEF2E639CCC94B7A9DC7B393442</span>

<span style="font-size: small">Encryption capabilites ---</span>
<span style="font-size: small">EncryptionCaps.CipherCount 0x2</span>
<span style="font-size: small">EncryptionCaps.Ciphers[0] 0x0001</span>
<span style="font-size: small">EncryptionCaps.Ciphers[1] 0x0002</span>

<span style="font-size: small">Connection.PreauthIntegrityHashId 0x0001</span>

<span style="font-size: small">NEGOTIATE Request</span>

<span style="font-size: small">Preauth integrity hash ---</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">00000000000000000000000000000000000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">Negotiate request packet </span>
<span style="font-size: small">FE534D4240000100000000000000010000000000000000000000000000000000FFFE000000000000</span>
<span style="font-size: small">00000000000000000000000000000000000000000000000024000500010000006600000078EA16AC</span>
<span style="font-size: small">6877C34A95F7160F73EA377270000000020000000202100200030203110300000100260000000000</span>
<span style="font-size: small">0100200001001A05A92392E1554C072AE7B186EE7DC02CB90BEF2E639CCC94B7A9DC7B3934420000</span>
<span style="font-size: small">0200060000000000020001000200</span>
<span style="font-size: small">Concatenate Connection.PreauthIntegrityHashValue and Negotiate request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">00000000000000000000000000000000000000000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000FE534D42400001000000000000000100</span>
<span style="font-size: small">00000000000000000000000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000024000500010000006600000078EA16AC6877C34A95F7160F73EA377270000000</span>
<span style="font-size: small">0200000002021002000302031103000001002600000000000100200001001A05A92392E1554C072A</span>
<span style="font-size: small">E7B186EE7DC02CB90BEF2E639CCC94B7A9DC7B39344200000200060000000000020001000200</span>
<span style="font-size: small">New </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">A3A8A769FEA693B3D037406EF945E115D2B7A4A9318564D2CAAA4B1FE0EC36D8D92A4802619EDCF2</span>
<span style="font-size: small">9E2410534D2D3749E71F76ADF5212F959210D291097A6355</span>

<span style="font-size: small">NEGOTIATE Response</span>

<span style="font-size: small">Updating Preauth integrity hash ---</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">A3A8A769FEA693B3D037406EF945E115D2B7A4A9318564D2CAAA4B1FE0EC36D8D92A4802619EDCF2</span>
<span style="font-size: small">9E2410534D2D3749E71F76ADF5212F959210D291097A6355</span>
<span style="font-size: small">Negotiate response packet </span>
<span style="font-size: small">FE534D4240000100000000000000010001000000000000000000000000000000FFFE000000000000</span>
<span style="font-size: small">000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942</span>
<span style="font-size: small">BDCE5D60F09AB3FB27000000000080000000800000008000D04C8443CCAED00109094AB095AED001</span>
<span style="font-size: small">80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182</span>
<span style="font-size: small">3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000</span>
<span style="font-size: small">60000000700000007F7CC0FD06D6362D02DDE1CF343BFE2973007DCF55CA793E082B7A257DEFE6E8</span>
<span style="font-size: small">E18291ABF112C0599108C772F55CBB2A000000000000000060000000010000000000000000000000</span>
<span style="font-size: small">5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000</span>
<span style="font-size: small">7F7CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000</span>
<span style="font-size: small">3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562</span>
<span style="font-size: small">6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075</span>
<span style="font-size: small">626C6963204B6579010026000000000001002000010088AFA422ECC239CB16F30BA641AE4B6EE79F</span>
<span style="font-size: small">5A4AF74FE18A301E9790515D07F70000020004000000000001000100</span>
<span style="font-size: small">Concatenate Connection.PreauthIntegrityHashValue and Negotiate response packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">A3A8A769FEA693B3D037406EF945E115D2B7A4A9318564D2CAAA4B1FE0EC36D8D92A4802619EDCF2</span>
<span style="font-size: small">9E2410534D2D3749E71F76ADF5212F959210D291097A6355FE534D42400001000000000000000100</span>
<span style="font-size: small">01000000000000000000000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2700000000008000</span>
<span style="font-size: small">0000800000008000D04C8443CCAED00109094AB095AED00180004001C00100006082013C06062B06</span>
<span style="font-size: small">01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A</span>
<span style="font-size: small">A282010C048201084E45474F45585453010000000000000060000000700000007F7CC0FD06D6362D</span>
<span style="font-size: small">02DDE1CF343BFE2973007DCF55CA793E082B7A257DEFE6E8E18291ABF112C0599108C772F55CBB2A</span>
<span style="font-size: small">0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308</span>
<span style="font-size: small">4E45474F45585453030000000100000040000000980000007F7CC0FD06D6362D02DDE1CF343BFE29</span>
<span style="font-size: small">5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F</span>
<span style="font-size: small">06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130</span>
<span style="font-size: small">1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000</span>
<span style="font-size: small">01002000010088AFA422ECC239CB16F30BA641AE4B6EE79F5A4AF74FE18A301E9790515D07F70000</span>
<span style="font-size: small">020004000000000001000100</span>
<span style="font-size: small">New </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">A21419AD43D5A4975326E07142734EADA33D0927738F3C1B05A65B003CCAAAE225B547045260356C</span>
<span style="font-size: small">2014A21E0A3DFA9EF7B192C375BFFC5F5E766AC3261F0457</span>

<span style="font-size: small">Add NEW SessionId 0x100000000021 to Preauth Integrity hash table with value </span>
<span style="font-size: small">Connection.PreauthIntegrityHashValue </span>
<span style="font-size: small">A21419AD43D5A4975326E07142734EADA33D0927738F3C1B05A65B003CCAAAE225B547045260356C</span>
<span style="font-size: small">2014A21E0A3DFA9EF7B192C375BFFC5F5E766AC3261F0457</span>

<span style="font-size: small">SESSION SETUP Request </span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000021</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">A21419AD43D5A4975326E07142734EADA33D0927738F3C1B05A65B003CCAAAE225B547045260356C</span>
<span style="font-size: small">2014A21E0A3DFA9EF7B192C375BFFC5F5E766AC3261F0457</span>
<span style="font-size: small">SessionSetup request packet </span>
<span style="font-size: small">FE534D4240000100000000000100800000000000000000000100000000000000FFFE000000000000</span>
<span style="font-size: small">00000000000000000000000000000000000000000000000019000001010000000000000058004A00</span>
<span style="font-size: small">0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A</span>
<span style="font-size: small">04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000</span>
<span style="font-size: small">000F</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data  </span>
<span style="font-size: small">A21419AD43D5A4975326E07142734EADA33D0927738F3C1B05A65B003CCAAAE225B547045260356C</span>
<span style="font-size: small">2014A21E0A3DFA9EF7B192C375BFFC5F5E766AC3261F0457FE534D42400001000000000001008000</span>
<span style="font-size: small">00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</span>
<span style="font-size: small">000000000000000019000001010000000000000058004A000000000000000000604806062B060105</span>
<span style="font-size: small">0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782</span>
<span style="font-size: small">08E200000000000000000000000000000000060380250000000F</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">FD10D68FFBB5D94DD483DE14DC8AF92B4D2D8517A5D245FE091C93050AC56239B3B829F74CB25451</span>
<span style="font-size: small">276248F12279DCC027C9B53841A67052A617C32C93CBA8C2</span>

<span style="font-size: small">SESSION SETUP Response</span>

<span style="font-size: small"> --- STATUS_MORE_PROCESSING_REQUIRED - Updating Preauth integrity hash ---</span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000021</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">FD10D68FFBB5D94DD483DE14DC8AF92B4D2D8517A5D245FE091C93050AC56239B3B829F74CB25451</span>
<span style="font-size: small">276248F12279DCC027C9B53841A67052A617C32C93CBA8C2</span>
<span style="font-size: small">SessionSetup response packet </span>
<span style="font-size: small">FE534D4240000100160000C00100010001000000000000000100000000000000FFFE000000000000</span>
<span style="font-size: small">210000000010000000000000000000000000000000000000090000004800B300A181B03081ADA003</span>
<span style="font-size: small">0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038</span>
<span style="font-size: small">00000015828AE29296836B33F712E0000000000000000050005000440000000A0092270000000F53</span>
<span style="font-size: small">005500540033003100310002000C0053005500540033003100310001000C00530055005400330031</span>
<span style="font-size: small">00310004000C0053005500540033003100310003000C005300550054003300310031000700080019</span>
<span style="font-size: small">C69C43CCAED00100000000</span>
<span style="font-size: small">SessionSetup response header signature 0x00000000000000000000000000000000</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup response packet</span>
<span style="font-size: small">SHA-512 Input Hash Data </span>
<span style="font-size: small">FD10D68FFBB5D94DD483DE14DC8AF92B4D2D8517A5D245FE091C93050AC56239B3B829F74CB25451</span>
<span style="font-size: small">276248F12279DCC027C9B53841A67052A617C32C93CBA8C2FE534D4240000100160000C001000100</span>
<span style="font-size: small">01000000000000000100000000000000FFFE00000000000021000000001000000000000000000000</span>
<span style="font-size: small">0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202</span>
<span style="font-size: small">0AA281970481944E544C4D53535000020000000C000C003800000015828AE29296836B33F712E000</span>
<span style="font-size: small">0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053</span>
<span style="font-size: small">005500540033003100310001000C0053005500540033003100310004000C00530055005400330031</span>
<span style="font-size: small">00310003000C005300550054003300310031000700080019C69C43CCAED00100000000</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">2AA0A0D736D4A3BE4A2FA06B20EEBF02635543C0310F72595ACEAF9893BBE647D9C753175215BB24</span>
<span style="font-size: small">71DF365D4FC77AB8D168ECC91ABC02C4611D2AAC33181967</span>

<span style="font-size: small">SESSION SETUP Request </span>
<span style="font-size: small">PreauthSession.SessionId 0x100000000021</span>
<span style="font-size: small">Current </span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">2AA0A0D736D4A3BE4A2FA06B20EEBF02635543C0310F72595ACEAF9893BBE647D9C753175215BB24</span>
<span style="font-size: small">71DF365D4FC77AB8D168ECC91ABC02C4611D2AAC33181967</span>
<span style="font-size: small">SessionSetup request packet </span>
<span style="font-size: small">FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000</span>
<span style="font-size: small">2100000000100000000000000000000000000000000000001900000101000000000000005800CF01</span>
<span style="font-size: small">0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000</span>
<span style="font-size: small">001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000</span>
<span style="font-size: small">001000100096010000158288E2060380250000000F3E492B87B2606D263031D0D12B6AD267530055</span>
<span style="font-size: small">005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049</span>
<span style="font-size: small">005600450052003300310031000000000000000000000000000000000000000000000000009AEF57</span>
<span style="font-size: small">4DBD2E8A323B017ED361EEA14B010100000000000019C69C43CCAED00176AC9CBD38378531000000</span>
<span style="font-size: small">0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055</span>
<span style="font-size: small">00540033003100310003000C005300550054003300310031000700080019C69C43CCAED001060004</span>
<span style="font-size: small">00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B</span>
<span style="font-size: small">8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016</span>
<span style="font-size: small">0063006900660073002F005300550054003300310031000000000000000000000000005E621187A7</span>
<span style="font-size: small">5CC18E3982494ECC4793B7A3120410010000005C661B9E6BE0F1E500000000</span>
<span style="font-size: small">Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup request packet</span>
<span style="font-size: small">SHA-512 Input Hash Data  </span>
<span style="font-size: small">2AA0A0D736D4A3BE4A2FA06B20EEBF02635543C0310F72595ACEAF9893BBE647D9C753175215BB24</span>
<span style="font-size: small">71DF365D4FC77AB8D168ECC91ABC02C4611D2AAC33181967FE534D42400001000000000001008000</span>
<span style="font-size: small">00000000000000000200000000000000FFFE00000000000021000000001000000000000000000000</span>
<span style="font-size: small">00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7</span>
<span style="font-size: small">A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000</span>
<span style="font-size: small">000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380</span>
<span style="font-size: small">250000000F3E492B87B2606D263031D0D12B6AD267530055005400330031003100610064006D0069</span>
<span style="font-size: small">006E006900730074007200610074006F007200440052004900560045005200330031003100000000</span>
<span style="font-size: small">0000000000000000000000000000000000000000009AEF574DBD2E8A323B017ED361EEA14B010100</span>
<span style="font-size: small">000000000019C69C43CCAED00176AC9CBD383785310000000002000C005300550054003300310031</span>
<span style="font-size: small">0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055</span>
<span style="font-size: small">0054003300310031000700080019C69C43CCAED00106000400020000000800300030000000000000</span>
<span style="font-size: small">000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0</span>
<span style="font-size: small">CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054</span>
<span style="font-size: small">003300310031000000000000000000000000005E621187A75CC18E3982494ECC4793B7A312041001</span>
<span style="font-size: small">0000005C661B9E6BE0F1E500000000</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">DECF98A420718718F22090D3580FCC5E484BD310FA1268210C6E86335A8891E767F5BCD99FA5A785</span>
<span style="font-size: small">9D665AD07A73EA94E1BCDB7CFA69A6962A28A244138340B1</span>

<span style="font-size: small">SESSION SETUP Response </span>
<span style="font-size: small">SessionId 0x100000000021 COMPLETED</span>
<span style="font-size: small">SessionSetup response packet </span>
<span style="font-size: small">FE534D4240000100000000000100800009000000000000000200000000000000FFFE000000000000</span>
<span style="font-size: small">21000000001000003676196AEE8CA17E5D50A53642EF2BE40900000048001D00A11B3019A0030A01</span>
<span style="font-size: small">00A3120410010000000F57444342A2717E00000000</span>
<span style="font-size: small">SessionSetup response header signature 0x3676196AEE8CA17E5D50A53642EF2BE4</span>
<span style="font-size: small">PreauthSession.PreauthIntegrityHashValue </span>
<span style="font-size: small">DECF98A420718718F22090D3580FCC5E484BD310FA1268210C6E86335A8891E767F5BCD99FA5A785</span>
<span style="font-size: small">9D665AD07A73EA94E1BCDB7CFA69A6962A28A244138340B1</span>

<span style="font-size: small">Input cryptographicKey (SessionKey) 0x07B7F69C1E2581662DF6987E88F9E891</span>
<span style="font-size: small">(queried from GSS authenticated context)</span>

<span style="font-size: small">--- Dialect 0x0311 ---</span>
<span style="font-size: small">preauthIntegrityHashValue </span>
<span style="font-size: small">DECF98A420718718F22090D3580FCC5E484BD310FA1268210C6E86335A8891E767F5BCD99FA5A785</span>
<span style="font-size: small">9D665AD07A73EA94E1BCDB7CFA69A6962A28A244138340B1</span>
<span style="font-size: small">CypherId 0x0001</span>
<span style="font-size: small">SessionKey 0x07B7F69C1E2581662DF6987E88F9E891</span>
<span style="font-size: small">SigningKey 0x3DCC82C5795AE27F383242761078C59B</span>
<span style="font-size: small">EncryptionKey 0xDFAAA31AAE40A2485D47AC4DF09FDA1D</span>
<span style="font-size: small">DecryptionKey 0x95C544AEF6072680DA1CE49A68A97FA6</span>
<span style="font-size: small">ApplicationKey 0x7A2F0F73EC2D530879B2913BBFCE242F</span>

<span style="font-size: small">--- Encryption ---</span>

<span style="font-size: small">SessionId 0x100000000021</span>
<span style="font-size: small">SessionKey 0x07B7F69C1E2581662DF6987E88F9E891</span>
<span style="font-size: small">SigningKey 0x3DCC82C5795AE27F383242761078C59B</span>
<span style="font-size: small">EncryptionKey 0xDFAAA31AAE40A2485D47AC4DF09FDA1D</span>
<span style="font-size: small">DecryptionKey 0x95C544AEF6072680DA1CE49A68A97FA6</span>
<span style="font-size: small">ApplicationKey 0x7A2F0F73EC2D530879B2913BBFCE242F</span>
<span style="font-size: small">Header.Command 0x0009 WRITE</span>

<span style="font-size: small">Encryption of the request ---</span>

<span style="font-size: small">Key 0xDFAAA31AAE40A2485D47AC4DF09FDA1D</span>

<span style="font-size: small">Nonce Length 0xb</span>
<span style="font-size: small">AES-128-CCM nonce 0x9F6F1EAAD7E9F24AACD38F</span>

<span style="font-size: small">SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000900010008000000000000000500000000000000FFFE000001000000</span>
<span style="font-size: small">21000000001000000000000000000000000000000000000031007000170000000000000000000000</span>
<span style="font-size: small">0500000004000000010000000400000000000000000000007000000000000000536D623320656E63</span>
<span style="font-size: small">72797074696F6E2074657374696E67</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0xE89551D666DAB8993488F5A97103116C</span>
<span style="font-size: small">transform_header.Nonce 0x9F6F1EAAD7E9F24AACD38F0000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x87</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000021</span>
<span style="font-size: small">Encrypted message </span>
<span style="font-size: small">56A74778199A9D2B6E9C3A376FD88D27680694FED253A313BEB07381AE8689F973ACDB8D716E4477</span>
<span style="font-size: small">803BCE53A92E1B81FA3E965AD9AF2C89C08CE66A344664453B8FC88118EDC9814CF58E92AA465E6E</span>
<span style="font-size: small">FB09958A9FDAD96FBD55B36A710C30D5E7C64AD7B9449F9F17EDD024FE8BA79154F340A82740D1D5</span>
<span style="font-size: small">180C69B0A2DE6A4BA893BD55D3210E</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D42E89551D666DAB8993488F5A97103116C9F6F1EAAD7E9F24AACD38F000000000087000000</span>
<span style="font-size: small">00000100210000000010000056A74778199A9D2B6E9C3A376FD88D27680694FED253A313BEB0<span style="font-size: small">7381</span></span>
<span style="font-size: small">AE8689F973ACDB8D716E4477803BCE53A92E1B81FA3E965AD9AF2C89C08CE66A344664453B8F<span style="font-size: small">C881</span></span>
<span style="font-size: small">18EDC9814CF58E92AA465E6EFB09958A9FDAD96FBD55B36A710C30D5E7C64AD7B9449F9F17ED<span style="font-size: small">D024</span></span>
<span style="font-size: small">FE8BA79154F340A82740D1D5180C69B0A2DE6A4BA893BD55D3210E</span>

<span style="font-size: small">Decryption of the response ---</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D42DD33EC41A927DD51476FE887C2D3C136D96831DD2E8EB7B4000000000000000050000000</span>
<span style="font-size: small">000001002100000000100000F783157E0F6F1C055D746753CA16D20C21088E2A67564E056C2F68A7</span>
<span style="font-size: small">F14F226C3BD809B7A2D52E5FE4ECF49821BC6001733430CF174E2764B3CCB213AAD8BB9FBAF6C15E</span>
<span style="font-size: small">13D9120965390E004A96A3F7</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0xDD33EC41A927DD51476FE887C2D3C136</span>
<span style="font-size: small">transform_header.Nonce 0xD96831DD2E8EB7B40000000000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x50</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000021</span>

<span style="font-size: small">Key 0x95C544AEF6072680DA1CE49A68A97FA6</span>

<span style="font-size: small">Nonce Length 0xb</span>
<span style="font-size: small">AES-128-CCM nonce 0xD96831DD2E8EB7B4000000</span>
<span style="font-size: small">Decrypted SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000900010001000000000000000500000000000000FFFE000001000000</span>
<span style="font-size: small">21000000001000000000000000000000000000000000000011000000170000000000000000000000</span>
<span style="font-size: small">Header.Command 0x0008 READ</span>

<span style="font-size: small">Encryption of the request ---</span>

<span style="font-size: small">Key 0xDFAAA31AAE40A2485D47AC4DF09FDA1D</span>

<span style="font-size: small">Nonce Length 0xb</span>
<span style="font-size: small">AES-128-CCM nonce 0xA0F92E964EDC3049B86E19</span>

<span style="font-size: small">SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000800010008000000000000000600000000000000FFFE000001000000</span>
<span style="font-size: small">21000000001000000000000000000000000000000000000031000000170000000000000000000000</span>
<span style="font-size: small">050000000400000001000000040000000000000000000000000000000000000000</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0x35BF9600C841F0CDA9BD1BC3727B7E36</span>
<span style="font-size: small">transform_header.Nonce 0xA0F92E964EDC3049B86E190000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x71</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000021</span>
<span style="font-size: small">Encrypted message </span>
<span style="font-size: small">C4CCD3EB483A0638E69C99E391E7F64BCC10D6BEE46FEEA258C4BCAF792CB5A6E69283924081806D</span>
<span style="font-size: small">AB64827E9D14A5345D5221AB6DAFCB0E89FC2606B63D92163F4F6C93D1213D86ABF123B93EAD3AEF</span>
<span style="font-size: small">9A3471EFD68A423A00A6E0064D9AE3C842EFFFAD236A3BF25D37F4CD054C97DE18</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D4235BF9600C841F0CDA9BD1BC3727B7E36A0F92E964EDC3049B86E19000000000071000000</span>
<span style="font-size: small">000001002100000000100000C4CCD3EB483A0638E69C99E391E7F64BCC10D6BEE46FEEA258C4<span style="font-size: small">BCAF</span></span>
<span style="font-size: small">792CB5A6E69283924081806DAB64827E9D14A5345D5221AB6DAFCB0E89FC2606B63D92163F4F<span style="font-size: small">6C93</span></span>
<span style="font-size: small">D1213D86ABF123B93EAD3AEF9A3471EFD68A423A00A6E0064D9AE3C842EFFFAD236A3BF25D37<span style="font-size: small">F4CD</span></span>
<span style="font-size: small">054C97DE18</span>

<span style="font-size: small">Decryption of the response ---</span>

<span style="font-size: small">Transformed message </span>
<span style="font-size: small">FD534D42E241A13C7E1EE42ECF1FD69F3B8668C6DA6831DD2E8EB7B4000000000000000067000000</span>
<span style="font-size: small">00000100210000000010000015D67234FC8358D7BA1BF037ABC8EFD41A0A8F9BB04B16DEB1E85606</span>
<span style="font-size: small">BD8C2770823FE6239A286CB3E3D5762ABBD53FD8DE11ED491FE905E146A8FFCE09414AB741103D63</span>
<span style="font-size: small">7E28B19C6BA759B399DCC21FAE24CF2A455A13B215FC2857ABB513927F9F271D1C208B</span>
<span style="font-size: small">transform_header.ProtocolId 0x424d53fd</span>
<span style="font-size: small">transform_header.Signature 0xE241A13C7E1EE42ECF1FD69F3B8668C6</span>
<span style="font-size: small">transform_header.Nonce 0xDA6831DD2E8EB7B40000000000000000</span>
<span style="font-size: small">transform_header.OriginalMessageSize 0x67</span>
<span style="font-size: small">transform_header.Reserved 0x0</span>
<span style="font-size: small">transform_header.Flags 0x0001</span>
<span style="font-size: small">transform_header.SessionId 0x100000000021</span>

<span style="font-size: small">Key 0x95C544AEF6072680DA1CE49A68A97FA6</span>

<span style="font-size: small">Nonce Length 0xb</span>
<span style="font-size: small">AES-128-CCM nonce 0xDA6831DD2E8EB7B4000000</span>
<span style="font-size: small">Decrypted SMB2 packet </span>
<span style="font-size: small">FE534D4240000100000000000800010001000000000000000600000000000000FFFE000001000000</span>
<span style="font-size: small">21000000001000000000000000000000000000000000000011005000170000000000000000000000</span>
<span style="font-size: small">536D623320656E6372797074696F6E2074657374696E67</span>
<h2>Appendix B. How to disable SMB1 on Windows</h2>
<span style="font-size: small">See [KB2696547] <a href="https://support.microsoft.com/en-us/kb/2696547">https://support.microsoft.com/en-us/kb/2696547</a></span>

<span style="font-size: small">In Windows 8.1 / Server 2012 R2:</span>
<span style="font-size: small">•To remove SMB1, use the following PowerShell cmdlet: </span>
<span style="font-size: small">Remove-WindowsFeature FS-SMB1</span>
<span style="font-size: small">•To add SMB1 feature: </span>
<span style="font-size: small">Add-WindowsFeature FS-SMB1</span>

<span style="font-size: small">Windows Client</span>

<span style="font-size: small">•To disable SMBv1 on the SMB client, run the following commands:</span>
<span style="font-size: small">sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi</span>
<span style="font-size: small">sc.exe config mrxsmb10 start= disabled</span>

<span style="font-size: small">•To enable SMBv1 on the SMB client, run the following commands: </span>
<span style="font-size: small">sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi </span>
<span style="font-size: small">sc.exe config mrxsmb10 start= auto</span>

<span style="font-size: small">Windows Server</span>

<span style="font-size: small">In Windows Server 2012 R2:</span>
<span style="font-size: small">Get-SmbServerConfiguration | Select EnableSMB1Protocol, EnableSMB2Protocol</span>
<span style="font-size: small">•To disable SMBv1 on the SMB server, run the following cmdlet: </span>
<span style="font-size: small">Set-SmbServerConfiguration -EnableSMB1Protocol $false</span>
<span style="font-size: small">•To enable SMBv1 on the SMB server, run the following cmdlet:</span>
<span style="font-size: small">Set-SmbServerConfiguration -EnableSMB1Protocol $true</span>

<span style="font-size: small">In older server versions:</span>
<span style="font-size: small">•To disable SMBv1 on the SMB server, run the following cmdlet:</span>
<span style="font-size: small">Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 –Force</span>
<span style="font-size: small">•To enable SMBv1 on the SMB server, run the following cmdlet:</span>
<span style="font-size: small">Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 1 –Force</span>
<h2>[References]</h2>
<span style="font-size: small">Encryption in SMB 3.0: A protocol perspective</span>
<span style="font-size: small"><a href="https://blogs.msdn.com/b/openspecification/archive/2012/10/05/encryption-in-smb-3-0-a-protocol-perspective.aspx">https://blogs.msdn.com/b/openspecification/archive/2012/10/05/encryption-in-smb-3-0-a-protocol-perspective.aspx</a></span>

<span style="font-size: small">What’s new in SMB 3.1.1 in the Windows Server 2016 Technical Preview 2</span>
<span style="font-size: small"><a href="https://blogs.technet.com/b/josebda/archive/2015/05/05/what-s-new-in-smb-3-1-1-in-the-windows-server-technical-preview-2.aspx">https://blogs.technet.com/b/josebda/archive/2015/05/05/what-s-new-in-smb-3-1-1-in-the-windows-server-technical-preview-2.aspx</a></span>

<span style="font-size: small">[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3 Specification</span>

<span style="font-size: small"><a href="https://msdn.microsoft.com/en-us/library/cc246482.aspx">https://msdn.microsoft.com/en-us/library/cc246482.aspx</a> </span>

<span style="font-size: small">[SP800-108] National Institute of Standards and Technology. "Special Publication 800-108, Recommendation for Key Derivation Using Pseudorandom Functions", October 2009, <a href="https://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf">https://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf</a></span>

<span style="font-size: small">[RFC5084] Housley, R., "Using AES-CCM and AES-GCM Authenticated Encryption in the Cryptographic Message Syntax (CMS)", RFC 5084, November 2007, <a href="https://www.ietf.org/rfc/rfc5084.txt">https://www.ietf.org/rfc/rfc5084.txt</a></span>

<span style="font-size: small">SMB3 Secure Dialect Negotiation</span>
<span style="font-size: small"><a href="https://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx">https://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx</a></span>

<span style="font-size: small">How to enable and disable SMBv1, SMBv2, and SMBv3 in Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 2012</span>
<span style="font-size: small"><a href="https://support.microsoft.com/en-us/kb/2696547">https://support.microsoft.com/en-us/kb/2696547</a></span>

<span style="font-size: small">SMB3 PowerShell changes in Windows Server 2012 R2: SMB1 can now be completely removed</span>
<span style="font-size: small"><a href="https://blogs.technet.com/b/josebda/archive/2014/08/11/smb3-powershell-changes-in-windows-server-2012-r2-smb1-can-now-be-completely-removed.aspx">https://blogs.technet.com/b/josebda/archive/2014/08/11/smb3-powershell-changes-in-windows-server-2012-r2-smb1-can-now-be-completely-removed.aspx</a></span>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SMB 3.1.1 Pre-authentication integrity in Windows 10</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/smb-3-1-1-pre-authentication-integrity-in-windows-10</link>
      <pubDate>Tue, 11 Aug 2015 13:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Edgar A Olougouna]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2015/08/11/smb-3-1-1-pre-authentication-integrity-in-windows-10/</guid>
      <description><![CDATA[Pre-authentication integrity is one of the new SMB 3.1.1 security improvements in Windows 10 and...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">Pre-authentication integrity is one of the new SMB 3.1.1 security improvements in Windows 10 and Windows Server 2016 TP2 (technical preview 2). It improves protection from a man-in-the-middle (MITM) attacker in tampering with SMB2&rsquo;s connection establishment and authentication messages. This new feature supersedes &ldquo;secure dialect negotiation&rdquo; introduced in SMB 3.0, which only protected against MITM attempt to downgrade the initially negotiated dialect and capabilities.&nbsp;This blog also&nbsp;provides test vectors for SMB 3.1.1 p<span style="font-size: small;">re-authentication integrity. </span>&nbsp;</span></p>
<h2>Summary</h2>
<p><span style="font-size: small;">Pre-authentication integrity is a mandatory feature in SMB 3.1.1. It protects against any tampering with SMB2&rsquo;s Negotiate and Session Setup messages by leveraging cryptographic hashing. The resulting hash is used as input to derive the session&rsquo;s cryptographic keys, including its signing key. This enables the client and server to mutually trust the connection and session properties.</span></p>
<h2>Overview</h2>
<p><span style="font-size: small;">Signing has been a feature in SMB2 protocol since its inception. In the first two dialects 2.0.2, and 2.1, signing is effectively applied to message exchange once authentication is completed. Prior to SMB 3.0, there was no tampering protection to messages before authentication completion. SMB 3.0 &ldquo;negotiate validation&rdquo; provides some interesting but limited protection; the negotiate validation occurs after the session setup. </span><br /><span style="font-size: small;">SMB 3.1.1 provides end-to-end integrity of pre-authentication messages. The session&rsquo;s cryptographic keys are derived based on a hash of pre-authentication messages:</span><br /><span style="font-size: small;">&bull;&nbsp;This allows the client and server to validate signature or decryption of subsequent authenticated messages.</span><br /><span style="font-size: small;">&bull;&nbsp;The final session setup response is always signed, and as a result the client would fail signature validation in case of pre-authentication message tampering. </span><br /><span style="font-size: small;">&bull;&nbsp;The client must either sign or encrypt the Tree Connect request. This confirms to the server that both mutually derived the same keys, and validates there was no pre-authentication message tampering.</span><br /><span style="font-size: small;">Please note that for guest and anonymous sessions, there is no protection since no keys can be derived.&nbsp;&nbsp;</span></p>
<h2>Pre-auth integrity hash</h2>
<p><span style="font-size: small;">Pre-authentication is the exchange of negotiate and session setup messages until the session&rsquo;s cryptographic keys can be derived, which is the point where authentication is completed. </span><br /><span style="font-size: small;">Let&rsquo;s take the example of an n-leg GSS-API authentication, pre-authentication integrity hash will consist of these SMB2 messages:</span><br /><span style="font-size: small;">&bull;&nbsp;Negotiate request, </span><br /><span style="font-size: small;">&bull;&nbsp;Negotiate response, </span><br /><span style="font-size: small;">&bull;&nbsp;Session setup request (leg-1),</span><br /><span style="font-size: small;">&bull;&nbsp;Session setup response (leg-1),</span><br /><span style="font-size: small;">&bull;&nbsp;. . .</span><br /><span style="font-size: small;">&bull;&nbsp;Session setup request (leg-n),</span><br /><span style="font-size: small;">The processing of Session setup request (leg-n) results in an authentication &ldquo;completed&rdquo; state. The server then calculates the session&rsquo;s signing key. The key derivation takes one of its inputs as the cumulative hash of Negotiate request through Session setup request (leg-n).</span><br /><span style="font-size: small;">Pre-auth-integrity-hash (x) = PreauthIntegrityHash (Concatenate (Pre-auth-integrity-hash (x-1), pre-auth-message (x))) </span><br /><span style="font-size: small;">Where:</span><br /><span style="font-size: small;">x = 1, &hellip;, 2n + 1,</span><br /><span style="font-size: small;">Pre-auth-integrity-hash (0) = zeros,</span><br /><span style="font-size: small;">pre-auth-message (1) = Negotiate request, </span><br /><span style="font-size: small;">. . . </span><br /><span style="font-size: small;">pre-auth-message (2n + 1) = Session setup request (leg-n).</span><br /><span style="font-size: small;">For SMB 3.1.1, the PreauthIntegrityHash function is SHA-512, the standard specified in [FIPS180-4].</span><br /><span style="font-size: small;">The hash value used as input for key derivation is:</span><br /><span style="font-size: small;">Session.PreauthIntegrityHashValue = Pre-auth-integrity-hash (2n + 1)</span><br /><span style="font-size: small;">Note that the final session setup response is not part of the integrity hash calculation.</span><br /><span style="font-size: small;">&bull;&nbsp;Session setup response(leg-n)</span><br /><span style="font-size: small;">However, this session setup response is signed (for SMB 3.1.1, AES-128-CMAC with SigningKey), allowing the client to verify the signature, and authenticate the source of the data. A successful signature verification, of a subsequent message (e.g. TreeConnect), validates that the client and server computed the same PreauthIntegrityHashValue and derived the same key.</span><br /><span style="font-size: small;">NOTE: Since the hash is cumulative and there is no validation until the final step, implementers could approach the PreauthIntegrityHashValue calculation in many ways. One could choose to compute the temporary hash at each step, i.e. message sent or received. Another way is to calculate the temporary hash on a pair of request and response at a time except for the final session setup leg. Yet, another approach is to iterate through a number requests and responses at once. It all depends on whether the design can temporarily hold vectors of requests and responses. This should be a design consideration in case the implementation intends to handle applications where sessions will be very short lived, or on a server with a high volume of authenticated sessions.&nbsp;</span></p>
<h2>Pre-auth integrity capability negotiate context</h2>
<p><span style="font-size: small;">If the client includes 0x0311 in the SMB2 NEGOTIATE&rsquo;s Dialects array (i.e. the client supports SMB 3.1.1), it must add the SMB2_PREAUTH_INTEGRITY_CAPABILITIES negotiate context, as specified in MS-SMB2. </span><br /><span style="font-size: small;">If the server selects SMB 3.1.1 dialect, it must convey the selected integrity hash algorithm by including a SMB2_PREAUTH_INTEGRITY_CAPABILITIES negotiate context in the NEGOTIATE response. </span><br /><span style="font-size: small;">The pre-authentication integrity negotiate context has the same format in the Negotiate request and response, except that the response context must have a HashAlgorithmCount set to 1. In Windows 10, the pre-authentication integrity hash algorithm is SHA-512.</span><br /><span style="font-size: small;">Note that Windows 10 and Windows Server 2016 TP2 use 32 bytes of randomly generated Salt. The salt value and its length are implementation-dependent, and as a result, it is recommended to use a secure PRNG to prevent from dictionary attacks.</span></p>
<h2>SigningKey derivation</h2>
<p><span style="font-size: small;">The signing key is derived as specified in [MS-SMB2]:</span><br /><span style="font-size: small;">SigningKey = SMB3KDF (SessionKey, "SMBSigningKey\0", Session.PreauthIntegrityHashValue)</span><br /><span style="font-size: small;">SMB3KDF() is defined as the key derivation function (KDF) in Counter Mode, as specified in [SP800-108] section 5.1, with 'r' value of 32 and 'L' value of 128, and HMAC-SHA256 as the PRF.</span><br /><span style="font-size: small;">SigningKey is the leftmost L bits of KDF result.</span><br /><span style="font-size: small;">The SessionKey is the key derivation key. It set to the first 16 bytes of the cryptographic key queried from the GSS protocol (e.g. Kerberos [MS-KILE], or NTLM [MS-NLMP]) for this authenticated context. If the cryptographic key is less than 16 bytes, it is right-padded with zero bytes. Extracting the session key from GSS-API is implementation-dependent. In SSPI (Microsoft&rsquo;s implementation of GSS-API), the session key is extracted by using QueryContextAttributes with SECPKG_ATTR_SESSION_KEY. </span><br /><span style="font-size: small;">In NTLM, the SessionKey is the ExportedSessionKey returned when QueryContextAttributes is called with SECPKG_ATTR_SESSION_KEY. ExportedSessionKey is described in MS-NLMP.</span><br /><span style="font-size: small;">In Kerberos [RFC4120], the SessionKey returned for QueryContextAttributes call with SECPKG_ATTR_SESSION_KEY is either the sub-session key (subkey) if it was negotiated during KRB_AP_REQ/KRB_AP_REP exchange, or the session key from the ticket if no subkey was negotiated.</span><br /><span style="font-size: small;">The label is &ldquo;SMBSigningKey\0&rdquo;.</span><br /><span style="font-size: small;">The context is Session.PreauthIntegrityHashValue.</span><br /><span style="font-size: small;">Session.PreauthIntegrityHashValue is calculated as outlined earlier.</span></p>
<h2>Proxy and traffic accelerator</h2>
<p><span style="font-size: small;">Pre-authentication integrity might hinder solutions that rely on modifying SMB2 packets. For example, a so-called WAN accelerator needs to accept negotiate contexts. Any change to the pre-authentication packets would require to be transparent to the client (Kerberos constraint delegation, authentication token). On one hand, the client and device in the middle must derive the same keys. One the other hand, the device and server must arrive at the same keys once the authenticated context is completed.</span><br /><span style="font-size: small;">This should not be seen as an issue. If the device was able to decode traffic, it is because it somehow has access to the user&rsquo;s secret password or is allowed to act on behalf on the user. This is typically enabled through participating in a domain, or performing constraint delegation.&nbsp;</span></p>
<h2>Windows 10 RequireSecureNegotiate interop with SMB 3.0.x down-level servers</h2>
<p><span style="font-size: small;">When a Windows 10 negotiates SMB 2.x.x or 3.0.x with a down-level server (e.g. Windows 2008 / 2008, R2, Windows Server 2012 / 2012 R2), it will always send FSCTL_VALIDATE_NEGOTIATE_INFO to attempt performing dialect negotiation validation. Most, if not all, third party implementations comply to secure negotiate validation IOCTL, or lack thereof, to proper handling of an unsupported IOCTL. This makes unnecessary the need for a RequireSecureNegotiate workaround. </span><br /><span style="font-size: small;">In a nutshell, the RequireSecureNegotiate registry setting has been removed in Windows 10 release. It is no longer allowed to disable secure negotiate from Windows 10 clients when connecting to down-level servers. </span><br /><span style="font-size: small;">Down-level servers which do not support the FSCTL_VALIDATE_NEGOTIATE_INFO are mandated to sign the error response since the request is signed. Typical error codes are STATUS_NOT_SUPPORTED, STATUS_INVALID_DEVICE_REQUEST or STATUS_FILE_CLOSED.</span></p>
<h2>Conclusion</h2>
<p><span style="font-size: small;">While pre-authentication integrity protects the session establishment phase in SMB 3.1.1, enabling signing would generally offer integrity check at large and protect from an attacker tampering with any packet. Signing has a cost, but its benefit generally outweighs the performance effect.&nbsp;</span></p>
<h2><strong>Appendix: Test vector for SMB 3.1.1 pre-authentication integrity</strong></h2>
<p><span style="font-size: small;">This sample data should be considered &ldquo;as-is&rdquo;. It should also be noted that</span><br /><span style="font-size: small;">examples do not replace normative protocol specifications. The reference must</span><br /><span style="font-size: small;">be [MS-SMB2].</span></p>
<p><span style="font-size: small;">Our test client negotiates SMB 3.1.1 and communicates with a Windows server</span><br /><span style="font-size: small;">2016 TP2.</span></p>
<p><span style="font-size: small;">Here are examples of the major steps for pre-authentication integrity</span><br /><span style="font-size: small;">computation:</span></p>
<h2><strong>Appendix A. Pre-authentication integrity and encryption negotiate contexts</strong></h2>
<h3><strong>Appendix A.1 Windows 10 with its supported negotiate contexts </strong></h3>
<p>&nbsp;</p>
<p>Header.Command 0x0000 NEGOTIATE</p>
<p>&nbsp;</p>
<p>Preauth integrity hash capabilities ---</p>
<p>PreauthIntegrityCaps.HashAlgorithmCount 0x1</p>
<p>PreauthIntegrityCaps.SaltLength 0x20</p>
<p>PreauthIntegrityCaps.HashAlgorithms 0x0001</p>
<p>PreauthIntegrityCaps.Salt</p>
<p>FA49E6578F1F3A9F4CD3E9CC14A67AA884B3D05844E0E5A118225C15887F32FF</p>
<p>&nbsp;</p>
<p>Encryption capabilites ---</p>
<p>EncryptionCaps.CipherCount 0x2</p>
<p>EncryptionCaps.Ciphers[0] 0x0002</p>
<p>EncryptionCaps.Ciphers[1] 0x0001</p>
<p>&nbsp;</p>
<p>Connection.PreauthIntegrityHashId 0x0001</p>
<p>&nbsp;</p>
<p>NEGOTIATE Request</p>
<p>&nbsp;</p>
<p>Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000</p>
<p>Negotiate request packet</p>
<p>FE534D4240000100000000000000800000000000000000000100000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000024000500000000003F000000ECD86F32</p>
<p>6276024F9F7752B89BB33F3A70000000020000000202100200030203110300000100260000000000</p>
<p>010020000100FA49E6578F1F3A9F4CD3E9CC14A67AA884B3D05844E0E5A118225C15887F32FF0000</p>
<p>0200060000000000020002000100</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate request<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000FE534D42400001000000000000008000</p>
<p>00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000024000500000000003F000000ECD86F326276024F9F7752B89BB33F3A70000000</p>
<p>020000000202100200030203110300000100260000000000010020000100FA49E6578F1F3A9F4CD3</p>
<p>E9CC14A67AA884B3D05844E0E5A118225C15887F32FF00000200060000000000020002000100</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0</p>
<p>CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426</p>
<p>&nbsp;</p>
<p>NEGOTIATE Response</p>
<p>&nbsp;</p>
<p>Updating Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0</p>
<p>CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426</p>
<p>Negotiate response packet</p>
<p>FE534D4240000100000000000000010001000000000000000100000000000000FFFE000000000000</p>
<p>000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942</p>
<p>BDCE5D60F09AB3FB2F000000000080000000800000008000D8DAE5ADCBAED00109094AB095AED001</p>
<p>80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182</p>
<p>3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000</p>
<p>60000000700000007C7CC0FD06D6362D02DDE1CF343BFE292900F49750B4AA97934D9C4296B26E51</p>
<p>FD370471B235E15A50DAE15BD5489C87000000000000000060000000010000000000000000000000</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000</p>
<p>7C7CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000</p>
<p>3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562</p>
<p>6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075</p>
<p>626C6963204B6579010026000000000001002000010060A3C3B95C3C7CCD51EC536648D9B3AC74C4</p>
<p>83CA5B65385A251117BEB30712E50000020004000000000001000200</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate response<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>DD94EFC5321BB618A2E208BA8920D2F422992526947A409B5037DE1E0FE8C7362B8C47122594CDE0</p>
<p>CE26AA9DFC8BCDBDE0621957672623351A7540F1E54A0426FE534D42400001000000000000000100</p>
<p>01000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2F00000000008000</p>
<p>0000800000008000D8DAE5ADCBAED00109094AB095AED00180004001C00100006082013C06062B06</p>
<p>01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A</p>
<p>A282010C048201084E45474F45585453010000000000000060000000700000007C7CC0FD06D6362D</p>
<p>02DDE1CF343BFE292900F49750B4AA97934D9C4296B26E51FD370471B235E15A50DAE15BD5489C87</p>
<p>0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308</p>
<p>4E45474F45585453030000000100000040000000980000007C7CC0FD06D6362D02DDE1CF343BFE29</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F</p>
<p>06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130</p>
<p>1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000</p>
<p>01002000010060A3C3B95C3C7CCD51EC536648D9B3AC74C483CA5B65385A251117BEB30712E50000</p>
<p>020004000000000001000200</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99</p>
<p>7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513</p>
<p>&nbsp;</p>
<p>Add NEW SessionId 0x17592186044441 to Preauth Integrity hash table with<br />value</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99</p>
<p>7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x17592186044441</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99</p>
<p>7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000019000001010000000000000058004A00</p>
<p>0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A</p>
<p>04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000</p>
<p>000F</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>324BFA92A4F3A190E466EBEA08D9C110DC88BFED758D9846ECC6F541CC1D02AE3C94A79F36011E99</p>
<p>7E13F841B91B50957AD07B19C8E2539C0B23FDAE09D2C513FE534D42400001000000000001008000</p>
<p>00000000000000000200000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000019000001010000000000000058004A000000000000000000604806062B060105</p>
<p>0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782</p>
<p>08E200000000000000000000000000000000060380250000000F</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33</p>
<p>197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>&nbsp;</p>
<p>&nbsp;--- STATUS_MORE_PROCESSING_REQUIRED<br />- Updating Preauth integrity hash ---</p>
<p>PreauthSession.SessionId 0x17592186044441</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33</p>
<p>197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100160000C00100010001000000000000000200000000000000FFFE000000000000</p>
<p>190000000010000000000000000000000000000000000000090000004800B300A181B03081ADA003</p>
<p>0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038</p>
<p>00000015828AE20D1D8BA31179D008000000000000000050005000440000000A0092270000000F53</p>
<p>005500540033003100310002000C0053005500540033003100310001000C00530055005400330031</p>
<p>00310004000C0053005500540033003100310003000C0053005500540033003100310007000800A1</p>
<p>A1F5ADCBAED00100000000</p>
<p>SessionSetup response header signature 0x00000000000000000000000000000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />response packet</p>
<p>SHA-512 Input Hash Data</p>
<p>AC0B0F2B9986257700365E416D142A6EDC96DF03594A19E52A15F6BD0D041CD5D432F8ED42C55E33</p>
<p>197A50C9EC00F1462B50C592211B1471A04B56088FDFD5F9FE534D4240000100160000C001000100</p>
<p>01000000000000000200000000000000FFFE00000000000019000000001000000000000000000000</p>
<p>0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202</p>
<p>0AA281970481944E544C4D53535000020000000C000C003800000015828AE20D1D8BA31179D00800</p>
<p>0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053</p>
<p>005500540033003100310001000C0053005500540033003100310004000C00530055005400330031</p>
<p>00310003000C0053005500540033003100310007000800A1A1F5ADCBAED00100000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336</p>
<p>4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x17592186044441</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336</p>
<p>4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000300000000000000FFFE000000000000</p>
<p>1900000000100000000000000000000000000000000000001900000101000000000000005800CF01</p>
<p>0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000</p>
<p>001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000</p>
<p>001000100096010000158288E2060380250000000FECAC77A5F385A8BF9C38C706EEEDDCD3530055</p>
<p>005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049</p>
<p>0056004500520033003100310000000000000000000000000000000000000000000000000063078E</p>
<p>B639FE03E20A231C3AE3BF23080101000000000000A1A1F5ADCBAED001BC4AD05F223CC90F000000</p>
<p>0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055</p>
<p>00540033003100310003000C0053005500540033003100310007000800A1A1F5ADCBAED001060004</p>
<p>00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B</p>
<p>8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016</p>
<p>0063006900660073002F005300550054003300310031000000000000000000000000003B9BDFF38F</p>
<p>5EE8F9663F11A0F4C03A78A31204100100000063775A9A5FD97F0600000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>2729E3440DFDDD839E37193F6E8F20C20CEFB3469E453A70CD980EEC06B8835740A7376008563336</p>
<p>4C8989895ECE81BF102DEEB14D4B7D48AFA76901A7A38387FE534D42400001000000000001008000</p>
<p>00000000000000000300000000000000FFFE00000000000019000000001000000000000000000000</p>
<p>00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7</p>
<p>A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000</p>
<p>000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380</p>
<p>250000000FECAC77A5F385A8BF9C38C706EEEDDCD3530055005400330031003100610064006D0069</p>
<p>006E006900730074007200610074006F007200440052004900560045005200330031003100000000</p>
<p>00000000000000000000000000000000000000000063078EB639FE03E20A231C3AE3BF2308010100</p>
<p>0000000000A1A1F5ADCBAED001BC4AD05F223CC90F0000000002000C005300550054003300310031</p>
<p>0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055</p>
<p>00540033003100310007000800A1A1F5ADCBAED00106000400020000000800300030000000000000</p>
<p>000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0</p>
<p>CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054</p>
<p>003300310031000000000000000000000000003B9BDFF38F5EE8F9663F11A0F4C03A78A312041001</p>
<p>00000063775A9A5FD97F0600000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97</p>
<p>51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>SessionId 0x17592186044441 COMPLETED</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100000000000100800009000000000000000300000000000000FFFE000000000000</p>
<p>1900000000100000EBE146DA120BA25FC3376A49DFE31BC10900000048001D00A11B3019A0030A01</p>
<p>00A3120410010000003B453CDC3524164200000000</p>
<p>SessionSetup response header signature 0xEBE146DA120BA25FC3376A49DFE31BC1</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97</p>
<p>51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01</p>
<p>&nbsp;</p>
<p>Input cryptographicKey (SessionKey) 0x270E1BA896585EEB7AF3472D3B4C75A7</p>
<p>(queried from GSS authenticated context)</p>
<p>&nbsp;</p>
<p>--- Dialect 0x0311 ---</p>
<p>preauthIntegrityHashValue</p>
<p>0DD13628CC3ED218EF9DF9772D436D0887AB9814BFAE63A80AA845F36909DB7928622DDDAD522D97</p>
<p>51640A459762C5A9D6BB084CBB3CE6BDADEF5D5BCE3C6C01</p>
<p>CypherId 0x0002</p>
<p>SessionKey 0x270E1BA896585EEB7AF3472D3B4C75A7</p>
<p>SigningKey 0x73FE7A9A77BEF0BDE49C650D8CCB5F76</p>
<p>&nbsp;</p>
<h3><strong>Appendix A.2. Pre-authentication integrity and encryption (AES-CCM) negotiate contexts&nbsp;<br /></strong></h3>
<p>&nbsp;</p>
<p>Header.Command 0x0000 NEGOTIATE</p>
<p>&nbsp;</p>
<p>Preauth integrity hash capabilities ---</p>
<p>PreauthIntegrityCaps.HashAlgorithmCount 0x1</p>
<p>PreauthIntegrityCaps.SaltLength 0x20</p>
<p>PreauthIntegrityCaps.HashAlgorithms 0x0001</p>
<p>PreauthIntegrityCaps.Salt</p>
<p>BE43C3C288C4D3992CD82559E382F0AACEB5A1D936A1BFF07AD1E0C18DB0CA86</p>
<p>&nbsp;</p>
<p>Encryption capabilites ---</p>
<p>EncryptionCaps.CipherCount 0x1</p>
<p>EncryptionCaps.Ciphers[0] 0x0001</p>
<p>&nbsp;</p>
<p>Connection.PreauthIntegrityHashId 0x0001</p>
<p>&nbsp;</p>
<p>NEGOTIATE Request</p>
<p>&nbsp;</p>
<p>Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000</p>
<p>Negotiate request packet</p>
<p>FE534D4240000100000000000000800000000000000000000100000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000024000500000000003F000000C318232F</p>
<p>0EDFFB4D99991F725DA93B3E70000000020000000202100200030203110300000100260000000000</p>
<p>010020000100BE43C3C288C4D3992CD82559E382F0AACEB5A1D936A1BFF07AD1E0C18DB0CA860000</p>
<p>020004000000000001000100</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate request<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000FE534D42400001000000000000008000</p>
<p>00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000024000500000000003F000000C318232F0EDFFB4D99991F725DA93B3E70000000</p>
<p>020000000202100200030203110300000100260000000000010020000100BE43C3C288C4D3992CD8</p>
<p>2559E382F0AACEB5A1D936A1BFF07AD1E0C18DB0CA860000020004000000000001000100</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>BD11D3C338C8F993B3C9CD75420F331FCBFD6A389ADCEA930593C14D5EFDA3E38F1B0320BD03AACC</p>
<p>78CEA25D9DEFD89324ECA8595F2DAE4C0E01FBEA4A54A428</p>
<p>&nbsp;</p>
<p>NEGOTIATE Response</p>
<p>&nbsp;</p>
<p>Updating Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>BD11D3C338C8F993B3C9CD75420F331FCBFD6A389ADCEA930593C14D5EFDA3E38F1B0320BD03AACC</p>
<p>78CEA25D9DEFD89324ECA8595F2DAE4C0E01FBEA4A54A428</p>
<p>Negotiate response packet</p>
<p>FE534D4240000100000000000000010001000000000000000100000000000000FFFE000000000000</p>
<p>000000000000000000000000000000000000000000000000410001001103020039CBCAF329714942</p>
<p>BDCE5D60F09AB3FB2F000000000080000000800000008000CDCEA973CAAED00109094AB095AED001</p>
<p>80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182</p>
<p>3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000</p>
<p>6000000070000000747CC0FD06D6362D02DDE1CF343BFE299B5A978ED39ECF7F343F2F72B151E5C2</p>
<p>F427966D191C624A19F30E0F7132F3D5000000000000000060000000010000000000000000000000</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000</p>
<p>747CC0FD06D6362D02DDE1CF343BFE295C33530DEAF90D4DB2EC4AE3786EC3084000000058000000</p>
<p>3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562</p>
<p>6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075</p>
<p>626C6963204B65790100260000000000010020000100ED81E13FE1C5E910AE1299BE60FCA6F54B09</p>
<p>42FA0FB2A92285A947C68AB988810000020004000000000001000100</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate response<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>BD11D3C338C8F993B3C9CD75420F331FCBFD6A389ADCEA930593C14D5EFDA3E38F1B0320BD03AACC</p>
<p>78CEA25D9DEFD89324ECA8595F2DAE4C0E01FBEA4A54A428FE534D42400001000000000000000100</p>
<p>01000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>0000000000000000410001001103020039CBCAF329714942BDCE5D60F09AB3FB2F00000000008000</p>
<p>0000800000008000CDCEA973CAAED00109094AB095AED00180004001C00100006082013C06062B06</p>
<p>01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A</p>
<p>A282010C048201084E45474F4558545301000000000000006000000070000000747CC0FD06D6362D</p>
<p>02DDE1CF343BFE299B5A978ED39ECF7F343F2F72B151E5C2F427966D191C624A19F30E0F7132F3D5</p>
<p>0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308</p>
<p>4E45474F4558545303000000010000004000000098000000747CC0FD06D6362D02DDE1CF343BFE29</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F</p>
<p>06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130</p>
<p>1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000</p>
<p>010020000100ED81E13FE1C5E910AE1299BE60FCA6F54B0942FA0FB2A92285A947C68AB988810000</p>
<p>020004000000000001000100</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>7744458C12FB7387C68B767ED06E8A684BB0AA1F4E49E6C195B55CB47138F2BCDD9489EC5CF10FEE</p>
<p>04EF5192817EE3D6694F34965D33C177F296F915452B929B</p>
<p>&nbsp;</p>
<p>Add NEW SessionId 0x17592186044425 to Preauth Integrity hash table with<br />value</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>7744458C12FB7387C68B767ED06E8A684BB0AA1F4E49E6C195B55CB47138F2BCDD9489EC5CF10FEE</p>
<p>04EF5192817EE3D6694F34965D33C177F296F915452B929B</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x17592186044425</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>7744458C12FB7387C68B767ED06E8A684BB0AA1F4E49E6C195B55CB47138F2BCDD9489EC5CF10FEE</p>
<p>04EF5192817EE3D6694F34965D33C177F296F915452B929B</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000019000001010000000000000058004A00</p>
<p>0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A</p>
<p>04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000</p>
<p>000F</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>7744458C12FB7387C68B767ED06E8A684BB0AA1F4E49E6C195B55CB47138F2BCDD9489EC5CF10FEE</p>
<p>04EF5192817EE3D6694F34965D33C177F296F915452B929BFE534D42400001000000000001008000</p>
<p>00000000000000000200000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000019000001010000000000000058004A000000000000000000604806062B060105</p>
<p>0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782</p>
<p>08E200000000000000000000000000000000060380250000000F</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>983C28E03CE2F30CA2CF648C95D489DD16E51E027A4A9F7C05A1F9E888AF289C112C77C8A77ACEB1</p>
<p>2EEC19DD6BD550C2303233B11A08F70609D4484D7CDEC58C</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>&nbsp;</p>
<p>&nbsp;--- STATUS_MORE_PROCESSING_REQUIRED<br />- Updating Preauth integrity hash ---</p>
<p>PreauthSession.SessionId 0x17592186044425</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>983C28E03CE2F30CA2CF648C95D489DD16E51E027A4A9F7C05A1F9E888AF289C112C77C8A77ACEB1</p>
<p>2EEC19DD6BD550C2303233B11A08F70609D4484D7CDEC58C</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100160000C00100010001000000000000000200000000000000FFFE000000000000</p>
<p>090000000010000000000000000000000000000000000000090000004800B300A181B03081ADA003</p>
<p>0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038</p>
<p>00000015828AE2395571B0B34E928C000000000000000050005000440000000A0092270000000F53</p>
<p>005500540033003100310002000C0053005500540033003100310001000C00530055005400330031</p>
<p>00310004000C0053005500540033003100310003000C0053005500540033003100310007000800CC</p>
<p>2FBB73CAAED00100000000</p>
<p>SessionSetup response header signature 0x00000000000000000000000000000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />response packet</p>
<p>SHA-512 Input Hash Data</p>
<p>983C28E03CE2F30CA2CF648C95D489DD16E51E027A4A9F7C05A1F9E888AF289C112C77C8A77ACEB1</p>
<p>2EEC19DD6BD550C2303233B11A08F70609D4484D7CDEC58CFE534D4240000100160000C001000100</p>
<p>01000000000000000200000000000000FFFE00000000000009000000001000000000000000000000</p>
<p>0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202</p>
<p>0AA281970481944E544C4D53535000020000000C000C003800000015828AE2395571B0B34E928C00</p>
<p>0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053</p>
<p>005500540033003100310001000C0053005500540033003100310004000C00530055005400330031</p>
<p>00310003000C0053005500540033003100310007000800CC2FBB73CAAED00100000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>C9CA587360D51A1DA5E61E208391B6E5C1846ADC5E5C961614A3A533DE3943E6314C8AE9DE7CDBD1</p>
<p>7E4068ED21F97DEBE879F13724CF3FF21B2C86D99BA59B87</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x17592186044425</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>C9CA587360D51A1DA5E61E208391B6E5C1846ADC5E5C961614A3A533DE3943E6314C8AE9DE7CDBD1</p>
<p>7E4068ED21F97DEBE879F13724CF3FF21B2C86D99BA59B87</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000300000000000000FFFE000000000000</p>
<p>0900000000100000000000000000000000000000000000001900000101000000000000005800CF01</p>
<p>0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000</p>
<p>001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000</p>
<p>001000100096010000158288E2060380250000000F308F9AF7839280D351E663E84AD3957F530055</p>
<p>005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049</p>
<p>005600450052003300310031000000000000000000000000000000000000000000000000001EAF5A</p>
<p>8F20782DD3B7DFC1562EBFE9240101000000000000CC2FBB73CAAED0012B6C3234196EE8BF000000</p>
<p>0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055</p>
<p>00540033003100310003000C0053005500540033003100310007000800CC2FBB73CAAED001060004</p>
<p>00020000000800300030000000000000000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B</p>
<p>8E0EBA5A6DFD9D07A31D11B548F8C9D0CC0A00100000000000000000000000000000000000090016</p>
<p>0063006900660073002F00530055005400330031003100000000000000000000000000AEF242481A</p>
<p>FBFB82BEDBE68A4F5742F2A3120410010000007FEE0708D69AD22600000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>C9CA587360D51A1DA5E61E208391B6E5C1846ADC5E5C961614A3A533DE3943E6314C8AE9DE7CDBD1</p>
<p>7E4068ED21F97DEBE879F13724CF3FF21B2C86D99BA59B87FE534D42400001000000000001008000</p>
<p>00000000000000000300000000000000FFFE00000000000009000000001000000000000000000000</p>
<p>00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7</p>
<p>A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000</p>
<p>000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380</p>
<p>250000000F308F9AF7839280D351E663E84AD3957F530055005400330031003100610064006D0069</p>
<p>006E006900730074007200610074006F007200440052004900560045005200330031003100000000</p>
<p>0000000000000000000000000000000000000000001EAF5A8F20782DD3B7DFC1562EBFE924010100</p>
<p>0000000000CC2FBB73CAAED0012B6C3234196EE8BF0000000002000C005300550054003300310031</p>
<p>0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055</p>
<p>00540033003100310007000800CC2FBB73CAAED00106000400020000000800300030000000000000</p>
<p>000000000000300000B61FEFCAA857EA57BF1EDCEBF8974B8E0EBA5A6DFD9D07A31D11B548F8C9D0</p>
<p>CC0A001000000000000000000000000000000000000900160063006900660073002F005300550054</p>
<p>00330031003100000000000000000000000000AEF242481AFBFB82BEDBE68A4F5742F2A312041001</p>
<p>0000007FEE0708D69AD22600000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>BD57317658D28E7599C2491165F5D6FB36AD0AD65833774A6684D07F83EF2EBAB8726C1D76704AF3</p>
<p>25285A70FCBAD053F39EF4C031AE67C56006C50C6D349EC6</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>SessionId 0x17592186044425 COMPLETED</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100000000000100800009000000000000000300000000000000FFFE000000000000</p>
<p>090000000010000021AC4DB12F2F6431207BA653FB805C290900000048001D00A11B3019A0030A01</p>
<p>00A312041001000000F19063CADAA8BE2100000000</p>
<p>SessionSetup response header signature 0x21AC4DB12F2F6431207BA653FB805C29</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>BD57317658D28E7599C2491165F5D6FB36AD0AD65833774A6684D07F83EF2EBAB8726C1D76704AF3</p>
<p>25285A70FCBAD053F39EF4C031AE67C56006C50C6D349EC6</p>
<p>&nbsp;</p>
<p>Input cryptographicKey (SessionKey) 0xFD67875E7DF37605F5A9D226991A8782</p>
<p>(queried from GSS authenticated context)</p>
<p>&nbsp;</p>
<p>--- Dialect 0x0311 ---</p>
<p>preauthIntegrityHashValue</p>
<p>BD57317658D28E7599C2491165F5D6FB36AD0AD65833774A6684D07F83EF2EBAB8726C1D76704AF3</p>
<p>25285A70FCBAD053F39EF4C031AE67C56006C50C6D349EC6</p>
<p>CypherId 0x0001</p>
<p>SessionKey 0xFD67875E7DF37605F5A9D226991A8782</p>
<p>SigningKey 0xD9AE56D84460F692E15673D7AC357904</p>
<p>&nbsp;</p>
<h2><strong>Appendix B. Pre-authentication integrity negotiate context only</strong></h2>
<p>&nbsp;</p>
<p>Header.Command 0x0000 NEGOTIATE</p>
<p>&nbsp;</p>
<p>Preauth integrity hash ---</p>
<p>PreauthIntegrityCaps.HashAlgorithmCount 0x1</p>
<p>PreauthIntegrityCaps.SaltLength 0x20</p>
<p>PreauthIntegrityCaps.HashAlgorithms 0x0001</p>
<p>PreauthIntegrityCaps.Salt</p>
<p>E2D024DB75ED67B6323EDB6BD24FC4C97ECD893481CE1BEFDBD1DE3D09DF9DB5</p>
<p>&nbsp;</p>
<p>Connection.PreauthIntegrityHashId 0x0001</p>
<p>&nbsp;</p>
<p>NEGOTIATE Request</p>
<p>&nbsp;</p>
<p>Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000</p>
<p>Negotiate request packet</p>
<p>FE534D4240000100000000000000800000000000000000000100000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000024000500000000003F0000004C3DB6FB</p>
<p>51377A45AB915E5700F9D91B70000000010000000202100200030203110300000100260000000000</p>
<p>010020000100E2D024DB75ED67B6323EDB6BD24FC4C97ECD893481CE1BEFDBD1DE3D09DF9DB5</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate request<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>00000000000000000000000000000000000000000000000000000000000000000000000000000000</p>
<p>000000000000000000000000000000000000000000000000FE534D42400001000000000000008000</p>
<p>00000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000024000500000000003F0000004C3DB6FB51377A45AB915E5700F9D91B70000000</p>
<p>010000000202100200030203110300000100260000000000010020000100E2D024DB75ED67B6323E</p>
<p>DB6BD24FC4C97ECD893481CE1BEFDBD1DE3D09DF9DB5</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>EF7D572595297374B39788024797DAA020D66D3DF9D3A893CF2CA0442AEE16C6C154F1BC185CAF3F</p>
<p>660139347B9C4CA231161CA8A16073F058B5422045DE7C65</p>
<p>&nbsp;</p>
<p>NEGOTIATE Response</p>
<p>&nbsp;</p>
<p>Updating Preauth integrity hash ---</p>
<p>Current</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>EF7D572595297374B39788024797DAA020D66D3DF9D3A893CF2CA0442AEE16C6C154F1BC185CAF3F</p>
<p>660139347B9C4CA231161CA8A16073F058B5422045DE7C65</p>
<p>Negotiate response packet</p>
<p>FE534D4240000100000000000000010001000000000000000100000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000041000100110301001DE6C96123D11C40</p>
<p>9509F58B06CEB6E52F000000000080000000800000008000ECAC634232B1D001112265502BB1D001</p>
<p>80004001C00100006082013C06062B0601050502A08201303082012CA01A3018060A2B0601040182</p>
<p>3702021E060A2B06010401823702020AA282010C048201084E45474F455854530100000000000000</p>
<p>6000000070000000E396D6D84D7EBFC97CE3BD8B1761B727F0DDDDFF536372E805A6CD3A8CCC5C0F</p>
<p>54F850C98DF6C8C9F7A88AE1FF70590A000000000000000060000000010000000000000000000000</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC3084E45474F4558545303000000010000004000000098000000</p>
<p>E396D6D84D7EBFC97CE3BD8B1761B7275C33530DEAF90D4DB2EC4AE3786EC3084000000058000000</p>
<p>3056A05430523027802530233121301F06035504031318546F6B656E205369676E696E6720507562</p>
<p>6C6963204B65793027802530233121301F06035504031318546F6B656E205369676E696E67205075</p>
<p>626C6963204B657901002600000000000100200001003208BCEB8827C388303D3E51E2D90F710898</p>
<p>D12B04522B5D871A0C031FC7B7B5</p>
<p>Concatenate Connection.PreauthIntegrityHashValue and Negotiate response<br />packet</p>
<p>SHA-512 Input Hash Data</p>
<p>EF7D572595297374B39788024797DAA020D66D3DF9D3A893CF2CA0442AEE16C6C154F1BC185CAF3F</p>
<p>660139347B9C4CA231161CA8A16073F058B5422045DE7C65FE534D42400001000000000000000100</p>
<p>01000000000000000100000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000041000100110301001DE6C96123D11C409509F58B06CEB6E52F00000000008000</p>
<p>0000800000008000ECAC634232B1D001112265502BB1D00180004001C00100006082013C06062B06</p>
<p>01050502A08201303082012CA01A3018060A2B06010401823702021E060A2B06010401823702020A</p>
<p>A282010C048201084E45474F4558545301000000000000006000000070000000E396D6D84D7EBFC9</p>
<p>7CE3BD8B1761B727F0DDDDFF536372E805A6CD3A8CCC5C0F54F850C98DF6C8C9F7A88AE1FF70590A</p>
<p>0000000000000000600000000100000000000000000000005C33530DEAF90D4DB2EC4AE3786EC308</p>
<p>4E45474F4558545303000000010000004000000098000000E396D6D84D7EBFC97CE3BD8B1761B727</p>
<p>5C33530DEAF90D4DB2EC4AE3786EC30840000000580000003056A05430523027802530233121301F</p>
<p>06035504031318546F6B656E205369676E696E67205075626C6963204B6579302780253023312130</p>
<p>1F06035504031318546F6B656E205369676E696E67205075626C6963204B65790100260000000000</p>
<p>0100200001003208BCEB8827C388303D3E51E2D90F710898D12B04522B5D871A0C031FC7B7B5</p>
<p>New</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>7ECC09ACEC6034FF40F8B0C9F6662C95E2532E6F54D29E922138A65D592FD58FA437712034CD2542</p>
<p>55EAA10BB823507EFCF1654195512A8445D9DE2609F47741</p>
<p>&nbsp;</p>
<p>Add NEW SessionId 0x30786325577741 to Preauth Integrity hash table with<br />value</p>
<p>Connection.PreauthIntegrityHashValue</p>
<p>7ECC09ACEC6034FF40F8B0C9F6662C95E2532E6F54D29E922138A65D592FD58FA437712034CD2542</p>
<p>55EAA10BB823507EFCF1654195512A8445D9DE2609F47741</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x30786325577741</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>7ECC09ACEC6034FF40F8B0C9F6662C95E2532E6F54D29E922138A65D592FD58FA437712034CD2542</p>
<p>55EAA10BB823507EFCF1654195512A8445D9DE2609F47741</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000200000000000000FFFE000000000000</p>
<p>00000000000000000000000000000000000000000000000019000001010000000000000058004A00</p>
<p>0000000000000000604806062B0601050502A03E303CA00E300C060A2B06010401823702020AA22A</p>
<p>04284E544C4D5353500001000000978208E200000000000000000000000000000000060380250000</p>
<p>000F</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>7ECC09ACEC6034FF40F8B0C9F6662C95E2532E6F54D29E922138A65D592FD58FA437712034CD2542</p>
<p>55EAA10BB823507EFCF1654195512A8445D9DE2609F47741FE534D42400001000000000001008000</p>
<p>00000000000000000200000000000000FFFE00000000000000000000000000000000000000000000</p>
<p>000000000000000019000001010000000000000058004A000000000000000000604806062B060105</p>
<p>0502A03E303CA00E300C060A2B06010401823702020AA22A04284E544C4D53535000010000009782</p>
<p>08E200000000000000000000000000000000060380250000000F</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>96D0F138CFE59B45465B2241727FADE2F74E5F6E4F88392C53A6DDC8E03B9BA5D7405FD37963906B</p>
<p>D7256648BDD43537A3A29C2CD0FE4FE5FE18E124EAD0B663</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>&nbsp;</p>
<p>&nbsp;--- STATUS_MORE_PROCESSING_REQUIRED<br />- Updating Preauth integrity hash ---</p>
<p>PreauthSession.SessionId 0x30786325577741</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>96D0F138CFE59B45465B2241727FADE2F74E5F6E4F88392C53A6DDC8E03B9BA5D7405FD37963906B</p>
<p>D7256648BDD43537A3A29C2CD0FE4FE5FE18E124EAD0B663</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100160000C00100010001000000000000000200000000000000FFFE000000000000</p>
<p>0D000000001C000000000000000000000000000000000000090000004800B300A181B03081ADA003</p>
<p>0A0101A10C060A2B06010401823702020AA281970481944E544C4D53535000020000000C000C0038</p>
<p>00000015828AE2CBB1D86ED8A26BBE000000000000000050005000440000000A0092270000000F53</p>
<p>005500540033003100310002000C0053005500540033003100310001000C00530055005400330031</p>
<p>00310004000C0053005500540033003100310003000C005300550054003300310031000700080083</p>
<p>C4744232B1D00100000000</p>
<p>SessionSetup response header signature 0x00000000000000000000000000000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />response packet</p>
<p>SHA-512 Input Hash Data</p>
<p>96D0F138CFE59B45465B2241727FADE2F74E5F6E4F88392C53A6DDC8E03B9BA5D7405FD37963906B</p>
<p>D7256648BDD43537A3A29C2CD0FE4FE5FE18E124EAD0B663FE534D4240000100160000C001000100</p>
<p>01000000000000000200000000000000FFFE0000000000000D000000001C00000000000000000000</p>
<p>0000000000000000090000004800B300A181B03081ADA0030A0101A10C060A2B0601040182370202</p>
<p>0AA281970481944E544C4D53535000020000000C000C003800000015828AE2CBB1D86ED8A26BBE00</p>
<p>0000000000000050005000440000000A0092270000000F53005500540033003100310002000C0053</p>
<p>005500540033003100310001000C0053005500540033003100310004000C00530055005400330031</p>
<p>00310003000C005300550054003300310031000700080083C4744232B1D00100000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>F2243F95EEF00B4218D5A00DFBDAB515B9CC1F7C5F8DA99AAFBAFB72EB9424F6845C79A94EC5796C</p>
<p>9D69402D103EDD72805ACB38CF62E7DA3BE94B3BED3EE8FC</p>
<p>&nbsp;</p>
<p>SESSION SETUP Request</p>
<p>PreauthSession.SessionId 0x30786325577741</p>
<p>Current</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>F2243F95EEF00B4218D5A00DFBDAB515B9CC1F7C5F8DA99AAFBAFB72EB9424F6845C79A94EC5796C</p>
<p>9D69402D103EDD72805ACB38CF62E7DA3BE94B3BED3EE8FC</p>
<p>SessionSetup request packet</p>
<p>FE534D4240000100000000000100800000000000000000000300000000000000FFFE000000000000</p>
<p>0D000000001C0000000000000000000000000000000000001900000101000000000000005800CF01</p>
<p>0000000000000000A18201CB308201C7A0030A0101A28201AA048201A64E544C4D53535000030000</p>
<p>001800180090000000EE00EE00A80000000C000C00580000001A001A0064000000120012007E0000</p>
<p>001000100096010000158288E2060380250000000F268C28C948C2E1EF3A481C34A7100C97530055</p>
<p>005400330031003100610064006D0069006E006900730074007200610074006F0072004400520049</p>
<p>0056004500520033003100310000000000000000000000000000000000000000000000000030EF61</p>
<p>6190C8A662E721E2F8EDC40E98010100000000000083C4744232B1D001A529012472765972000000</p>
<p>0002000C0053005500540033003100310001000C0053005500540033003100310004000C00530055</p>
<p>00540033003100310003000C005300550054003300310031000700080083C4744232B1D001060004</p>
<p>000200000008003000300000000000000000000000003000009B52C033A82790F6F74C0E851E924C</p>
<p>504FDC52EF290D80D5322FBE536429D6D50A00100000000000000000000000000000000000090016</p>
<p>0063006900660073002F005300550054003300310031000000000000000000000000008A393FC3E9</p>
<p>D7FFD7CDE5BECCBF864F29A31204100100000071B9DE9A4248980D00000000</p>
<p>Concatenate PreauthSession.PreauthIntegrityHashValue and Session Setup<br />request packet</p>
<p>SHA-512 Input Hash Data&nbsp;</p>
<p>F2243F95EEF00B4218D5A00DFBDAB515B9CC1F7C5F8DA99AAFBAFB72EB9424F6845C79A94EC5796C</p>
<p>9D69402D103EDD72805ACB38CF62E7DA3BE94B3BED3EE8FCFE534D42400001000000000001008000</p>
<p>00000000000000000300000000000000FFFE0000000000000D000000001C00000000000000000000</p>
<p>00000000000000001900000101000000000000005800CF010000000000000000A18201CB308201C7</p>
<p>A0030A0101A28201AA048201A64E544C4D53535000030000001800180090000000EE00EE00A80000</p>
<p>000C000C00580000001A001A0064000000120012007E0000001000100096010000158288E2060380</p>
<p>250000000F268C28C948C2E1EF3A481C34A7100C97530055005400330031003100610064006D0069</p>
<p>006E006900730074007200610074006F007200440052004900560045005200330031003100000000</p>
<p>00000000000000000000000000000000000000000030EF616190C8A662E721E2F8EDC40E98010100</p>
<p>000000000083C4744232B1D001A5290124727659720000000002000C005300550054003300310031</p>
<p>0001000C0053005500540033003100310004000C0053005500540033003100310003000C00530055</p>
<p>0054003300310031000700080083C4744232B1D00106000400020000000800300030000000000000</p>
<p>0000000000003000009B52C033A82790F6F74C0E851E924C504FDC52EF290D80D5322FBE536429D6</p>
<p>D50A001000000000000000000000000000000000000900160063006900660073002F005300550054</p>
<p>003300310031000000000000000000000000008A393FC3E9D7FFD7CDE5BECCBF864F29A312041001</p>
<p>00000071B9DE9A4248980D00000000</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>CB3320852ED35231F1087E6A4828C129384F7041005FF76543B46B1590574300B376771109C29903</p>
<p>D0A5E6EB124A3BCA8DD9CF0FBF2EF60F2FED746A70CE0533</p>
<p>&nbsp;</p>
<p>SESSION SETUP Response</p>
<p>SessionId 0x30786325577741 COMPLETED</p>
<p>SessionSetup response packet</p>
<p>FE534D4240000100000000000100800009000000000000000300000000000000FFFE000000000000</p>
<p>0D000000001C0000BCE812303D9BCD5D3295EF0572553AEB0900000048001D00A11B3019A0030A01</p>
<p>00A31204100100000017DD19D27E10A55D00000000</p>
<p>SessionSetup response header signature 0xBCE812303D9BCD5D3295EF0572553AEB</p>
<p>PreauthSession.PreauthIntegrityHashValue</p>
<p>CB3320852ED35231F1087E6A4828C129384F7041005FF76543B46B1590574300B376771109C29903</p>
<p>D0A5E6EB124A3BCA8DD9CF0FBF2EF60F2FED746A70CE0533</p>
<p>&nbsp;</p>
<p>Input cryptographicKey (SessionKey) 0xA8B3FCB8C96884BA9126132AE5B076AF</p>
<p>(queried from GSS authenticated context)</p>
<p>&nbsp;</p>
<p>--- Dialect 0x0311 ---</p>
<p>preauthIntegrityHashValue</p>
<p>CB3320852ED35231F1087E6A4828C129384F7041005FF76543B46B1590574300B376771109C29903</p>
<p>D0A5E6EB124A3BCA8DD9CF0FBF2EF60F2FED746A70CE0533</p>
<p>SessionKey 0xA8B3FCB8C96884BA9126132AE5B076AF</p>
<p>SigningKey 0x5756AC382298721282D4D9F61CF1195F</p>
<p>&nbsp;</p>
<p><strong>[References]</strong></p>
<p>[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2<br />and 3 Specification</p>
<p>SMB3 Secure Dialect Negotiation</p>
<p><a href="https://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx">https://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx</a></p>
<p>What&rsquo;s new in SMB 3.1.1 in the Windows Server 2016 Technical<br />Preview 2</p>
<p><a href="https://blogs.technet.com/b/josebda/archive/2015/05/05/what-s-new-in-smb-3-1-1-in-the-windows-server-technical-preview-2.aspx">https://blogs.technet.com/b/josebda/archive/2015/05/05/what-s-new-in-smb-3-1-1-in-the-windows-server-technical-preview-2.aspx</a></p>
<p>[SP800-108] National Institute of Standards and Technology.<br />"Special Publication 800-108, Recommendation for Key Derivation Using<br />Pseudorandom Functions", October 2009, <a href="https://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf">https://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf</a></p>
<p>[FIPS180-4] FIPS PUBS, "Secure Hash Standards<br />(SHS)", March 2012, <a href="https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf">https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf</a></p>
<p>[RFC4493]. The AES-CMAC Algorithm, <a href="https://www.ietf.org/rfc/rfc4493.txt">https://www.ietf.org/rfc/rfc4493.txt</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>MS-PST - Parsing a Heap-on-Node Property Context Block</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/ms-pst-parsing-a-heap-on-node-property-context-block</link>
      <pubDate>Fri, 30 May 2014 12:12:00 GMT</pubDate>
      <dc:creator><![CDATA[JCurry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2014/05/30/ms-pst-parsing-a-heap-on-node-property-context-block/</guid>
      <description><![CDATA[Summary
This Blog will use the sample Heap-on-Node (HN) from section 3.8 of MS-PST and walk through...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">Summary</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">This Blog will use the sample Heap-on-Node (HN) from section <a href="https://msdn.microsoft.com/en-us/library/ff386697(v=office.12).aspx">3.8</a> of <a href="https://msdn.microsoft.com/en-us/library/ff385210(v=office.12).aspx">MS-PST</a> and walk through the process of how to read a property from it. The current version of the MS-PST open specification document can be found here: <a href="https://msdn.microsoft.com/en-us/library/ff385210(office.12).aspx">https://msdn.microsoft.com/en-us/library/ff385210(office.12).aspx</a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">Introduction</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">First, it's important to understand that there are several layers and structures involved here. A basic understanding of the NDB and LTP layers is extremely helpful, but not required.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">The construction of the Heap-on-Node can be summarized as follows:</p>
<ol style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;" type="1">
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;" value="1"><span style="font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;">The </span><a href="https://msdn.microsoft.com/en-us/library/ff387148(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">Block</span></a><span style="font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;"> is a </span><a href="https://msdn.microsoft.com/en-us/library/ff386518(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">Heap-on-Node</span></a><span style="font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;">.</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">The </span><a href="https://msdn.microsoft.com/en-us/library/ff385560(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">BTree-on-Heap</span></a><span style="font-family: Calibri; font-size: 11.0pt;"> is built on top of the </span><a href="https://msdn.microsoft.com/en-us/library/ff386518(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">Heap-on-Node</span></a><span style="font-family: Calibri; font-size: 11.0pt;">.</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">The </span><a href="https://msdn.microsoft.com/en-us/library/ff385509(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">Property Context</span></a><span style="font-family: Calibri; font-size: 11.0pt;"> is built on top of the </span><a href="https://msdn.microsoft.com/en-us/library/ff385560(v=office.12).aspx"><span style="font-family: Calibri; font-size: 11.0pt;">BTree-on-Heap</span></a><span style="font-family: Calibri; font-size: 11.0pt;">.</span></li>
</ol>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">The HNHDR</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">First, we will take a look at the <a href="https://msdn.microsoft.com/en-us/library/ff386774(v=office.12).aspx">HNHDR</a> which is the first 12 bytes of the block.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4645.F1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4645.F1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/4645.F1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/4645.F1.png" alt="" border="0" /></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 1: The HNHDR.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">For now, we really only care about 2 of the properties here. The first 2 bytes which is the <span style="font-weight: bold;">ibHnpm</span> property with a value of <span style="font-weight: bold;">0x00EC</span>. This is the offset from the beginning of the block to the beginning of the <a href="https://msdn.microsoft.com/en-us/library/ff385507(v=office.12).aspx">HNPAGEMAP</a>. The 4th byte is the <span style="font-weight: bold;">bClientSig</span> with a value of <span style="font-weight: bold;">0xBC</span>. This tells us that this block contains a <a href="https://msdn.microsoft.com/en-us/library/ff385509(v=office.12).aspx">Property Context</a> which is built on top of a <a href="https://msdn.microsoft.com/en-us/library/ff385560(v=office.12).aspx">BTree-on-Heap</a>. This will be important later.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">The HNPAGEMAP</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">Looking at the offset in the <a href="https://msdn.microsoft.com/en-us/library/ff387148(v=office.12).aspx">Block</a> specified by the ibHnpm property, it's not possible to know the length of the <a href="https://msdn.microsoft.com/en-us/library/ff385507(v=office.12).aspx">HNPAGEMAP</a> until you read the first property, <span style="font-weight: bold;">cAlloc</span>, which in this case is <span style="font-weight: bold;">0x0008</span>. This tells us that the <span style="font-weight: bold;">rgibAlloc</span> table will contain 9 (8 + 1) entries. Each entry is a 2 byte WORD value. So, the length of the rgibAlloc table is 18 (9 * 2) bytes in length. Add the 2 bytes each for cAlloc and cFree and you get the total length of the <a href="https://msdn.microsoft.com/en-us/library/ff385507(v=office.12).aspx">HNPAGEMAP</a> which is 22 bytes. Reading all 22 bytes we have the following.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/2234.F2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/2234.F2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/2234.F2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/2234.F2.png" alt="" border="0" /></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 2: The HNPAGEMAP.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">Starting at the 5th byte, read the next 18 bytes as a series of 2-byte values to get a list of the offsets for the starting location of each allocation in the block. The 9th offset is a place holder that tells an application where the next allocation should start, it is not an allocation that contains data.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<ol style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;" type="1">
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;" value="1"><span style="font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;">0x000C</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x0014</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x006C</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x007C</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x008C</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x00A4</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x00BC</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x00D4</span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11.0pt;">0x00EC</span></li>
</ol>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">The first allocation starting at offset 0x000C will be the <a href="https://msdn.microsoft.com/en-us/library/ff386157(v=office.12).aspx">BTHHEADER</a> which is 8 bytes in length.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">The BTHHEADER</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/0513.F3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/0513.F3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/0513.F3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/0513.F3.png" alt="" border="0" /></a>&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 3: The BTHHEADER.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">We care about 3 values from the <a href="https://msdn.microsoft.com/en-us/library/ff386157(v=office.12).aspx">BTHHEADER</a>; <span style="font-weight: bold;">cbKey</span>, <span style="font-weight: bold;">cbEnt</span>, and <span style="font-weight: bold;">hidRoot</span>.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<div style="direction: ltr;">
<table style="direction: ltr; border-collapse: collapse; border-style: solid; border-color: #A3A3A3; border-width: 1pt;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: .6673in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">cbKey</p>
</td>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: 1.2305in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">0x02</p>
</td>
</tr>
<tr>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: .6673in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">cbEnt</p>
</td>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: 1.2305in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">0x06</p>
</td>
</tr>
<tr>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: .6673in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">hidRoot</p>
</td>
<td style="border-style: solid; border-color: #A3A3A3; border-width: 1pt; vertical-align: top; width: 1.2305in; padding: 4pt 4pt 4pt 4pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">0x0040, 0x0000</p>
</td>
</tr>
</tbody>
</table>
</div>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">It's VERY important to understand that the hidRoot is a <a href="https://msdn.microsoft.com/en-us/library/ff386694(v=office.12).aspx">HID</a> structure that should be read as 2 separate 2-byte values and NOT as a single 4-byte value.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">The combination of the cbKey and cbEnt tells us how long each <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Record</a> will be. Remember back when we looked at the <a href="https://msdn.microsoft.com/en-us/library/ff386774(v=office.12).aspx">HNHDR</a> and the bClientSig value was 0xBC (bTypePC)? That's how we know that the records will be <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Records</a>. In this case, each record will be 8 bytes in length.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">Locating The hidRoot</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">The hidRoot is worth spending a little bit more time talking about. The current version of the <a href="https://msdn.microsoft.com/en-us/library/ff385210(v=office.12).aspx">MS-PST</a> document (v2.1, 2/10/2014) is missing some vital information for working with HID structures. The current version of the documentation was valid for older versions of Outlook, however the current version of Outlook handles this structure differently. The exact version of Outlook that first handled it this way is not known.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">Looking at the hidRoot we know that the hidBlockIndex is 0x0000 which means that the heap item is contained in the same block we are currently looking at. The hidIndex has a value of 0x0040 which seems strange because it's supposed to be the 1-based index to the heap item where we can look to start reading some <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Records</a>. Since this <a href="https://msdn.microsoft.com/en-us/library/ff385560(v=office.12).aspx">BTree-on-Heap</a> node only contains 8 allocations, it couldn&rsquo;t possibly be the 64th allocation.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">In order to get the correct allocation index we need to bit shift the hidIndex 5 places to the right. This will result in a value of 0x0002. Therefore, the <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Records</a> begin at the second allocation. This information should be included in a future release of the documentation and is vital in obtaining the correct hidIndex value.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">Reading The PC BTH Records</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">We now have enough information to read the collection of <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Records</a> from the second allocation. First, in order to determine the length of the 2nd allocation we subtract the offset of the 3rd allocation from the offset of the 2nd. 0x6C - 0x14 = 0x58 (88 bytes).</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/8475.F4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/8475.F4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/8475.F4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/8475.F4.png" alt="" border="0" /></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 4: The PC BTH Records.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">We also know that each <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Record</a> is 8 bytes. Dividing 88 bytes by 8 bytes each gives us 11 records.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<ul style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in;" type="disc">
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">34 0E 02 01 A0 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">38 0E 03 00 00 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">F9 0F 02 01 60 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">01 30 1F 00 80 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">DF 35 03 00 89 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">E0 35 02 01 C0 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">E3 35 02 01 00 01 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">E7 35 02 01 E0 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">33 66 0B 00 01 00 00 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">FA 66 03 00 0D 00 0E 00 </span></li>
<li style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"><span style="font-family: Consolas; font-size: 11.0pt;">FF 67 03 00 00 00 00 00</span></li>
</ul>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">Each <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Record</a> starts with a 2-byte <span style="font-weight: bold;">wPropId</span> and a 2-byte <span style="font-weight: bold;">wPropType</span>. The list of possible wPropType values can be found in <a href="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx">MS-OXCDATA</a> section <a href="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx">2.11.1</a> and <a href="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx">MS-OXPROPS</a> contains the Master Property List which is probably the best place to look for Property ID values. However, you will also find Property ID values scattered throughout other documents where those properties are used.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 14.0pt; color: #2e75b5;">Getting The Property</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">We will use the 4th <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Record</a> for demonstration purposes because we can easily look up what the Property ID and type is. The wPropId is 0x3001 and the wPropType is 0x001F. Searching in <a href="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx">MS-OXPROPS</a> we find that it belongs to the <a href="https://msdn.microsoft.com/en-us/library/ee158398(v=exchg.80).aspx">PidTagDisplayName</a> property and that the type is PtypString. According to <a href="https://msdn.microsoft.com/en-us/library/cc425496(v=exchg.80).aspx">MS-OXCDATA</a> section <a href="https://msdn.microsoft.com/en-us/library/ee157583(v=exchg.80).aspx">2.11.1</a> the PtypString is <span style="font-style: italic;">"Variable size; a string of Unicode characters in UTF-16LE format encoding with terminating null character (0x0000)." </span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">Now that we know what the property and the type is we can go retrieve it. The 3rd property of the <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">PC BTH Record</a> is the <span style="font-weight: bold;">dwValueHnid</span> which can represent a few different things. Refer to <a href="https://msdn.microsoft.com/en-us/library/ff385210%28v=office.12%29.aspx">MS-PST</a> section <a href="https://msdn.microsoft.com/en-us/library/ff386558(v=office.12).aspx">2.3.3.3</a> on how to determine what the type of data stored in it. In this case, it's a <a href="https://msdn.microsoft.com/en-us/library/ff386694(v=office.12).aspx">HID</a> structure. Reading the hidIndex value of 0x0080 and bitshifting it 5 places to the right (like we did for the hidRoot earlier) we get an index value of 0x0004. That means that the string value that belongs to the PidTagDisplayName is stored in the 4th allocation of this block. Looking back at the list of offsets from the <a href="https://msdn.microsoft.com/en-us/library/ff385507(v=office.12).aspx">HNPAGEMAP</a> we can see that the 4th allocation starts at offset 0x007C and is 0x10 (16 bytes) in length.</p>
<p>&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/7220.F5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/7220.F5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/7220.F5.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/7220.F5.png" alt="" border="0" /></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 5: pidTagDisplayName.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">This represents the string "UNICODE1". Unfortunately, this block does not contain any other meaningful properties that we can look up in <a href="https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx">MS-OXPROPS</a>, but if there were you would follow the same process.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11.0pt;">&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5468.F6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5468.F6.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/22/05/5468.F6.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-22-05/5468.F6.png" alt="" border="0" /></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 9.0pt; color: #595959;">Figure 6: Complete Heap-On-Node Property Context Block.</p>]]></content:encoded>
    </item>
    <item>
      <title>Extended DFS referral for SMB 3</title>
      <link>https://docs.microsoft.com/archive/blogs/openspecification/extended-dfs-referral-for-smb-3</link>
      <pubDate>Fri, 21 Feb 2014 09:40:00 GMT</pubDate>
      <dc:creator><![CDATA[Edgar A Olougouna]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/openspecification/2014/02/21/extended-dfs-referral-for-smb-3/</guid>
      <description><![CDATA[This blog talks about site-aware DFS referral introduced in Windows Server 2012. Extended DFS...]]></description>
      <content:encoded><![CDATA[<p>This blog talks about site-aware DFS referral introduced in Windows Server 2012. Extended DFS referrals provide remote client computers with optimal DFS referrals when the computers connect to the corporate network by using DirectAccess. This blog also describes how to configure a Window 8 client to issue extended DFS referral request for testing a SMB 3 server implementation.</p>
<h2>Feature summary</h2>
<p>Windows Server 2012 added extended DFS referral which enables the support of site awareness for Direct Access clients on Windows 8.</p>
<p>When a user on Windows 8 connects to Windows Server 2012 based DFS namespaces over Direct Access, the client receives referrals to the namespace servers and folder targets that are closest to their location.</p>
<p>In Windows 7, a remote computer (e.g. connected over Direct Access) whose IP address is outside of the sites specified in Active Directory would receive DFS referrals in a random order (from Windows Server 2008 R2 namespace server), including servers in distant sites. This may cause network latency and increased bandwidth usage.</p>
<p>In Windows 8, Direct Access was enhanced with site awareness. When accessing a DFS namespace over a Direct Access connection, the client provides a site name in the DFS referral request to Windows Server 2012 namespace server. The server uses the site name to order the referrals so that the client can get to the closest site available.</p>
<p>The extended DFS referral is sent using the new control code FSCTL_DFS_GET_REFERRALS_EX [MS-SMB2].&nbsp; It is important to note that if an SMB 3.x server is DFS capable, it must support extended DFS referral. All Windows-based SMB 3.x servers (2012 and 2012 R2) support this new FSCTL.</p>
<h2>Windows 8 implementation-specific triggers</h2>
<p>A Windows-based DFS client decides to use FSCTL_DFS_GET_REFERRALS_EX if the computer is connected over Direct Access and the negotiated SMB dialect is 3.0 or above.</p>
<p>The extended referral provisioning is done on Windows 8/8.1 by Direct Access configuration.<br />The DFS client detects that the client is connected over Direct Access if UseDcLocatorSiteName != 0. Direct Access also provisions the SiteName configuration. Recall that the value of the SiteName entry takes precedence over the value of DynamicSiteName (which is dynamically set by Netlogon service; the site that the computer belongs to can be determined with DsGetSiteName API call).&nbsp;</p>
<p>The following instructions may be practical for testing an SMB 3 server implementation with extended DFS referral. The key is to get the client issue the new FSCTL by setting the configuration that Direct Access would have provisioned.<br />When a Windows client requests for site-aware referrals, the server should not fail with the request, even with STATUS_NOT_SUPPORTED, otherwise the client will not be able to access the SMB 3 share, because there is no fallback mechanism from FSCTL_DFS_GET_REFERRALS_EX to FSCTL_DFS_GET_REFERRALS.</p>
<h2>Windows-based extended DFS referrals testing</h2>
<p>In my testing environment, I have a configuration similar to the following.</p>
<p>DC01 is running Windows Server 2012 in this site MS-SMB_Internal.<br />DFS Management \ Namespaces<br />SiteName MS-SMB_Internal<br />Namespace <a href="file://\\contoso.com\ShareVolume1">\\contoso.com\ShareVolume1</a>, Add folder Share1 with target <a href="file://\\dc01\FileShare2">\\dc01\FileShare2</a></p>
<p>On the Windows 8 client: <br />HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dfsc\Parameters<br />UseDcLocatorSiteName = 1<br />This indicates to the DFS client that the client is connected over &ldquo;Direct Access&rdquo;. <br />HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters<br />SiteName MS-SMB_Internal<br />(SiteName is a string)<br />NOTE: If the SiteName is not configured, the client will issue FSCTL_DFS_GET_REFERRALS.<br />Restart Workstation service, and accept to restart Netlogon and Dfs Namespace services.</p>
<p>With the proper configuration, the client will send site-aware referral requests when asking for DFS referrals over SMB 3 connections.</p>
<p>--- Site-aware DFS referral request example ---</p>
<p>- SMB2: C&nbsp;&nbsp; IOCTL (0xb), FID=0xFFFFFFFFFFFFFFFF FSCTL_DFS_GET_REFERRALS_EX, <br />&nbsp; - CIoCtl: <br />&nbsp;&nbsp;&nbsp;&nbsp; StructureSize: 57 (0x39)<br />&nbsp;&nbsp;&nbsp;&nbsp; Reserved: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; CtlCode: FSCTL_DFS_GET_REFERRALS_EX<br />&nbsp;&nbsp; + FileId: Persistent: 0xFFFFFFFFFFFFFFFF, Volatile: 0xFFFFFFFFFFFFFFFF<br />&nbsp;&nbsp;&nbsp;&nbsp; InputOffset: 120 (0x78)<br />&nbsp;&nbsp;&nbsp;&nbsp; InputCount: 97 (0x61)<br />&nbsp;&nbsp;&nbsp;&nbsp; MaxInputResponse: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; OutputOffset: 120 (0x78)<br />&nbsp;&nbsp;&nbsp;&nbsp; OutputCount: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; MaxOutputResponse: 4096 (0x1000)<br />&nbsp;&nbsp;&nbsp;&nbsp; Flags: (00000000000000000000000000000001) FSCTL request<br />&nbsp;&nbsp;&nbsp;&nbsp; Reserved2: 0 (0x0)<br />&nbsp;&nbsp; - ReqGetDFSReferralEx: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MaxReferralLevel: 4 (0x4)<br />&nbsp;&nbsp;&nbsp; - RequestFlags: 1 (0x1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SiteName: (...............1) - SiteName present: The SiteName bit MUST be set to 1 if the packet contains the site name of the client.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Unused:&nbsp;&nbsp; (000000000000000.) - Unused<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RequestDataLength: 88 (0x58)<br />&nbsp;&nbsp;&nbsp; - RequestData: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RequestFileNameLength: 52 (0x34)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RequestFileName: \contoso.com\ShareVolume1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SiteNameLength: 32 (0x20)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SiteName: MS-SMB_Internal<br />&nbsp;&nbsp;&nbsp; padding: Binary Large Object (1 Bytes)</p>
<p>--- Response example ---</p>
<p>- SMB2: R&nbsp;&nbsp; IOCTL (0xb) FSCTL_DFS_GET_REFERRALS_EX, <br />&nbsp; - RIoCtl: <br />&nbsp;&nbsp;&nbsp;&nbsp; StructureSize: 49 (0x31)<br />&nbsp;&nbsp;&nbsp;&nbsp; Reserved: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; CtlCode: FSCTL_DFS_GET_REFERRALS_EX<br />&nbsp;&nbsp; + FileId: Persistent: 0xFFFFFFFFFFFFFFFF, Volatile: 0xFFFFFFFFFFFFFFFF<br />&nbsp;&nbsp;&nbsp;&nbsp; InputOffset: 112 (0x70)<br />&nbsp;&nbsp;&nbsp;&nbsp; InputCount: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; OutputOffset: 112 (0x70)<br />&nbsp;&nbsp;&nbsp;&nbsp; OutputCount: 184 (0xB8)<br />&nbsp;&nbsp;&nbsp;&nbsp; Flags: 0 (0x0)<br />&nbsp;&nbsp;&nbsp;&nbsp; Reserved2: 0 (0x0)<br />&nbsp;&nbsp; - RespGetDFSReferral: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PathConsumed: 50 bytes<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NumberOfReferrals: 1 (0x1)<br />&nbsp;&nbsp;&nbsp; + ReferralHeaderFlags: 3 (0x3)<br />&nbsp;&nbsp;&nbsp; - ReferralEntries: Version:4<br />&nbsp;&nbsp;&nbsp;&nbsp; - ReferralV4: Index:1 TTL:300 Seconds<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VersionNumber: 0x4, MUST be set to 0x4<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size: 34 (0x22)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerType: Root targets returned<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + ReferralEntryFlags: 4 (0x4)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TimeToLive: 300 Seconds<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DfsPathOffset: 34 (0x22) Offset:0xD4<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DfsAlternatePathOffset: 86 (0x56) Offset:0x108<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NetworkAddressOffset: 138 (0x8A) Offset:0x13C<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServiceSiteGuid: {00000000-0000-0000-0000-000000000000}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DfsPath: Index:1 \contoso.com\ShareVolume1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DfsAlternatePath: Index:1 \contoso.com\ShareVolume1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TargetPath: Index:1 \DC01\ShareVolume1&nbsp;</p>
<h3>References</h3>
<p>What's New in DFS Namespaces and DFS Replication in Windows Server 2012<br /><a href="https://technet.microsoft.com/en-us/library/dn270370.aspx">https://technet.microsoft.com/en-us/library/dn270370.aspx</a></p>
<p>How DFS Works<br /><a href="https://technet.microsoft.com/en-us/library/cc782417(v=WS.10).aspx">https://technet.microsoft.com/en-us/library/cc782417(v=WS.10).aspx</a></p>
<p>[MS-DFSC]: Distributed File System (DFS): Referral Protocol<br /><a href="https://msdn.microsoft.com/en-us/library/cc226982.aspx">https://msdn.microsoft.com/en-us/library/cc226982.aspx</a><br />[MS-CIFS]: Common Internet File System (CIFS) Protocol<br /><a href="https://msdn.microsoft.com/en-us/library/ee442092.aspx">https://msdn.microsoft.com/en-us/library/ee442092.aspx</a><br />[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3<br /><a href="https://msdn.microsoft.com/en-us/library/cc246482.aspx">https://msdn.microsoft.com/en-us/library/cc246482.aspx</a><br />DirectAccess<br /><a href="https://technet.microsoft.com/en-us/windows/directaccess.aspx">https://technet.microsoft.com/en-us/windows/directaccess.aspx</a><br />SiteName<br /><a href="https://technet.microsoft.com/en-us/library/cc937923.aspx">https://technet.microsoft.com/en-us/library/cc937923.aspx</a><br />DynamicSiteName<br /><a href="https://technet.microsoft.com/en-us/library/cc960209.aspx">https://technet.microsoft.com/en-us/library/cc960209.aspx</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>