byt3bl33d3r/CrackMapExec

SyntaxError: multiple exception types must be parenthesized

aleixsb opened this issue · 2 comments

Describe the bug
crackmapexec is no longer working for me in Kali linux

To Reproduce

image

└─$ crackmapexec Traceback (most recent call last): File "/usr/bin/crackmapexec", line 8, in <module> sys.exit(main()) File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 117, in main args = gen_cli_args() File "/usr/lib/python3/dist-packages/cme/cli.py", line 76, in gen_cli_args protocol_object = p_loader.load_protocol(protocols[protocol]['path']) File "/usr/lib/python3/dist-packages/cme/loaders/protocol_loader.py", line 15, in load_protocol protocol = imp.load_source('protocol', protocol_path) File "/usr/lib/python3.10/imp.py", line 170, in load_source module = _exec(spec, sys.modules[name]) File "<frozen importlib._bootstrap>", line 619, in _exec File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/cme/protocols/rdp.py", line 11, in <module> from aardwolf.commons.factory import RDPConnectionFactory File "/usr/lib/python3/dist-packages/aardwolf/commons/factory.py", line 9, in <module> from aardwolf.vncconnection import VNCConnection File "/usr/lib/python3/dist-packages/aardwolf/vncconnection.py", line 17, in <module> from unicrypto.symmetric import DES, MODE_ECB File "/usr/lib/python3/dist-packages/unicrypto/__init__.py", line 45, in <module> importlib.util.find_spec(pref_to_module[prefname]) File "/usr/lib/python3.10/importlib/util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "/home/kali/.local/lib/python3.10/site-packages/Crypto/Random/__init__.py", line 28, in <module> from Crypto.Random import OSRNG File "/home/kali/.local/lib/python3.10/site-packages/Crypto/Random/OSRNG/__init__.py", line 32, in <module> from Crypto.Random.OSRNG.posix import new File "/home/kali/.local/lib/python3.10/site-packages/Crypto/Random/OSRNG/posix.py", line 66 except IOError, e: ^^^^^^^^^^ SyntaxError: multiple exception types must be parenthesized

Crackmapexec info

  • OS: Kali 2022.4
    └─$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Kali
    Description: Kali GNU/Linux Rolling
    Release: 2022.4
    Codename: kali-rolling
  • Version of CME 5.2.3
  • Installed from apt and pipx

I got the same issue as well. But the error message is quite descriptive though.

If you just want a quick fix, you can just open the file /home/kali/.local/lib/python3.10/site-packages/Crypto/Random/OSRNG/posix.py on line 66 in your editor and put parenthesis around except IOError, e: like so except (IOError, e):

That solved it for me and crackmapexec is running again. Although it is only a quickfix until it is solved.

Thanks! this change indeed seems to solve the issue