Skip to content

Commit

Permalink
SQLCheck tracing added
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolm-Stewart committed Aug 24, 2021
1 parent 82e7ebd commit e0f4ea5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
Binary file modified SQLCheck/.vs/SQLCheck/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified SQLCheck/.vs/SQLCheck/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified SQLCheck/.vs/SQLCheck/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
11 changes: 10 additions & 1 deletion SQLCheck/SQLCheck/Collectors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,19 +441,27 @@ public static void CollectDomain(DataSet ds)
//
// Get related domain - additional attributes
//
//Console.WriteLine("Getting Related Domain Additional Attributes");
Console.WriteLine("Trace: Getting Related Domain Additional Attributes");
DirectorySearcher searcher = null;
SearchResultCollection results = null;
try
{
searcher = new DirectorySearcher(new DirectoryEntry($@"LDAP://{domain.Name}"), $"objectCategory=trustedDomain", new string[] { "name", "trustAttributes", "msDS-SupportedEncryptionTypes" }, SearchScope.Subtree);
Console.WriteLine($"Trace: searcher is {(searcher == null ? "Null" : "not Null")}");
results = searcher.FindAll();
Console.WriteLine($"Trace: results is {(results == null ? "Null" : "not Null")}");
foreach (SearchResult result in results)
{
// Tracing code
Console.WriteLine("Trace: Attribute Loop");
DirectoryEntry entry = result.GetDirectoryEntry();
Console.WriteLine($"Trace: entry is {(entry == null ? "Null" : "not Null")}");
string name = entry.Properties["name"][0].ToString();
Console.WriteLine($"Trace: Got name {name}");
int trustAttributes = entry.Properties["trustAttributes"][0].ToInt();
Console.WriteLine("Trace: Got trustAttributes");
int supportedEncryptionTypes = entry.Properties["msDS-SupportedEncryptionTypes"][0].ToInt();
Console.WriteLine("Trace: Got supportedEncryptionTypes");
Debug.WriteLine($"name: {name}, trustAttributes: 0x{trustAttributes.ToString("X8")}, Enc: {supportedEncryptionTypes.ToString("X8")}");
DataRow[] rows = dtRelatedDomain.Select($"TargetDomain='{name}'");
if (rows.Length == 0)
Expand Down Expand Up @@ -483,6 +491,7 @@ public static void CollectDomain(DataSet ds)
if (searcher != null) { searcher.Dispose(); searcher = null; }
DomainRow.LogException("Failed to look up trusted domain additional attributes.", ex);
}
Console.WriteLine("Trace: finished looking up trusted domain additional attributes.");

//
// Get root domain and forest related domain - additional attributes
Expand Down
4 changes: 2 additions & 2 deletions SQLCheck/SQLCheck/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("1.0.1129.0")]
[assembly: AssemblyFileVersion("1.0.1129.0")]
[assembly: AssemblyVersion("1.0.1130.0")]
[assembly: AssemblyFileVersion("1.0.1130.0")]

0 comments on commit e0f4ea5

Please sign in to comment.