-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-BloodHoundData loops forever when Group contains itself #24
Comments
I'm not quite sure what's causing this, as we don't recurse on group memberships themselves. I created a group that's nested within itself and am not able to recreate the infinite loop. Can you run |
Running that manually does not loop, and the results agree with get-adgroupmember as well;
|
Hrmmmm unsure about this as we can't recreate, we'll try to dive a bit deeper. |
I don't think this is caused by a group containing itself now that i've stepped through it in the debugger. Not sure what exactly causes it, but on line 5425 GroupSearcher.FindOne() always returns my "BadGroup" after it sees badgroup the first time. Still debugging on my end. (my line numbers may be off due to adding write-verbose statements all over) |
after we have added PropertiesToLoad to $GroupSearcher once, subsequent calls to FindOne() will fail when trying to find the next group. If we still have a $Result, and that $Result contains a property named `member`, the loop will continue using the previous successful search results as though they are the current search results, resulting in reprocessing the previous group.
Fixed with ktwombley#1 |
after we have added PropertiesToLoad to $GroupSearcher once, subsequent calls to FindOne() will fail when trying to find the next group. If we still have a $Result, and that $Result contains a property named `member`, the loop will continue using the previous successful search results as though they are the current search results, resulting in reprocessing the previous group.
I was diagnosing an issue where my bloodhound database never grew above a certain size so I changed output to CSV. In the CSV file it became clear that in my AD environment I ended up with a group which contained itself as a member, causing Get-BloodHoundData to churn forever when trying to process that group.
Here is the command I'm running:
$VerbosePreference = "Continue"; Get-BloodHoundData -verbose | Export-BloodHoundCSV -SkipGCDeconfliction -Verbose -CSVFolder .\csv
Checking group_memberships.csv file after some time reveals a pattern:
The text was updated successfully, but these errors were encountered: