* Added monkeypatches.py; contains a couple of functions to modify for specific usecases/issues: monkeypatch_ssl_create_default_context and monkeypatch_readline_backend
* Revert "Added monkeypatches.py; contains a couple of functions to modify for specific usecases/issues: monkeypatch_ssl_create_default_context and monkeypatch_readline_backend"
This reverts commit 7049ded298.
* defining and running monkeypatch functions from the init of impacket.examples
* leveraging 'init_ldap_session' from addcomputer.py
* leveraging ssl monkeypatch in 'init_ldap_session'
* 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
* fixed SyntaxWarnings due to invalid escape sequence
* fixed DeprecationWarning since datetime.datetime.utcnow() is deprecated in Python 3.12+
* fixed DeprecationWarning since datetime.datetime.utcfromtimestamp() is deprecated in Python 3.12+
* Adds the ability to create a new machine account through SMB via ntlmrelayx.
* Update smbattack.py
Delete the '.' at the end of the password printing to limit user confusion. And change a comment to match @jogatu explain.
* Update computer name and password specification, and target
* Update impacket/examples/ntlmrelayx/attacks/smbattack.py
Co-authored-by: leandro <56035084+0xdeaddood@users.noreply.github.com>
* Remove the connectSamr2(), move the exception handles to samr library, remove the re import
* Common option to add computer via SMB or LDAP
---------
Co-authored-by: BlWasp <blwasp@github.com>
Co-authored-by: leandro <56035084+0xdeaddood@users.noreply.github.com>
In Python3.10, the default TLS cipher settings have been set to a more
secure level. See: https://bugs.python.org/issue43998
The change makes sense for general users, but Impacket is regularly used
to access old Windows computers that present certs signed using MD5 or
don't support anything higher than TLSv1.0. Impacket users arguably care
more about exploiting weaknesses than requiring super secure TLS
settings, so this patch lowers the cipher settings to the lowest value.
This is in line with the current behavior of not validating certificates
at all.
Note that this will not help if the TLS handshake fails due to
certificate issues until this bug is fixed in ldap3:
https://github.com/cannatag/ldap3/pull/1067
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.
Similar to and on top of #1053, this moves the credentials/account parsing regex to an utils module and reduces duplicated code in example scripts.
The expected credential format is:
`<DOMAIN></USERNAME><:PASSWORD>`
Note that the regular expression used in `exchanger.py` was different (excluded ':' from the hostname) but I didn't found any reason to keep it different from all other scripts.
This PR:
- Moved credentials parsing routine to an utils module.
- Added unit tests for the new function.
- Using the new function across example scripts that accept a credential/account.