byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.45k stars 1.64k forks source link

Missing modules when installing with pipx #510

Closed extrwi closed 2 years ago

extrwi commented 2 years ago

Describe the bug After installation with pipx, ~/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/data does not contain any subdirectories.

To Reproduce Steps to reproduce the behavior:

  1. Run pipx install crackmapexec
  2. Run crackmapexec smb -M Get-ComputerDetails
  3. See error
Traceback (most recent call last):
  File "/home/extrwi/.local/bin/crackmapexec", line 8, in <module>
    sys.exit(main())
  File "/home/extrwi/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/crackmapexec.py", line 222, in main
    module = loader.init_module(props['path'])
  File "/home/extrwi/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/loaders/module_loader.py", line 96, in init_module
    module.options(context, module_options)
  File "/home/extrwi/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/modules/Get-ComputerDetails.py", line 26, in options
    self.ps_script1 = obfs_ps_script('cme_powershell_scripts/Get-ComputerDetails.ps1')
  File "/home/extrwi/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/helpers/powershell.py", line 57, in obfs_ps_script
    with open(get_ps_script(path_to_script), 'r') as script:
FileNotFoundError: [Errno 2] No such file or directory: '/home/extrwi/.local/pipx/venvs/crackmapexec/lib/python3.8/site-packages/cme/data/cme_powershell_scripts/Get-ComputerDetails.ps1'

Expected behavior pipx should have installed all modules.

Crackmapexec info

mpgn commented 2 years ago

In fact this file does not exist anymore, module need to be deleted