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 1, 2023
2 parents df7f6c3 + 271d28d commit d7b0165
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ PublishScripts/
*.nuget.targets

# Nuget personal access tokens and Credentials
nuget.config
#nuget.config

# Microsoft Azure Build Output
csx/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
SharpHound Open Source Client version: 1.1.1
SharpHound Open Source Client version: 2.0.0
---

# SharpHound
Expand Down
9 changes: 5 additions & 4 deletions Sharphound.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<LangVersion>latest</LangVersion>
<DebugType>full</DebugType>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<Version>2.0.0</Version>
<FileVersion>2.0.0</FileVersion>
<Version>2.0.1</Version>
<FileVersion>2.0.1</FileVersion>
<Company>SpecterOps</Company>
<Product>SharpHound</Product>
<AssemblyName>SharpHound</AssemblyName>
Expand All @@ -24,15 +24,16 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- <PackageReference Include="SharpHoundCommon" Version="3.0.6" /> -->
<!-- <PackageReference Include="SharpHoundCommon" Version="3.0.8" /> -->
<PackageReference Include="SharpHoundRPC" Version="3.0.8" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="SharpHoundCommonLib, Version=3.0.9.0, Culture=neutral, PublicKeyToken=null">
<Reference Include="SharpHoundCommonLib, Version=3.0.8.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\SharpHoundCommon\src\CommonLib\bin\Debug\net462\SharpHoundCommonLib.dll</HintPath>
</Reference>
<Reference Include="System.DirectoryServices" />
Expand Down
8 changes: 8 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="specterops" value="https://s3.amazonaws.com/bloodhound-ad/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
6 changes: 6 additions & 0 deletions src/Producers/LdapProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public override async Task Produce()
var log = Context.Logger;
var utils = Context.LDAPUtils;

if (Context.Flags.CollectAllProperties)
{
log.LogDebug("CollectAllProperties set. Changing LDAP properties to *");
ldapData.Props = new[] { "*" };
}

foreach (var domain in Context.Domains)
{
Context.Logger.LogInformation("Beginning LDAP search for {Domain}", domain);
Expand Down
3 changes: 3 additions & 0 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
using SharpHoundCommonLib.Enums;
using SharpHoundCommonLib.OutputTypes;
using SharpHoundCommonLib.Processors;
using Container = SharpHoundCommonLib.OutputTypes.Container;
using Group = SharpHoundCommonLib.OutputTypes.Group;
using Label = SharpHoundCommonLib.Enums.Label;

namespace Sharphound.Runtime
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sharphound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public class Program
public static async Task Main(string[] args)
{
var logger = new BasicLogger((int)LogLevel.Information);
logger.LogInformation("This version of SharpHound is compatible with the 4.3.1 Release of BloodHound");
logger.LogInformation("This version of SharpHound is compatible with the 5.0.0 Release of BloodHound");
try
{
var parser = new Parser(with =>
Expand Down
16 changes: 14 additions & 2 deletions src/Writers/JsonDataWriter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Sharphound.Client;
using SharpHoundCommonLib.OutputTypes;
Expand All @@ -18,6 +20,7 @@ public class JsonDataWriter<T> : BaseWriter<T>
private JsonTextWriter _jsonWriter;
private readonly IContext _context;
private string _fileName;
private JsonSerializerSettings _serializerSettings;

private const int DataVersion = 5;

Expand All @@ -31,6 +34,15 @@ public JsonDataWriter(IContext context, string dataType) : base(dataType)
_context = context;
if (_context.Flags.NoOutput)
NoOp = true;

_serializerSettings = new JsonSerializerSettings()
{
Converters = new List<JsonConverter>
{
new StringEnumConverter()
},
Formatting = PrettyPrint
};
}

private Formatting PrettyPrint => _context.Flags.PrettyPrint ? Formatting.Indented : Formatting.None;
Expand Down Expand Up @@ -61,7 +73,7 @@ protected override async Task WriteData()
{
foreach (var item in Queue)
{
await _jsonWriter.WriteRawValueAsync(JsonConvert.SerializeObject(item, PrettyPrint));
await _jsonWriter.WriteRawValueAsync(JsonConvert.SerializeObject(item, _serializerSettings));
}
}

Expand Down

0 comments on commit d7b0165

Please sign in to comment.