Commit Graph

71 Commits

Author SHA1 Message Date
Alex 578733af71 Fix 2 critical bugs in ntlmrelayx (#2019)
* Fix getFileTime missing import

* Fix SSL settings
2025-08-10 22:14:44 -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
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 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
5alt 6c7229fccb Fix reading binary file error while using custom exe file
Replace all `open(self.__exeFile)` to `open(self.__exeFile, 'rb')`
2020-09-02 13:29:05 +08: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
n1ngod a0ad462c49 fix the import path of hLsarOpenPolicy2 2019-08-12 17:51:07 +08: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 ec77ea3d06 Code cleanup homework
- Optimizing imports
- Removing unused variables
- Still a lot to do.
- Test cases passing OK
2018-12-04 14:47:16 -03:00
asolino 1c5c275dad goldenPac.py port to Python3 2018-10-09 13:22:08 -03:00
Dirkjan Mollema 53b4395aa0 Replace pycrypto with pycryptodome 2018-08-25 17:25:17 +02: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
luz.paz 0e96b60b92 Misc. typos
Found via `codespell -q 3 -I ../impacket-word-whitelist.txt` through downstream `curl`
2018-03-16 09:42:21 -04:00
asolino 3d88b7682a Adding backward compatibility till pyasn-0.2.3 (at least) + supporting 0.4.2 2017-11-23 19:59:30 -03:00
asolino c001138f76 Small changes to make it compatible with pyasn1-0.3.7.
- IMPORTANT: This is not backward compatible with old pyasn1 versions. Be sure you run 0.3.7.
2017-11-23 15:40:18 -03: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 053cb994d6 Removing PAC structures and using the ones located in the library
* Now located at impacket.krb5.pac
2016-08-02 10:28:38 -03:00
asolino b6f2845997 Reformating code
* To keep it within 80 chars wide
* Empty domain check fixed
2016-05-15 18:46:20 -03:00
asolino 8c04d96979 Updating copyright notice. Welcome 2016 2016-01-06 14:08:30 -03:00
asolino 5851bd0cb9 Applying @0xsauby fix for password with '@' to the rest of the example scripts 2015-11-26 14:55:19 -03:00
asolino 5ab22cf8c0 Trying give it a second try if there is a decoding issue happening
* Especially important when dealing with international characters
2015-09-18 17:13:32 -03:00
asolino 0524363e88 Applying same modifications as https://github.com/CoreSecurity/impacket/commit/1f3cbff8df56344ba4d5552b0ddb8f3cb095194d to goldenPac and raiseChild 2015-09-16 13:38:38 -03:00
asolino 37ebbbbb7d Testing all DCs in domain and adding forest's enterprise admin group inside PAC 2015-09-11 13:47:57 -03:00
asolino 8c094b7998 Adding eXecute permissions to the scripts, fixing https://github.com/CoreSecurity/impacket/issues/71 2015-06-25 09:50:19 -03:00
asolino 6ef8ae60bb Replacing decode('hex')/encode('hex')
for binascii's hexlify/unhexlify, mainly because of http://bugs.python.org/issue7475
and Python3 not having it.
2015-05-26 19:41:31 -03:00
asolino 4e32a0d498 Removing some pyCharm's erros/warnings
More scripts/libs changed. Hopefully doesn't break a thing. Test cases are passing
2015-05-25 20:40:17 -03:00
asolino 8b8f8a6947 Pyton imports fixups
1) Removed unnecesary imports, avoid import * whenever possible
2) Copyright updated
3) Minor typos fixed
4) File formats to Unix (LF)
2015-05-23 11:56:59 -03:00
asolino 9c980a7304 Fix some typos 2015-05-05 19:07:39 -03:00
asolino 4c2e64ad3a Second round of logging change.
Now there should be a single logger called 'impacket' the library uses.
By default is has a NullHandler so nothing is printed, but messages are
forwarded to the upstream logger.

If you are a script using the library and want to set the root logger
with a custom formatter, you can import impacket.examples.logger.

After some testing I'll merge it into master
2015-04-25 14:40:42 -03:00
asolino 119e4438dd Changing logging mechanisms everywhere.
Full details coming soon
2015-04-25 14:40:41 -03:00
bethus@gmail.com 04fd08a4a4 Fixed a typo and clarified the examples 2015-04-10 19:53:09 +00:00
bethus@gmail.com 1f377339ff Adding -target-ip switch in case you cannot resolve it 2015-04-10 19:00:37 +00:00
bethus@gmail.com a46cad1955 Adding more checks in case we get a KDC_ERR_ETYPE_NOSUPP error. We try to switch to RC4 and hope for the best 2015-04-09 19:19:47 +00:00
bethus@gmail.com 5a2a246f3d Adding TGT, TGS when receiving get_credentials() data 2015-03-20 19:21:09 +00:00
bethus 38a915a054 Forgot one raise ;) 2015-02-07 23:51:38 +00:00
bethus 9a9b402252 Attack might have worked, but when asking for the cifs TGS we get KDC_ERR_ETYPE_NOSUPP. If that happens, we try all over again using RC4 2015-02-07 23:48:28 +00:00
bethus@gmail.com b3c614ab6b Adding support for pass the key 2015-01-30 17:28:37 +00:00
bethus@gmail.com e7ff108ece Updated description 2015-01-23 12:54:36 +00:00
bethus@gmail.com bbce63a34a Clarifying target could be an IP address or targetName 2015-01-14 16:32:03 +00:00
bethus@gmail.com 107b3bc6a1 Copyright update 2015-01-09 21:55:22 +00:00