Commit Graph

74 Commits

Author SHA1 Message Date
Tomik f1cb36178e GetUserSPNs.py - Added a switch not to force RC4-HMAC when requesting a TGT (#2141)
* Added a switch not to force RC4-HMAC when requesting a TGT as newer servers (e.g., 2025) won't issue service tickets when provided with RC4-HMAC TGT.

* Update examples/GetUserSPNs.py

Co-authored-by: alexisbalbachan <alexisbalbachan@gmail.com>

---------

Co-authored-by: alexisbalbachan <alexisbalbachan@gmail.com>
2026-05-05 13:46:31 -03:00
Ryan Kleffman 9282c9bb12 Add -machine-only and -request-machine flags to GetUserSPNs.py (#2011)
* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* GetUserSPN's update to test machineonly flag

* Better naming of argument

* Better naming of argument

* Logging of machineOnly code

* Logging of machineOnly code

* ArgParse Description

* ArgParse Description

* ArgParse Description

* ArgParse Description

* Update examples/GetUserSPNs.py

Co-authored-by: alexisbalbachan <alexisbalbachan@gmail.com>

* Update examples/GetUserSPNs.py

Co-authored-by: alexisbalbachan <alexisbalbachan@gmail.com>

* Update GetUserSPNs.py

Added `or self.__requestMachine is not None`

* Update GetUserSPNs.py

Restore old formatting

---------

Co-authored-by: alexisbalbachan <alexisbalbachan@gmail.com>
2025-08-14 00:39:07 -03:00
Gabriel Gonzalez 34cdb1b972 Techdebt examples bootstrapping fixes (#1935)
* Fixing findDelegation.py - wrong ldap_login parameter name

* Fixing GetUserSPNs.py - wrong parse_identity parameter value

* Fixing rpcmap.py - wrong parse_identity parameter value
2025-03-31 14:01:20 -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
alexisbalbachan 4b56c18a10 Unicode fixes V1 (#1631)
* Fixed unicode shares not being found

* Fixed unicode SPNs not being decoded appropriately

* Fixed spn not being found in getST, fixes #1595

* Fixed unicode issues on login when using ntlmV1 fallback
Fixes #1419
2023-11-14 16:52:27 -03:00
Charlie Bromberg c3ff33b39f Support for Kerberoasting without pre-authentication and ST request through AS-REQ (#1413)
* Support for ASREPKerberoast

* Fixing undefined name 'tgs'

* Typo on the argument, -preauth changed to -no-preauth

* Fixing args handling, -usersfile is needed if -no-preauth

* Handling case when service is None

* Update kerberosv5.py

* adding param to getKerberosTGT to return or raise depending on context

* specifying serverName param in getKerberosTGT calls

* specifying serverName param in getKerberosTGT calls
2023-10-04 19:23:51 -03:00
Brendan Scarvell 9c8f344bb7 Updated the help information for -outputfile to be consistent with -save with it enabling -request (if previously omitted). (#1607) 2023-09-21 02:07:54 -03:00
Gabriel Gonzalez 9b4a139405 Updated Copyright to 2023 2023-07-31 11:48:28 -03:00
ThePirateWhoSmellsOfSunflowers 263df226d7 add a -stealth flag to GetUserSPNs
by @clavoillotte
2023-02-17 15:49:41 +01:00
ThePirateWhoSmellsOfSunflowers b40d3a6b26 use LDAP paged search in GetUserSPNs.py
should fix #1485
2023-02-17 10:40:04 +01:00
adrian manrique c812d6c795 Merge pull request #1135 from ShutdownRepo/getuserspns
Improved searchFilter for GetUserSPNs
2023-02-07 12:21:34 -03:00
0xdeaddood b7f0e65caa Modified getKerberosTGS function in GetUserSPNs.py
After PR #1363, the function getKerberosTGS used the KDC Host name instead of its IP address. This PR modifies that. It should fix #1468.
2023-01-20 01:25:18 -03:00
Gabriel Gonzalez 8799a1a2c4 Update file banners to reflect Fortra ownership 2022-12-14 17:28:23 -03:00
0xdeaddood 9421672ee6 Improved error handling
* Added SMB session error handling in getMachineName() (SMB blocked).
* Added LDAP session error handling in NTLM authentication (NTLM disabled).
2022-06-28 23:16:00 -03:00
0xdeaddood 181827dda0 Merge branch 'add-dc-host-option' into dc-host-option
# Conflicts:
#	examples/GetADUsers.py
#	examples/GetNPUsers.py
#	examples/GetUserSPNs.py
#	examples/findDelegation.py
#	examples/raiseChild.py
2022-06-24 15:47:40 -03:00
kiwids fa5f661e29 fixing GetUserSPN.py enctype aes128
Missed a parenthesis so that the output result will not be fully shown
2022-06-05 19:29:29 -05:00
0xdeaddood 165361a83a Updated copyright year 2022-03-10 11:34:10 -03:00
Roman Maksimov 1409b455c8 add the parseFile class method and remove all the duplicate code 2021-10-30 22:33:43 +03:00
Shutdown 9df91ae0b9 Improved searchFilter
Previous searchFilter resulted in a list of accounts missing vulnerable users
2021-08-02 14:52:13 +02: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
Arseniy Sharoglazov 2deb6ed449 Fixing store_true default value 2020-09-12 00:33:14 +03:00
Arseniy Sharoglazov 2d874dc917 Changing SANs in the output to the Impacket format 2020-08-10 01:48:58 +03:00
Arseniy Sharoglazov 872ac0e29a Changing SPNs to SANs in GetUserSPNs.py as it's more reliable 2020-08-10 01:17:36 +03:00
Arseniy Sharoglazov c2837a135c Adding -usersfile flag to GetUserSPNs.py
* Added -usersfile flag to GetUserSPNs.py
* Handling of -usersfile flag in GetNPUsers.py is moved higher to skip unnecessary connections to SMB (BTW, it's weird that the script connects to SMB in Kerberoasting)
2020-08-10 00:24:53 +03:00
Arseniy Sharoglazov bbae145c1f Changing sizeLimit in GetUserSPNs.py 2020-08-09 23:50:35 +03:00
Roman Maksimov cfe14a8741 fix string formatting 2020-05-13 14:21:00 +03:00
Roman Maksimov db2b13e0c9 add -dc-host option 2020-05-13 14:21:00 +03:00
Roman Maksimov 5d75530d1b add SMB timeout handling 2020-04-27 03:38:08 +03:00
Arseniy Sharoglazov 3506a60736 Fixing Travis CI tests after adding RPC over HTTP v2 realization 2020-04-02 08:58:17 +03:00
Arseniy Sharoglazov abb991572d Normalizing [domain/]user[:password] regexps to the right one 2020-04-02 07:33:52 +03:00
asolino 8d4c91481b Print Library's installation path by default when -debug is specified 2020-02-05 19:52:39 -03:00
G0ldenGunSec 416f1893c9 fixed python 3 issues
tabs to spaces
2020-01-08 20:53:34 -06:00
G0ldenGunSec da3b1f9419 Update GetUserSPNs.py 2019-12-08 13:14:47 -06:00
G0ldenGun 2397ec2465 Delegation Retrieval Functionality
Added a column to GetUserSPNs.py that returns delegation information associated with the account.  Useful to help identify accounts to target & to expose additional potential attack paths.
2019-12-08 13:08:15 -06:00
Vyacheslav Syrovatsky 0a7ba186a0 Fix the warning added to Python 3.8: SyntaxWarning: "is" with a literal. Did you mean "=="? 2019-11-28 17:14:28 +03:00
asolino c97c69f1a5 Merge branch 'master' into python36 2019-03-13 20:55:27 -03:00
Fist0urs 2cf24ed6a0 Fix incorrect checksum within aes128-aes256 + format output for john/hashcat accordingly 2019-03-10 12:59:12 +01:00
asolino 553881b9da Merge branch 'master' into python36 2018-12-05 12:16:54 -03:00
asolino c328de8252 Changing Copyright notice 2018-12-05 12:14:55 -03:00
asolino 4446728b2d Merge branch 'master' into python36 2018-11-19 15:55:27 -03:00
Dirkjan Mollema 977ae7b8d3 Bugfixes and cross-domain support in GetUserSPNs.py 2018-11-17 14:59:29 +01:00
asolino f3e43b8b80 Fixing -outputfile scenario in Python3 2018-10-11 12:54:35 -03:00
asolino ba29ac6082 GetUserSPNs.py Python3 port
- test_ldap.py passing (PY2 / PY3)
2018-10-10 22:50:18 -03:00
asolino 5f5678ba8f Documentation change plus using logging.error instead of print 2018-05-28 18:50:45 -03:00
derUnbekannt 9910f2214a Replace global variables usage 2018-05-16 22:30:19 -03:00
asolino 42e6367b4c Improved query efficiency + unused variables
* LDAP request is explicitly removing machine accounts
* Some imports and local variables not being used
* Thanks @derUnbekannt for the changes
2018-05-10 11:30:07 -03:00
asolino 9d8638cdf1 Print traceback info if running in DEBUG mode 2018-05-04 18:25:44 -03:00
asolino 0b28d94832 Using raise the right way + removing print from traceback.print_exc() 2018-05-03 21:21:36 -03:00