Skip to content
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ The listing below details the CLI arguments SharpHound supports. Additional deta

--collectallproperties Collect all LDAP properties from objects

--skipdenyacescount Skip collecting custom deny ACE counts in LDAP object properties

-l, --Loop Loop computer collection

--loopduration Loop duration (hh:mm:ss - 05:00:00 is 5 hours, default: 2 hrs)
Expand Down
3 changes: 3 additions & 0 deletions src/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public class Options

[Option(HelpText = "Collect all LDAP properties from objects")]
public bool CollectAllProperties { get; set; }

[Option(HelpText = "Skip collecting custom deny ACE counts in LDAP object properties")]
public bool SkipDenyAcesCount { get; set; }

[Option(HelpText = "Split the main ldap query into smaller chunks to attempt to reduce server load")]
public bool PartitionLdapQueries { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions src/PowerShell/Template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@
.PARAMETER CollectAllProperties

Collect all string LDAP properties on objects

.PARAMETER SkipDenyAcesCount

Skip collecting custom deny ACE counts in LDAP object properties

.PARAMETER Loop

Expand Down Expand Up @@ -360,6 +364,9 @@
[Switch]
$CollectAllProperties,

[Switch]
$SkipDenyAcesCount,

[Switch]
$Loop,

Expand Down
18 changes: 9 additions & 9 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps)) {
ret.Properties = ContextUtils.Merge(ret.Properties, LdapPropertyProcessor.ReadGPOProperties(entry));
ret.Properties = ContextUtils.Merge(ret.Properties, await _ldapPropertyProcessor.ReadGPOProperties(entry));

Check failure on line 584 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadGPOProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
if (_context.Flags.CollectAllProperties) {
ret.Properties = ContextUtils.Merge(_ldapPropertyProcessor.ParseAllProperties(entry),
ret.Properties);
Expand Down Expand Up @@ -611,7 +611,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps)) {
ret.Properties = ContextUtils.Merge(ret.Properties, LdapPropertyProcessor.ReadOUProperties(entry));
ret.Properties = ContextUtils.Merge(ret.Properties, await _ldapPropertyProcessor.ReadOUProperties(entry));

Check failure on line 614 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadOUProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
if (_context.Flags.CollectAllProperties) {
ret.Properties = ContextUtils.Merge(_ldapPropertyProcessor.ParseAllProperties(entry),
ret.Properties);
Expand Down Expand Up @@ -662,7 +662,7 @@

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
ret.Properties =
ContextUtils.Merge(LdapPropertyProcessor.ReadContainerProperties(entry), ret.Properties);
ContextUtils.Merge(await _ldapPropertyProcessor.ReadContainerProperties(entry), ret.Properties);

Check failure on line 665 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadContainerProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
if (_context.Flags.CollectAllProperties) {
ret.Properties = ContextUtils.Merge(_ldapPropertyProcessor.ParseAllProperties(entry),
ret.Properties);
Expand Down Expand Up @@ -693,7 +693,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
var props = LdapPropertyProcessor.ReadRootCAProperties(entry);
var props = await _ldapPropertyProcessor.ReadRootCAProperties(entry);

Check failure on line 696 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadRootCAProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
ret.Properties.Merge(props);
}

Expand Down Expand Up @@ -724,7 +724,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
var props = LdapPropertyProcessor.ReadAIACAProperties(entry);
var props = await _ldapPropertyProcessor.ReadAIACAProperties(entry);

Check failure on line 727 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadAIACAProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
ret.Properties.Merge(props);
}

Expand Down Expand Up @@ -754,7 +754,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
var props = LdapPropertyProcessor.ReadEnterpriseCAProperties(entry);
var props = await _ldapPropertyProcessor.ReadEnterpriseCAProperties(entry);

Check failure on line 757 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadEnterpriseCAProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
ret.Properties.Merge(props);

// Enabled cert templates
Expand Down Expand Up @@ -871,7 +871,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
var props = LdapPropertyProcessor.ReadNTAuthStoreProperties(entry);
var props = await _ldapPropertyProcessor.ReadNTAuthStoreProperties(entry);

Check failure on line 874 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadNTAuthStoreProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead

if (entry.TryGetByteArrayProperty(LDAPProperties.CACertificate, out var rawCertificates)) {
var certificates = from rawCertificate in rawCertificates
Expand Down Expand Up @@ -910,7 +910,7 @@
}

if (_methods.HasFlag(CollectionMethod.ObjectProps) || _methods.HasFlag(CollectionMethod.CertServices)) {
var certTemplatesProps = LdapPropertyProcessor.ReadCertTemplateProperties(entry);
var certTemplatesProps = await _ldapPropertyProcessor.ReadCertTemplateProperties(entry);

Check failure on line 913 in src/Runtime/ObjectProcessors.cs

View workflow job for this annotation

GitHub Actions / build

Member 'LdapPropertyProcessor.ReadCertTemplateProperties(IDirectoryObject)' cannot be accessed with an instance reference; qualify it with a type name instead
ret.Properties.Merge(certTemplatesProps);
}

Expand Down Expand Up @@ -956,4 +956,4 @@
return ret;
}
}
}
}
5 changes: 3 additions & 2 deletions src/Sharphound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
DisableSigning = options.DisableSigning,
ForceSSL = options.ForceSecureLDAP,
AuthType = AuthType.Negotiate,
DisableCertVerification = options.DisableCertVerification
DisableCertVerification = options.DisableCertVerification,
SkipDenyAcesCount = options.SkipDenyAcesCount

Check failure on line 108 in src/Sharphound.cs

View workflow job for this annotation

GitHub Actions / build

'LdapConfig' does not contain a definition for 'SkipDenyAcesCount'

Check failure on line 108 in src/Sharphound.cs

View workflow job for this annotation

GitHub Actions / build

'LdapConfig' does not contain a definition for 'SkipDenyAcesCount'
};

if (options.DomainController != null) ldapOptions.Server = options.DomainController;
Expand Down Expand Up @@ -264,4 +265,4 @@
}

#endregion
}
}
Loading