-
Notifications
You must be signed in to change notification settings - Fork 6
Add ntds cli tools and add all tools as pyproject entry points #34
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0e8136c
Fix issue #33
william-billaud ef3ccb0
Add project.scripts
william-billaud 9a563ac
Update pyproject.toml
william-billaud 38c183c
Update README.md
william-billaud 702c517
Update README.md
william-billaud d41cab3
Update dissect/database/ese/ntds/tools.py
william-billaud b3e8582
Update dissect/database/ese/ntds/tools.py
william-billaud d649dec
parser.add_argument("-j", "--json", action="store_true", default=…
william-billaud e139691
Update dissect/database/ese/ntds/tools/ntds.py
william-billaud 5b81ab3
Update dissect/database/ese/ntds/tools/ntds.py
william-billaud e07162c
Add as_dict function to sru entrie
william-billaud 25f32b4
Merge branch 'main' into ese_tools
william-billaud 2d78335
Delete dissect/__init__.py
Schamper 515806f
Format commands table in README.md
Schamper b436865
Merge branch 'main' into ese_tools
Schamper d9be412
Merge branch 'main' into ese_tools
Schamper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
william-billaud marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import json | ||
| from pathlib import Path | ||
|
|
||
| from dissect.database.ese.ntds import NTDS | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description="dissect.database.ese.ntds NTDS parser") | ||
| parser.add_argument("input", help="NTDS database to read") | ||
| parser.add_argument("-c", "--objectClass", help="show only objects of this class", required=True) | ||
| parser.add_argument("-j", "--json", action="store_true", default=False, help="output in JSON format") | ||
| args = parser.parse_args() | ||
|
|
||
| with Path(args.input).open("rb") as fh: | ||
| ntds = NTDS(fh) | ||
|
|
||
| for record in ntds.search(objectClass=args.objectClass): | ||
| if args.json: | ||
| print(json.dumps(record.as_dict(), default=str)) | ||
| else: | ||
| print(record) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.