Commit Graph

14 Commits

Author SHA1 Message Date
Gabriel Gonzalez 849c74b7b9 Monkeypatches (#2003)
* 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'
2025-08-01 11:39:18 -03:00
Fabrizzio53 171a324d3a Update utils.py to fix -dc-host when ntlm is disabled (#1997) 2025-07-08 15:58:31 -03:00
Gabriel Gonzalez fde4265abd Adding "-dc-host" parameter to dacledit.py, owneredit.py, rbcd.py. Reintroduced SessionError:"STATUS_NOT_SUPPORTED" in function _get_machine_name now that all these examples have "-dc-host" parameter. (#1940) 2025-05-08 10:48:19 -03:00
Muhammad Ibrahim 756ca96e4a Added Support for LDAPS When Retrieving LAPS Password from Windows Server 2025 (#1942)
* Added Support for LDAPS When Using Windows Server 2025

* set ldaps_flag as optional in ldap_login()

---------

Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
2025-04-30 17:49:57 -03:00
Gabriel Gonzalez 352695f18b Techdebt examples bootstrapping target domain fixes (#1937)
* Fixing ldap login logic - affecting findDelegation and GetUserSPNs

* Fixing ldap login logic - considering those examples that do not have "target_domain" parameter.

* Fixing SMBConnection initialization in _get_machine_name
2025-04-01 17:27:59 -03:00
Gabriel Gonzalez 7078e935f1 Update utils.py
Removed some exception handling in _get_machine_name to make it valid for all examples using it

(From #1918 and https://github.com/fortra/impacket/issues/1923#issuecomment-2759487006)
2025-03-27 18:15:49 -03:00
Gabriel Gonzalez 9f61287dc4 Update utils.py
Removed extra parameter in _init_ldap_connection()

(From #1918)
2025-03-27 17:58:54 -03:00
Gabriel Gonzalez ae0ec300f8 Techdebt examples bootstrapping v2 (#1928)
* 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
2025-03-26 22:58:39 -03:00
gabrielg5 27e7e7478d Updating copyright banner... 2024-08-28 17:52:57 -03:00
Gabriel Gonzalez 9b4a139405 Updated Copyright to 2023 2023-07-31 11:48:28 -03:00
Gabriel Gonzalez 8799a1a2c4 Update file banners to reflect Fortra ownership 2022-12-14 17:28:23 -03:00
Martin Gallo cd4fe47cfc Arrange tagline, copyright and license notes across all source files
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.
2021-07-20 10:04:27 -03:00
Martin Gallo a45f331360 Refactored the credentials parsing functions (#1058)
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.
2021-04-22 10:02:29 -03:00
Martin Gallo adb230256d Refactored the target parsing functions (#1053)
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.
2021-04-22 09:11:33 -03:00