Skip to content

Commit

Permalink
Small fixes (#108)
Browse files Browse the repository at this point in the history
* chore: move log statement to correct spot

* chore: bump commonlib

* chore: bump version

* chore: remove dead code
  • Loading branch information
rvazarkar authored Jul 29, 2024
1 parent 3fc5bdd commit f17436e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 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.5.1</Version>
<FileVersion>2.5.1</FileVersion>
<Version>2.5.2</Version>
<FileVersion>2.5.2</FileVersion>
<Company>SpecterOps</Company>
<Product>SharpHound</Product>
<AssemblyName>SharpHound</AssemblyName>
Expand All @@ -24,8 +24,8 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SharpHoundCommon" Version="4.0.1" />
<PackageReference Include="SharpHoundRPC" Version="4.0.1" />
<PackageReference Include="SharpHoundCommon" Version="4.0.2" />
<PackageReference Include="SharpHoundRPC" Version="4.0.2" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />
Expand Down
8 changes: 2 additions & 6 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,11 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(IDirectoryObject entry,
var caName = entry.GetProperty(LDAPProperties.Name);
var dnsHostName = entry.GetProperty(LDAPProperties.DNSHostName);
if (caName != null && dnsHostName != null) {
_log.LogWarning("CA {Name} host ({Dns}) could not be resolved to a SID.", caName, dnsHostName);
if (await _context.LDAPUtils.ResolveHostToSid(dnsHostName, resolvedSearchResult.DomainSid) is
(true, var sid) && sid.StartsWith("S-1-")) {
ret.HostingComputer = sid;
}

// If ResolveHostToSid does not return a valid SID, we don't want to record this host
if (ret.HostingComputer != null && !ret.HostingComputer.StartsWith("S-1-")) {
ret.HostingComputer = null;
} else {
_log.LogWarning("CA {Name} host ({Dns}) could not be resolved to a SID.", caName, dnsHostName);
}

CARegistryData cARegistryData = new() {
Expand Down

0 comments on commit f17436e

Please sign in to comment.