byt3bl33d3r / CrackMapExec

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

Poetry could not find a pyproject.toml file #755

Closed Paradoxis closed 1 year ago

Paradoxis commented 1 year ago

Describe the bug Whenever crackmapexec is run from outside the installation directory, poetry fails with the error:

$ poetry run crackmapexec
Poetry could not find a pyproject.toml file in <path> or its parents

I tried adding a workaround by doing two things:

To Reproduce Steps to reproduce the behavior:

  1. Install cme from source as per the wiki
  2. Run cme using poetry outside of the source directory
  3. The error occurs

Expected behavior I expected to be able to run cme from anywhere as was possible in previous versions. The usability of the tool is significantly diminished when I'm forced to change directories back to a specific directory every single time.

Preferably, I'd just be able to install the tool and run it whenever

Crackmapexec info

Additional context Building the dockerfile also doesn't work:

$ sudo docker build -t cme:latest .
$ sudo docker run --rm -it cme:latest 
[*] First time use detected
[*] Creating home directory structure
[*] Creating default workspace
[*] Initializing SMB protocol database
[*] Initializing RDP protocol database
[*] Initializing WINRM protocol database
[*] Initializing SSH protocol database
[*] Initializing LDAP protocol database
[*] Initializing MSSQL protocol database
[*] Copying default configuration file
[*] Generating SSL certificate
aardwolf librairy is missing, you need to install the submodule
run the command: 
NeffIsBack commented 1 year ago

Once you ran poetry install in the crackmapexec folder you should be able to just run the python file itself without using poetry from anywhere you want. Can you try that?

Paradoxis commented 1 year ago

Hey @NeffIsBack, which python file do you mean exactly? The only python file file I see is build_collector.py, and crackmapexec.spec. Both fail when just running directly as they can't find the dependencies (as expected). The following is my directory structure after doing the whole installation:

build_collector.py  
cme  
crackmapexec.spec  
Dockerfile  
flake.lock  
flake.nix  
LICENSE  
Makefile  
poetry.lock  
pyproject.toml  
README.md  
requirements.txt  
shell.nix
mpgn commented 1 year ago

Hello,

If you want cme everywhere, just run pip install . inside the crackmapexec folder :)

NeffIsBack commented 1 year ago

Sorry i was wrong about my thought with poetry. It won't work as i described, just follow mpgns instruction.

Paradoxis commented 1 year ago

Heya, yeah we tried what @mpgn suggested but it somehow is unable to install aardwolf using pip:

$ cme
aardwolf librairy is missing, you need to install the submodule
run the command:
mpgn commented 1 year ago

hum this version is old, this text doesn't exist anymore