Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<Project>
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>library</OutputType>
<LangVersion>default</LangVersion>
<Authors>Rohan Vazarkar</Authors>
<Company>SpecterOps</Company>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<RepositoryUrl>https://github.com/SpecterOps/SharpHoundCommon</RepositoryUrl>
<Version>4.6.0</Version>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>CommonLibTest</_Parameter1>
Expand Down
46 changes: 46 additions & 0 deletions src/CommonLib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SharpHoundCommon

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.

## When to use this package

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.

## Requirements

- .NET Framework 4.7.2
- Windows and Active Directory oriented workloads

## Install

```powershell
dotnet add package SharpHoundCommon
```

## Getting started

```csharp
using SharpHoundCommonLib;

CommonLib.InitializeCommonLib();
```

You may optionally provide an `ILogger` and a pre-created `Cache` instance to `CommonLib.InitializeCommonLib(...)`.

## Included capabilities

- Shared initialization and cache management via `CommonLib` and `Cache`
- LDAP querying and identity resolution via `LdapUtils`
- Host availability, SMB, and LDAP service checks via `ComputerAvailability`, `SmbProcessor`, and `DCLdapProcessor`
- Registry collection orchestration via `RegistryProcessor`
- User rights, SPN, and certificate-related processing helpers

## Relationship to SharpHoundRPC

`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.

## Source and support

- Source: https://github.com/SpecterOps/SharpHoundCommon
- Issues: https://github.com/SpecterOps/SharpHoundCommon/issues
- License: GPL-3.0-only
33 changes: 4 additions & 29 deletions src/CommonLib/SharpHoundCommonLib.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>library</OutputType>
<PackageId>SharpHoundCommon</PackageId>
<LangVersion>default</LangVersion>
<Authors>Rohan Vazarkar</Authors>
<Company>SpecterOps</Company>
<PackageDescription>Common library for C# BloodHound enumeration tasks</PackageDescription>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<RepositoryUrl>https://github.com/BloodHoundAD/SharpHoundCommon</RepositoryUrl>
<Version>4.6.0</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyName>SharpHoundCommonLib</AssemblyName>
<RootNamespace>SharpHoundCommonLib</RootNamespace>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
Expand All @@ -29,28 +23,9 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties" />
<ProjectReference Include="..\SharpHoundRPC\SharpHoundRPC.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharpHoundRPC\SharpHoundRPC.csproj" PrivateAssets="All" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>
$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
<ItemGroup>
<!-- Filter out unnecessary files -->
<_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')-&gt;WithMetadataValue('PrivateAssets', 'All'))" />
</ItemGroup>

<!-- Print batches for debug purposes -->
<Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" />

<ItemGroup>
<!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. -->
<BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)" />
</ItemGroup>
</Target>
</Project>
33 changes: 33 additions & 0 deletions src/SharpHoundRPC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SharpHoundRPC

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.

## When to use this package

Use `SharpHoundRPC` directly only if you need low-level RPC or interop access. If you want higher-level enumeration workflows, install `SharpHoundCommon` instead.

## Requirements

- .NET Framework 4.7.2
- Windows-focused functionality
- Appropriate privileges, network reachability, and RPC availability on target systems

## Install

```powershell
dotnet add package SharpHoundRPC
```

## Included capabilities

- SAM access through `ISAMServer`, `ISAMDomain`, `SAMServerAccessor`, and related wrappers
- LSA policy access via `LSAPolicy` for SID lookup and privilege enumeration
- NetAPI helpers for sessions, workstation information, and domain controller discovery
- Remote registry strategies using WMI or Remote Registry
- Shared `Result<T>` and related helper types for error handling

## Source and support

- Source: https://github.com/SpecterOps/SharpHoundCommon
- Issues: https://github.com/SpecterOps/SharpHoundCommon/issues
- License: GPL-3.0-only
12 changes: 3 additions & 9 deletions src/SharpHoundRPC/SharpHoundRPC.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>library</OutputType>
<PackageId>SharpHoundRPC</PackageId>
<LangVersion>default</LangVersion>
<Authors>Rohan Vazarkar</Authors>
<Company>SpecterOps</Company>
<PackageDescription>SAM/LSA Wrapper for C# BloodHound tasks</PackageDescription>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<Version>4.6.0</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyName>SharpHoundRPC</AssemblyName>
<RootNamespace>SharpHoundRPC</RootNamespace>
</PropertyGroup>
Expand All @@ -20,9 +14,9 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties"/>
<Reference Include="System.Management" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Management" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
Loading