[BED-6645] SharpHound RegistrySessions status incorrectly reports NetWkstaUserEnum result #181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When --trackcomputercalls is enabled, the RegistrySessions CSV status was incorrectly checking privSessionResult instead of registrySessionResult, causing it to report the NetWkstaUserEnum status instead of the actual registry enumeration result.
Description
When --trackcomputercalls is enabled, the CSV status output for the RegistrySessions task incorrectly uses the privSessionResult variable (from NetWkstaUserEnum) instead of registrySessionResult (from the registry query). This causes the RegistrySessions row in the CSV to show incorrect status information.
Changed line 303 to use registrySessionResult.Collected instead of
privSessionResult.Collected for accurate status reporting.
Motivation and Context
https://specterops.atlassian.net/browse/BED-6645
How Has This Been Tested?
Test environment:
Reproduction Steps:
.\SharpHound.exe -c session,loggedon --computerfile .\computers.txt --nozip --memcache --trackcomputercallsfalseValidation Steps:
.\SharpHound.exe -c session,loggedon --computerfile .\computers.txt --nozip --memcache --trackcomputercallsAttached relevant output files pre-fix and post-fix.
postfix - data registry disabled.json
prefix - compstatus registry enabled.csv
prefix - data registry disabled.json
prefix - compstatus registry disabled.csv
prefix - data registry enabled.json
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit
Bug Fixes