Skip to content

Commit c1f50d1

Browse files
authored
chore: SHC has a required dependency of SharpHoundRPC (#288)
* consolidate properties in build.props, specify RPC->SHC dependency * let nuget manage rpc project/package dependency * add readmes * restore version
1 parent c8fd708 commit c1f50d1

5 files changed

Lines changed: 96 additions & 38 deletions

File tree

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
<Project>
2+
<PropertyGroup>
3+
<TargetFramework>net472</TargetFramework>
4+
<OutputType>library</OutputType>
5+
<LangVersion>default</LangVersion>
6+
<Authors>Rohan Vazarkar</Authors>
7+
<Company>SpecterOps</Company>
8+
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
9+
<RepositoryUrl>https://github.com/SpecterOps/SharpHoundCommon</RepositoryUrl>
10+
<Version>4.6.0</Version>
11+
</PropertyGroup>
212
<ItemGroup>
313
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
414
<_Parameter1>CommonLibTest</_Parameter1>

src/CommonLib/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SharpHoundCommon
2+
3+
SharpHoundCommon provides the high-level shared components used to build AD enumeration workflows. It includes initialization, caching, LDAP helpers, host and service processors, and registry and user-rights collection logic used by SharpHound collectors.
4+
5+
## When to use this package
6+
7+
Use `SharpHoundCommon` if you are building a collector or integration that needs higher-level enumeration behavior. This is the package most consumers should start with.
8+
9+
## Requirements
10+
11+
- .NET Framework 4.7.2
12+
- Windows and Active Directory oriented workloads
13+
14+
## Install
15+
16+
```powershell
17+
dotnet add package SharpHoundCommon
18+
```
19+
20+
## Getting started
21+
22+
```csharp
23+
using SharpHoundCommonLib;
24+
25+
CommonLib.InitializeCommonLib();
26+
```
27+
28+
You may optionally provide an `ILogger` and a pre-created `Cache` instance to `CommonLib.InitializeCommonLib(...)`.
29+
30+
## Included capabilities
31+
32+
- Shared initialization and cache management via `CommonLib` and `Cache`
33+
- LDAP querying and identity resolution via `LdapUtils`
34+
- Host availability, SMB, and LDAP service checks via `ComputerAvailability`, `SmbProcessor`, and `DCLdapProcessor`
35+
- Registry collection orchestration via `RegistryProcessor`
36+
- User rights, SPN, and certificate-related processing helpers
37+
38+
## Relationship to SharpHoundRPC
39+
40+
`SharpHoundCommon` depends on `SharpHoundRPC` and is intended to be the higher-level entry point. Most consumers should not reference `SharpHoundRPC` directly unless they need its lower-level SAM, LSA, NetAPI, or registry APIs.
41+
42+
## Source and support
43+
44+
- Source: https://github.com/SpecterOps/SharpHoundCommon
45+
- Issues: https://github.com/SpecterOps/SharpHoundCommon/issues
46+
- License: GPL-3.0-only
Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net472</TargetFramework>
4-
<OutputType>library</OutputType>
53
<PackageId>SharpHoundCommon</PackageId>
6-
<LangVersion>default</LangVersion>
7-
<Authors>Rohan Vazarkar</Authors>
8-
<Company>SpecterOps</Company>
94
<PackageDescription>Common library for C# BloodHound enumeration tasks</PackageDescription>
10-
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
11-
<RepositoryUrl>https://github.com/BloodHoundAD/SharpHoundCommon</RepositoryUrl>
12-
<Version>4.6.0</Version>
5+
<PackageReadmeFile>README.md</PackageReadmeFile>
136
<AssemblyName>SharpHoundCommonLib</AssemblyName>
147
<RootNamespace>SharpHoundCommonLib</RootNamespace>
8+
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
159
</PropertyGroup>
1610
<PropertyGroup>
1711
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
@@ -29,28 +23,9 @@
2923
<Reference Include="System.Net.Http" />
3024
</ItemGroup>
3125
<ItemGroup>
32-
<Folder Include="Properties" />
26+
<ProjectReference Include="..\SharpHoundRPC\SharpHoundRPC.csproj" />
3327
</ItemGroup>
3428
<ItemGroup>
35-
<ProjectReference Include="..\SharpHoundRPC\SharpHoundRPC.csproj" PrivateAssets="All" />
29+
<None Include="README.md" Pack="true" PackagePath="" />
3630
</ItemGroup>
37-
<PropertyGroup>
38-
<TargetsForTfmSpecificBuildOutput>
39-
$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
40-
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
41-
</PropertyGroup>
42-
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
43-
<ItemGroup>
44-
<!-- Filter out unnecessary files -->
45-
<_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')-&gt;WithMetadataValue('PrivateAssets', 'All'))" />
46-
</ItemGroup>
47-
48-
<!-- Print batches for debug purposes -->
49-
<Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" />
50-
51-
<ItemGroup>
52-
<!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. -->
53-
<BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)" />
54-
</ItemGroup>
55-
</Target>
5631
</Project>

src/SharpHoundRPC/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SharpHoundRPC
2+
3+
SharpHoundRPC exposes low-level Windows RPC, Win32, and remote collection helpers used by SharpHoundCommon and SharpHound collectors. It wraps SAM, LSA, NetAPI, and remote registry operations behind C# interfaces and result types.
4+
5+
## When to use this package
6+
7+
Use `SharpHoundRPC` directly only if you need low-level RPC or interop access. If you want higher-level enumeration workflows, install `SharpHoundCommon` instead.
8+
9+
## Requirements
10+
11+
- .NET Framework 4.7.2
12+
- Windows-focused functionality
13+
- Appropriate privileges, network reachability, and RPC availability on target systems
14+
15+
## Install
16+
17+
```powershell
18+
dotnet add package SharpHoundRPC
19+
```
20+
21+
## Included capabilities
22+
23+
- SAM access through `ISAMServer`, `ISAMDomain`, `SAMServerAccessor`, and related wrappers
24+
- LSA policy access via `LSAPolicy` for SID lookup and privilege enumeration
25+
- NetAPI helpers for sessions, workstation information, and domain controller discovery
26+
- Remote registry strategies using WMI or Remote Registry
27+
- Shared `Result<T>` and related helper types for error handling
28+
29+
## Source and support
30+
31+
- Source: https://github.com/SpecterOps/SharpHoundCommon
32+
- Issues: https://github.com/SpecterOps/SharpHoundCommon/issues
33+
- License: GPL-3.0-only
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net472</TargetFramework>
4-
<OutputType>library</OutputType>
53
<PackageId>SharpHoundRPC</PackageId>
6-
<LangVersion>default</LangVersion>
7-
<Authors>Rohan Vazarkar</Authors>
8-
<Company>SpecterOps</Company>
94
<PackageDescription>SAM/LSA Wrapper for C# BloodHound tasks</PackageDescription>
10-
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
11-
<Version>4.6.0</Version>
5+
<PackageReadmeFile>README.md</PackageReadmeFile>
126
<AssemblyName>SharpHoundRPC</AssemblyName>
137
<RootNamespace>SharpHoundRPC</RootNamespace>
148
</PropertyGroup>
@@ -20,9 +14,9 @@
2014
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
2115
</ItemGroup>
2216
<ItemGroup>
23-
<Folder Include="Properties"/>
17+
<Reference Include="System.Management" />
2418
</ItemGroup>
2519
<ItemGroup>
26-
<Reference Include="System.Management" />
20+
<None Include="README.md" Pack="true" PackagePath="" />
2721
</ItemGroup>
2822
</Project>

0 commit comments

Comments
 (0)