forked from bsi-group/dumpntds
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted to ditjson, allowing only JSON export
Signed-off-by: Zafer Balkan <[email protected]>
- Loading branch information
Showing
12 changed files
with
256 additions
and
603 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,58 +1,28 @@ | ||
dumpntds | ||
ditjson | ||
======== | ||
|
||
# Background | ||
|
||
The normal workflow for dumping password hashes from **ntds.dit** files is to use the **esedbexport** application from the **[libesedb](https://github.com/libyal/libesedb)** project. The files generated by esedbextract are then fed into the [ntdsxtract](https://github.com/csababarta/ntdsxtract) project. ntdsxtract uses the files to parse out various different items of information, in this case we would want password hashes that could be fed into john the ripper. | ||
|
||
On large domains, the ntds.dit file can be extremely large (10 GB+), from which extracting all of the columns to a CSV file can take a long time, considering the **datatable** table contains over 1000 columns. | ||
|
||
The aim of dumpntds is to extract the minimal amount of data required (45 columns) to perform the task in hand, thus speeding up the process. | ||
|
||
dumpntds uses the [ManagedEsent](https://github.com/microsoft/ManagedEsent) library to access the data stored in the ntds.dit file. The ManagedEsent library wraps the underlying Windows API calls and therefore needs to be run using .Net, rather than Mono. | ||
`ditjson` is a fork of [dumpntds](https://github.com/bsi-group/dumpntds). Unlike the original tool, the purpose it to generate JSON files in order to help integration with other tools. | ||
|
||
This fork updates the underlying framework to .NET 8.0 and uses NuGet packages rather than deploying dependencies as a part of repository. It is possible to publish as a single-file. The trimmed version's size is around 20MB. | ||
|
||
There is also a single-file JSON export mode whcich can be used to integrate other tools while breaking `ntdsxtract` importability. The JSON export is opinionated and ignores null values to minimize the exported JSON file size. | ||
The output is a single-file JSON export. The JSON export is opinionated and ignores null values to minimize the exported JSON file size. | ||
|
||
# Usage | ||
|
||
## Export JSON | ||
|
||
Extract the ntds.dit file from the host and run using the following: | ||
``` | ||
dumpntds -n path\to\ntds.dit\file -t Json | ||
ditjson -n path\to\ntds.dit\file | ||
``` | ||
|
||
Once the process has been completed it will have generated two output files in the application directory: | ||
|
||
- ntds.json | ||
|
||
## Export CSV | ||
|
||
Extract the ntds.dit file from the host and run using the following: | ||
|
||
``` | ||
dumpntds -n path\to\ntds.dit\file | ||
``` | ||
|
||
Once the process has been completed it will have generated two output files in the application directory: | ||
|
||
- datatable.csv | ||
- linktable.csv | ||
|
||
### dsusers | ||
|
||
The extracted files can then be used with the **dsusers.py** script from the ntdsxtract project: | ||
|
||
``` | ||
python ./dsusers.py datatable.csv linktable.csv . --passwordhashes --syshive SYSTEM --pwdformat john --lmoutfile lm.txt --ntoutfile nt.txt | ||
``` | ||
|
||
### dshashes.py | ||
|
||
I have also included an updated version of the [dshashes](http://ptscripts.googlecode.com/svn/trunk/dshashes.py) python script, which was broken due to changes in the underlying ntds library. The dshashes script can be used as follows: | ||
# Dependencies | ||
|
||
``` | ||
python ./dshashes.py datatable.csv linktable.csv . --passwordhashes SYSTEM | ||
``` | ||
- [Commandline](https://github.com/commandlineparser/commandline) | ||
- [ManagedEsent](https://github.com/microsoft/ManagedEsent) |
This file contains 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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
source/dumpntds/NtdsException.cs → source/ditjson/NtdsException.cs
This file contains 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 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.