byt3bl33d3r/CrackMapExec

Poetry could not find a pyproject.toml file

Paradoxis opened this issue · 6 comments

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:

  • Create an alias which changes directories, but this causes scanning a list of files to not work with relative path names.
  • Create a symbolic link to the pyproject file, but this causes even more errors.

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

  • OS: Debian 11
  • Version of CME: v5.3.0
  • Installed from git as apt and pip install the outdated versions.

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: 

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?

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

Hello,

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

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

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

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