* Standardized examples logger init method
* Fixing missing import
* Standardized examples init_ldap_session function #1
* Calling new shared function _ldap3_kerberos_login from example addcomputer
* Removed considering -debug in each example. Now it's handled in utils.
* Standardized EMPTY_LM_HASH in impacket.examples.utils
* Unify parse_identity function (phase 1)
* Standardized parse_identity
* Renamed "_ldap3_kerberos_login" to "ldap3_kerberos_login" (as it is called from outside)
* Standardize "logger" init in regsecrets.py
* Standardized LDAP login into a single function in utils.py:ldap_login
The code looks for leading zero bytes and removes them, but then uses
the number of zero bytes (in variable beginning) to trim the key again
just before printing. This commit fixes the code to only trim once.
The code was verified to work and print the same DPAPI master key as
Mimikatz and the other methods implemented by Impacket.
This was a pending change to:
- Use the same tagline, copyright and license notice across files.
- Remove authors' contacts that are no longer valid (due to affiliation changes).
- Update repository location.
- Update license file with missing licenses (althought those were already in source files).
This doesn't include any change on the source code, nor any change on current copyright or licenses. Just formatting and phrasing to make our and distro's maintainers life easier.
In reviewing #1051 (and related #347) we found out that there's some ugly duplicated code that's better suited for an utils function.
The expected target format is:
`<DOMAIN></USERNAME><:PASSWORD>@HOSTNAME`
This PR:
- Moved target parsing routine to an utils module.
- Added unit tests for the new function.
- Using the new function across example scripts that accept a target.
- Thru the unprotect command.
- You need to specify the masterkey needed for decryption, you can decrypt masterkeys using the masterkey command.
- You can optionally specify an extra entropy either as a string or a binary file.
Hola,
I added support for domain backup keys extraction for the use of master keys decryption (huge thanks and credit to @gentilkiwi)
Example:
# Extract domain backup keys
dpapi.py -debug backupkeys -t domain/user:password@DC --export
# decrypt master key using PVK file
dpapi.py masterkey -file 8ef4fb99-bb78-4592-b989-303c4aea5554 -pvk G$BCKUPKEY_E63DFF3E-CB30-41AF-AB69-FF7B8769C39B.pvk