59 Commits

Author SHA1 Message Date
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
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
asolino d2c9b36648 Trying to increase the likelihood of getting RC4 session tickets.
In order to maximize the probability of getting session tickets with RC4 etype, we will convert the
password to ntlm hashes (that will force to use RC4 for the TGT). If that doesn't work, we use the
cleartext password.
If no clear text password is provided, we just go with the defaults.
2018-02-20 19:36:03 -03:00
asolino 596e006f62 If getKerberosTGS fails, print the SPN that is failing along with the error 2017-12-04 12:51:37 -03:00
Jim Shaver 3800dc1e50 Added support for DES Kerberoast 2017-10-12 11:14:22 -05:00
Jim Shaver 9943cf1af9 Added support for AES Kerberoast tickets 2017-09-10 18:15:27 -05:00
Martin Gallo 4152e128b8 Replaced shebang with a virtualenv friendly one
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.
2017-01-11 12:43:54 -03:00
asolino c049506e43 Minor cosmetic changes 2016-09-13 23:54:50 -03:00
asolino cee61cd532 Getting rid of manual search filters and using just strings
* Way easier after @kacpern awesome PR!
2016-08-18 10:04:45 -03:00
asolino 4f792fb9f1 Adding -request-user parameter
* Requests TGS for the SPN associated to the user specified (just the username, no domain needed)
* Hopefully addresses https://github.com/CoreSecurity/impacket/issues/178
2016-07-18 13:58:23 -03:00
asolino 7c14486707 Replacing ':' for other character when building the JtR output
* If we don't replace ':' JtR gets confused.
* Hopefully addresses https://github.com/CoreSecurity/impacket/issues/179
2016-07-18 12:15:33 -03:00
asolino 9aeee403ca Adding the actual SPN to the JtR output produced (and saved via -outputfile)
* Now -outputfile automatically selects -request
2016-06-21 15:36:31 -03:00
asolino d6c065a820 Adding exception handler when processing each record
* Handling pwdLastSet if it was never changed (hopefully)
2016-06-21 14:47:35 -03:00
asolino 60f9fa627b Whenever we receive sizeLimitExceeded exception, we still process what we've got
* Will give you some results until we implement paged searches
2016-06-21 14:25:26 -03:00
asolino cea1937343 If ldap:// fails, we try ldaps:// 2016-05-30 18:49:11 -03:00
asolino d96a537059 Adding lastLogon to the output as well 2016-05-27 16:39:35 -03:00
asolino f5a053ac38 Improving the LDAP search filter to minimize traffic
* We're now asking for:
(&(servicePrincipalName=*)(UserAccountControl:1.2.840.113556.1.4.803:=UF_NORMAL_ACCOUNT)(!(UserAccountControl:1.2.840.113556.1.4.803:=UF_ACCOUNTDISABLE)))
Basically will return the normal accounts, not expired, that has an SPN set.
2016-05-26 22:17:39 -03:00