Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular import when using keytab.py #1649

Open
ThePirateWhoSmellsOfSunflowers opened this issue Nov 14, 2023 · 0 comments
Open

Circular import when using keytab.py #1649

ThePirateWhoSmellsOfSunflowers opened this issue Nov 14, 2023 · 0 comments
Assignees
Labels
bug Unexpected problem or unintended behavior

Comments

@ThePirateWhoSmellsOfSunflowers
Copy link
Contributor

Configuration

impacket version: 33058eb

Debug Output With Command String

I want to parse a keytab with the built-in script (impacket/krb5/keytab.py):

(venv) user@desktop:~/impacket (master) $ python ./impacket/krb5/keytab.py ~/loot/test/krb5.keytab
Traceback (most recent call last):
  File "./impacket/krb5/keytab.py", line 20, in <module>
    from enum import Enum
  File "/usr/lib/python3.8/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "~/impacket/impacket/krb5/types.py", line 38, in <module>
    import socket
  File "/usr/lib/python3.8/socket.py", line 53, in <module>
    from enum import IntEnum, IntFlag
ImportError: cannot import name 'IntEnum' from partially initialized module 'enum' (most likely due to a circular import) (/usr/lib/python3.8/enum.py)

Calling the function through python cli works:

>>> from impacket.krb5 import keytab
>>> keytab = keytab.Keytab.loadFile("~/loot/test/krb5.keytab")
>>> keytab.prettyPrint()
Keytab Entries:
[0]
	Principal: b'REDACTED$@REDACTED.LOCAL'
	Timestamp: 2023-10-26T12:52:53	KVNO: 78
	Key: (AES256)b'6[...]b4'
[...]

Additional context

Seems trivial to fix but I don't know how to do this the pythonic way.

@alexisbalbachan alexisbalbachan self-assigned this Nov 16, 2023
@alexisbalbachan alexisbalbachan added the bug Unexpected problem or unintended behavior label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants