* 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
* Added ability to specify an output file for smbclient.py to log commands / output while using the smbclient shell
* Improved logging to output file for smbclient
* Added increased control over execution of secretsdump.py, including ability to skip specific users when dumping NTDS.dit or skip SAM hive when dumping remote machine
* Improved relaying to ADCS endpoints
* Improved relaying to ADCS endpoints
* Requested ADCS certificates are now saved to lootdir specified in command line
* Improved writing certificate to file
* Improved log file for smbclient.py
* Bug fix with smbclient output file after rebase
* Bug fix with outputfile logic
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.
- You should be able to run it with Python2 and 3
- As a side effect other libs were also initially ported. Not finished and just in the context of smbclient.py
Replaced all instances of `#!/usr/bin/python` with `#!/usr/bin/env python` so impacket's examples and scripts can be run inside a virtualenv without having to call python.
* I create a new parameters group called 'connection' where you can specify the destination port, the domain controller IP and the target IP (if needed)
* We should propagate the same schema over the rest of the scripts (whenever applicable)
* Aiming at addressing https://github.com/CoreSecurity/impacket/issues/172
Now there should be a single logger called 'impacket' the library uses.
By default is has a NullHandler so nothing is printed, but messages are
forwarded to the upstream logger.
If you are a script using the library and want to set the root logger
with a custom formatter, you can import impacket.examples.logger.
After some testing I'll merge it into master
1) We basically define a logger called 'impacket' at the library's __init__, set out a NullHandler for it, and
2) All the logging stuff in version.py removed
With this we have a single logger called 'impacket' for the library.
Now.. what about the example scripts?
1) Move the impacket/logger.py to impacket/examples/logger.py, since this is something that is used just by the
2) Example scripts should import that file in order for the library logs to be shown right (from impacket.examp
For third-party developers that want to disable or change the logs generated by the library:
1) They could, inside the scripts, logging.getLogger('impacket').disabled = True, or add handlers, or whatever.
Testing needed..
From smb_client use:
kerberos_login {domain/username,passwd} - logs into the current SMB connection using Kerberos. If no password specified, it'll be prompted. Use the DNS resolvable domain name
It supports RC4 as of right now.