Skip to content

Commit

Permalink
Merge branch '2.X' into adcs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK committed Nov 9, 2023
2 parents 826efc6 + af9529b commit fe6c8a8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Producers/BaseProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
21 changes: 17 additions & 4 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ private async Task<User> ProcessUserObject(ISearchResultEntry entry,
ret.SPNTargets = targets.ToArray();
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

return ret;
}

Expand Down Expand Up @@ -198,6 +203,11 @@ private async Task<Computer> ProcessComputerObject(ISearchResultEntry entry,
ret.DumpSMSAPassword = computerProps.DumpSMSAPassword;
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

if (!_methods.IsComputerCollectionSet())
return ret;

Expand Down Expand Up @@ -334,6 +344,11 @@ private Group ProcessGroupObject(ISearchResultEntry entry,
}
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

return ret;
}

Expand Down Expand Up @@ -396,7 +411,6 @@ private async Task<Domain> ProcessDomainObject(ISearchResultEntry entry,

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray();
ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray();
}

Expand Down Expand Up @@ -439,7 +453,6 @@ private GPO ProcessGPOObject(ISearchResultEntry entry,
}
}


return ret;
}

Expand Down Expand Up @@ -475,7 +488,7 @@ private async Task<OU> 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();
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Writers/JsonDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class JsonDataWriter<T> : BaseWriter<T>
private string _fileName;
private JsonSerializerSettings _serializerSettings;

private const int DataVersion = 5;
private const int DataVersion = 6;

/// <summary>
/// Creates a new instance of a JSONWriter using the specified datatype and program context
Expand Down

0 comments on commit fe6c8a8

Please sign in to comment.