diff --git a/README.md b/README.md index 1789fa7..ab53b1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ ---- -SharpHound Open Source Client version: 2.0.0 ---- - # SharpHound ![GitHub all releases](https://img.shields.io/github/downloads/BloodHoundAD/SharpHound/total) diff --git a/src/Producers/BaseProducer.cs b/src/Producers/BaseProducer.cs index 941d27d..25f45d9 100644 --- a/src/Producers/BaseProducer.cs +++ b/src/Producers/BaseProducer.cs @@ -80,7 +80,7 @@ protected LDAPData CreateLDAPData() { if ((methods & ResolvedCollectionMethod.Container) != 0) { - query = query.AddContainers().AddDomains(); + query = query.AddComputers().AddContainers().AddUsers().AddGroups().AddDomains().AddOUs().AddGPOs(); props.AddRange(CommonProperties.ContainerProps); } diff --git a/src/Runtime/ObjectProcessors.cs b/src/Runtime/ObjectProcessors.cs index 2eee51a..abcefda 100644 --- a/src/Runtime/ObjectProcessors.cs +++ b/src/Runtime/ObjectProcessors.cs @@ -150,6 +150,11 @@ private async Task ProcessUserObject(ISearchResultEntry entry, ret.SPNTargets = targets.ToArray(); } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + return ret; } @@ -198,6 +203,11 @@ private async Task ProcessComputerObject(ISearchResultEntry entry, ret.DumpSMSAPassword = computerProps.DumpSMSAPassword; } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + if (!_methods.IsComputerCollectionSet()) return ret; @@ -334,6 +344,11 @@ private Group ProcessGroupObject(ISearchResultEntry entry, } } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + return ret; } @@ -396,7 +411,6 @@ private async Task ProcessDomainObject(ISearchResultEntry entry, if ((_methods & ResolvedCollectionMethod.Container) != 0) { - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray(); ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray(); } @@ -439,7 +453,6 @@ private GPO ProcessGPOObject(ISearchResultEntry entry, } } - return ret; } @@ -475,7 +488,7 @@ private async Task ProcessOUObject(ISearchResultEntry entry, if ((_methods & ResolvedCollectionMethod.Container) != 0) { - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray(); + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); ret.Properties.Add("blocksinheritance", ContainerProcessor.ReadBlocksInheritance(entry.GetProperty("gpoptions"))); ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray(); @@ -505,7 +518,7 @@ private Container ProcessContainerObject(ISearchResultEntry entry, ret.Properties.Add("highvalue", false); if ((_methods & ResolvedCollectionMethod.Container) != 0) - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(entry.DistinguishedName).ToArray(); + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); if ((_methods & ResolvedCollectionMethod.ACL) != 0) { diff --git a/src/Writers/JsonDataWriter.cs b/src/Writers/JsonDataWriter.cs index 821c9af..8698aac 100644 --- a/src/Writers/JsonDataWriter.cs +++ b/src/Writers/JsonDataWriter.cs @@ -22,7 +22,7 @@ public class JsonDataWriter : BaseWriter private string _fileName; private JsonSerializerSettings _serializerSettings; - private const int DataVersion = 5; + private const int DataVersion = 6; /// /// Creates a new instance of a JSONWriter using the specified datatype and program context