Skip to content
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

Add computer SID for Windows systems #824

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

fox-evv
Copy link

@fox-evv fox-evv commented Aug 15, 2024

This addition to the generic Windows plugin exports the machine and domain SIDs
of the target. If the system is not joined to a domain, it uses only the/
SAM hive, but if the system is domain joined, it will all so use
the Security Policy.

It returns the machine SID found in the SAM hive.
- The machine SID from the SAM hive
- The domain SID from the security policy
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.51%. Comparing base (a9d723b) to head (69a9eae).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/windows/generic.py 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   75.40%   75.51%   +0.11%     
==========================================
  Files         302      305       +3     
  Lines       26152    26364     +212     
==========================================
+ Hits        19720    19909     +189     
- Misses       6432     6455      +23     
Flag Coverage Δ
unittests 75.51% <77.77%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Horofic
Copy link
Contributor

Horofic commented Sep 3, 2024

@fox-evv I've suggested some changes and also added some test with this commit. One thing I could not verify myself is whether there can be multiple Machine / Domain SIDs. The initial implementation kind of seemed to suggest this. Do you encounter this scenario yourself? I left it out of this implementation because it seemed illogical to me.

"""Return the machine- and optional domain SID of the system."""

try:
key = self.target.registry.key("HKLM\\SAM\\SAM\\Domains\\Account")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can there be multiple Machine- and Domain SIDS associated with one system?

@Horofic Horofic self-assigned this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants