NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.24k stars 14.22k forks source link

crackmapexec: Fails to run with python 3.12 due to missing imp module #333529

Closed AkechiShiro closed 3 months ago

AkechiShiro commented 3 months ago

Describe the bug

crackmapexec fails to run on the unstable branch.

Full backtrace :

/nix/store/p599ivpsxjcg0rmipnf9xb8yx640vw18-crackmapexec-5.4.0/lib/python3.12/site-packages/cme/cli.py:35: SyntaxWarning: invalid escape sequence '\ '
  """,
Traceback (most recent call last):
  File "/nix/store/p599ivpsxjcg0rmipnf9xb8yx640vw18-crackmapexec-5.4.0/bin/.cme-wrapped", line 6, in <module>
    from cme.crackmapexec import main
  File "/nix/store/p599ivpsxjcg0rmipnf9xb8yx640vw18-crackmapexec-5.4.0/lib/python3.12/site-packages/cme/crackmapexec.py", line 10, in <module>
    from cme.cli import gen_cli_args
  File "/nix/store/p599ivpsxjcg0rmipnf9xb8yx640vw18-crackmapexec-5.4.0/lib/python3.12/site-packages/cme/cli.py", line 7, in <module>
    from cme.loaders.protocol_loader import protocol_loader
  File "/nix/store/p599ivpsxjcg0rmipnf9xb8yx640vw18-crackmapexec-5.4.0/lib/python3.12/site-packages/cme/loaders/protocol_loader.py", line 4, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

Steps To Reproduce

Steps to reproduce the behavior:

  1. run cme

Expected behavior

Should be marked as broken for python 3.12 and above due to not being maintained anymore, it should be recommended to use the maintained fork netexec.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

I may PR a proper fix later if I find time to do so

Notify maintainers

@fabaff

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.11-amd64, Kali GNU/Linux, 2024.2, nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.23.3`
 - channels(root): `"home-manager, nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

AkechiShiro commented 3 months ago

I don't know if removal was the best choice for this tool but maybe netexec has all the features that crackmapexec had so it's alright.

It's just that I'm not aware if there are any bugs that are not in crackmapexec that are in netexec but I understand why removal makes sense since later we'll move onto later version of Python such as 3.13 and further more

fabaff commented 3 months ago

I don't know if removal was the best choice for this tool but maybe netexec has all the features that crackmapexec had so it's alright.

As netexec is a fork, I guess that the feature set is comparable or even bigger in the meantime. crackmapexec is still available for 24.05 and could still be used after 24.11 with some magic.

AkechiShiro commented 3 months ago

I ran into this issue where cme didn't have it, it is just a minor issue so it's alright on my side, but not sure if there will be any more issues I'll ran into later : https://github.com/Pennyw0rth/NetExec/issues/395