When rerunning sharphound against the same domain a 2nd time:
Unhandled Exception: System.AggregateException: AggregateException_ctor_DefaultMessage ---> System.ArgumentException: Item has already been added. Key in dictionary: 'rootdomainnamingcontext' Key being added: 'rootdomainnamingcontext'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.SyncHashtable.Add(Object key, Object value)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName)
at System.DirectoryServices.ActiveDirectory.Domain.get_Forest()
at Sharphound2.Utils.GetForest(String domain)
at Sharphound2.Enumeration.AclHelpers.GetObjectAces(SearchResultEntry entry, ResolvedEntry resolved, Gpo& g)
at Sharphound2.Enumeration.EnumerationRunner.<>cDisplayClass19_0.b0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
at Sharphound2.Enumeration.EnumerationRunner.StartEnumeration()
at Sharphound2.Sharphound.Main(String[] args)
---> (Inner Exception #0) System.ArgumentException: Item has already been added. Key in dictionary: 'rootdomainnamingcontext' Key being added: 'rootdomainnamingcontext'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.SyncHashtable.Add(Object key, Object value)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName)
at System.DirectoryServices.ActiveDirectory.Domain.get_Forest()
at Sharphound2.Utils.GetForest(String domain)
at Sharphound2.Enumeration.AclHelpers.GetObjectAces(SearchResultEntry entry, ResolvedEntry resolved, Gpo& g)
at Sharphound2.Enumeration.EnumerationRunner.<>cDisplayClass19_0.b0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
When rerunning sharphound against the same domain a 2nd time:
Unhandled Exception: System.AggregateException: AggregateException_ctor_DefaultMessage ---> System.ArgumentException: Item has already been added. Key in dictionary: 'rootdomainnamingcontext' Key being added: 'rootdomainnamingcontext' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.SyncHashtable.Add(Object key, Object value) at System.DirectoryServices.PropertyCollection.get_Item(String propertyName) at System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName) at System.DirectoryServices.ActiveDirectory.Domain.get_Forest() at Sharphound2.Utils.GetForest(String domain) at Sharphound2.Enumeration.AclHelpers.GetObjectAces(SearchResultEntry entry, ResolvedEntry resolved, Gpo& g) at Sharphound2.Enumeration.EnumerationRunner.<>cDisplayClass19_0.b0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
at Sharphound2.Enumeration.EnumerationRunner.StartEnumeration()
at Sharphound2.Sharphound.Main(String[] args)
---> (Inner Exception #0) System.ArgumentException: Item has already been added. Key in dictionary: 'rootdomainnamingcontext' Key being added: 'rootdomainnamingcontext'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.SyncHashtable.Add(Object key, Object value)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName)
at System.DirectoryServices.ActiveDirectory.Domain.get_Forest()
at Sharphound2.Utils.GetForest(String domain)
at Sharphound2.Enumeration.AclHelpers.GetObjectAces(SearchResultEntry entry, ResolvedEntry resolved, Gpo& g)
at Sharphound2.Enumeration.EnumerationRunner.<>cDisplayClass19_0.b 0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---