byt3bl33d3r/CrackMapExec

TypeError: unsupported operand type(s) for |: 'type' and 'type'

RJSOG opened this issue · 2 comments

RJSOG commented

Describe the bug

Can't run crackmapexec because of the following error : "TypeError: unsupported operand type(s) for |: 'type' and 'type'" from crackmapexec/lib/python3.8/site-packages/aardwolf/extensions/RDPEDYC/vchannels/init.py", line 22

Bug appearsa after à fresh install of cracmapexex by following instructions from and by trying to run crackmapexec for the first time.: https://wiki.porchetta.industries/getting-started/installation/installation-on-unix : Python Package

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://wiki.porchetta.industries/getting-started/installation/installation-on-unix' and follow the Python Package instructions .
  2. Run crackmapexec

Expected behavior
Show help message and exit

Screenshots
image

Crackmapexec info

  • OS: [WSL - Ubuntu]
  • Version of CME [5.4.1]
  • Installed from Python Package / Github

Additional context
Stack Trace:
Traceback (most recent call last):
File "/home/unixjesus/.local/bin/crackmapexec", line 8, in
sys.exit(main())
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/crackmapexec.py", line 117, in main
args = gen_cli_args()
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/cli.py", line 76, in gen_cli_args
protocol_object = p_loader.load_protocol(protocols[protocol]['path'])
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/loaders/protocol_loader.py", line 15, in load_protocol
protocol = imp.load_source('protocol', protocol_path)
File "/usr/lib/python3.8/imp.py", line 169, in load_source
module = _exec(spec, sys.modules[name])
File "", line 604, in _exec
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/protocols/rdp.py", line 11, in
from aardwolf.commons.factory import RDPConnectionFactory
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/aardwolf/commons/factory.py", line 4, in
from aardwolf.commons.iosettings import RDPIOSettings
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/aardwolf/commons/iosettings.py", line 5, in
from aardwolf.extensions.RDPEDYC.channel import RDPEDYCChannel
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/aardwolf/extensions/RDPEDYC/channel.py", line 15, in
from aardwolf.extensions.RDPEDYC.vchannels import VirtualChannelBase
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/aardwolf/extensions/RDPEDYC/vchannels/init.py", line 6, in
class VirtualChannelBase:
File "/home/unixjesus/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/aardwolf/extensions/RDPEDYC/vchannels/init.py", line 22, in VirtualChannelBase
async def channel_rawdata_in(self, msg:DYNVC_DATA_FIRST | DYNVC_DATA):
TypeError: unsupported operand type(s) for |: 'type' and 'type'

Understanding the error
Error is due to to the unsupported operand '|' which is only available on Python 10.x.x but Python 3.8 is used.

Fixing the error
vim crackmapexec/lib/python3.8/site-packages/aardwolf/extensions/RDPEDYC/vchannels/__init__.py
at line 22 change:
async def channel_rawdata_in(self, msg:DYNVC_DATA_FIRST | DYNVC_DATA):
to:
async def channel_rawdata_in(self, msg:DYNVC_DATA_FIRST or DYNVC_DATA):

mpgn commented

Thanks for the report ! fix is on his way

mpgn commented

fixed