Skip to content

Commit

Permalink
Add signature checking to supplementalCredentials USER_PROPERTIES str…
Browse files Browse the repository at this point in the history
…uctures
  • Loading branch information
ph1ll committed Nov 8, 2017
1 parent af324d6 commit acee10c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/NtdsAudit/NTCrypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ public static Dictionary<string, byte[]> DecryptSupplementalCredentials(Dictiona

var properties = new Dictionary<string, byte[]>();

// Check the property signature is equal to 0x50, and if not assume the structure is corrupt.
if (decryptedBlob.Length < 110 || BitConverter.ToUInt16(decryptedBlob, 108) != 0x50)
{
return properties;
}

// If there are zero USER_PROPERTY elements, the length will be 0x6F
if (decryptedBlob.Length == 0x6F)
{
Expand Down
4 changes: 2 additions & 2 deletions src/NtdsAudit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: CLSCompliant(true)]

0 comments on commit acee10c

Please sign in to comment.