Commit Graph

34 Commits

Author SHA1 Message Date
NuclearFizzler 835623aea5 GetNPUser.py: Single targets now correctly outputs hash to file (#1867)
* GetNPUsers.py: Single targets now correctly outputs hash to file

* Close file objects when done

* GetNPUsers.py: Cleaned up file handling
2025-08-20 20:37:17 -03:00
Asa Reynolds 6175e924fc update harmj0y blog link (#1978)
replace outdated link with current version
2025-06-11 10:43:48 -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
Jannik Vieten 835e17550b Fixed warnings with Python 3.12 (#1695)
* 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+
2024-10-24 09:00:11 -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
alexisbalbachan 632002dca7 Merge pull request #1567 from alexisbalbachan:impacket_1512
* TGT will also be printed on stdout even when writing to an output file
2023-06-16 11:50:39 -03:00
Christo Erasmus 3955729ee7 Fixed output hash formats for AES AS-REPs in GetNPUsers.py
Added additional checks in GetNPUsers.py to identify the use of AES
encryption types (etype 17/18) and format the output hashes accordingly
2023-05-15 14:35:53 +02: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
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 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
Roman Maksimov 6c2b061a65 fix #809 issue with Kerberos in GetNPUsers.py 2020-05-13 14:42:22 +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
0xdeaddood 3b41d48e07 Add the timestamp option to several scripts
- GetADUsers.py, GETNPUsers.py, getST.py, getTGT.py, goldenPac.py, secretsdump.py, ticketer.py
2019-12-18 11:34:56 -03: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 8529e901e8 Chaging syntax for Python 3.x support 2019-04-01 15:03:12 -03:00
asolino fcf8c53b88 Merge branch 'master' into python36 2019-03-16 09:18:04 -03:00
Zer1t0 9d2bfcb3d9 added usersfile option 2019-03-16 11:37:21 +01:00
Zer1t0 8651f50f41 added john/hashcat format option 2019-03-16 11:02:25 +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 7eeff437c7 More code cleanup homework
- Optimizing imports
- Removing unused variables
- Still a lot to do.
- Test cases passing OK
2018-12-04 17:07:52 -03:00
asolino 19334ddf54 Merge branch 'master' into python36 2018-11-19 12:30:38 -03:00
Viktor Szakats 3f29d8dcdb fix/secure URLs
* also remove/fix some whitespace such as tabs
  and spaces at EOL
2018-11-18 19:47:09 +00:00
asolino a9dec87e4d GetNPUSers.py Python3 port 2018-10-11 13:10:40 -03:00
asolino bada8a719f Adding GetNPUsers.py script
This script will attempt to list and get TGTs for those users that have the property
'Do not require Kerberos preauthentication' set (UF_DONT_REQUIRE_PREAUTH).
For those users with such configuration, a John The Ripper output will be generated so
you can send it for cracking.

Original credit for this technique goes to @harmj0y:
http://www.harmj0y.net/blog/activedirectory/roasting-as-reps/
Related work by Geoff Janjua:
http://www.exumbraops.com/layerone2016/party

For usage instructions run the script with no parameters
There are a few modes for using this script

1. Get a TGT for a user:

        GetNPUsers.py contoso.com/john.doe -no-pass

For this operation you don't need john.doe's password. It is important tho, to specify -no-pass in the script,
otherwise a badpwdcount entry will be added to the user

2. Get a list of users with UF_DONT_REQUIRE_PREAUTH set

        GetNPUsers.py contoso.com/emily:password or GetNPUsers.py contoso.com/emily

This will list all the users in the contoso.com domain that have UF_DONT_REQUIRE_PREAUTH set.
However it will require you to have emily's password. (If you don't specify it, it will be asked by the script)

3. Request TGTs for all users

        GetNPUsers.py contoso.com/emily:password -request or GetNPUsers.py contoso.com/emily
2018-05-29 10:58:03 -03:00