byt3bl33d3r / CrackMapExec

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

Cannot run CrackMapExec due to missing pkg distribution #346

Closed roigershon15 closed 4 years ago

roigershon15 commented 4 years ago

Steps to reproduce

Steps taken:

  1. apt-get install -y python-setup tools
  2. apt-get install -y python3-setuptools
  3. apt-get install -y libssl-dev libffi-dev python-dev build-essential
  4. git clone https://github.com./byt3bl33d3r/CrackMapExec.git
  5. accessed to the flder and run #python setup.py install
  6. when i try to run #crackemapexec i goet the following error message:
    
    ===========================================
    root@Kali:~/HTB_Hacked/ServMon/CrackMapExec# crackmapexec
    Traceback (most recent call last):
    File "/usr/local/bin/crackmapexec", line 6, in <module>
    from pkg_resources import load_entry_point
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3251, in <module>
    @_call_aside
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'requests>=2.9.1' distribution was not found and is required by crackmapexec
    root@Kali:~/HTB_Hacked/ServMon/CrackMapExec# 
    ============================================

CME Version (cme --version)

when i check the version i get the following error message:

admin@Kali:~$ cme --version Traceback (most recent call last): File "/usr/local/bin/cme", line 6, in from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3251, in @_call_aside File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3235, in _call_aside f(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3264, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 583, i n _build_master ws.require(requires) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 900, i n require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 786, i n resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'requests-ntlm>=0.3.0' distribution was not found and is required by crackmapexec


## OS
Kali Linux:
Linux Kali 5.4.0-kali4-amd64 #1 SMP Debian 5.4.19-1kali1 (2020-02-17) x86_64 GNU/Linux

## Detailed issue explanation
cannot use CrackMapExec.
everytime i try to run #CrackMapExec , i get an error regarding missing pkg distribution.
i installed as all guides says, even installed further files/repositories but nothing reoslved my issue and i cannot use this tool :(

thank you for you assistance !!! :)
mpgn commented 4 years ago

Hello,

You are using crackmapexec with python2.7 which is not supported anymore by cme. Try with python3

apt-get install -y libssl-dev libffi-dev python-dev build-essential
git clone --recursive https://github.com/byt3bl33d3r/CrackMapExec
cd CrackMapExec
python3 setup.py install
roigershon15 commented 4 years ago

Hi,

thank you for your response. i tried your commands and got the following error message:

Installed /usr/local/lib/python3.8/dist-packages/crackmapexec-5.0.0.dev0-py3.8.egg Processing dependencies for crackmapexec==5.0.0.dev0 Searching for pylnk3>=0.3 Reading https://pypi.org/simple/pylnk3/ Download error on https://pypi.org/simple/pylnk3/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108) -- Some packages may not be found! Couldn't retrieve index page for 'pylnk3' Scanning index of all packages (this may take a while) Reading https://pypi.org/simple/ Download error on https://pypi.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108) -- Some packages may not be found! No local packages or working download links found for pylnk3>=0.3 error: Could not find suitable distribution for Requirement.parse('pylnk3>=0.3')

also i tried to install pylnk3 from github, but it did not resolve the issue and i get the same error message.

any other ideas? :)

mpgn commented 4 years ago

https://github.com/pypa/pip/issues/4205#issuecomment-277299106

byt3bl33d3r commented 4 years ago

Closing since this isn't related to CME anymore. Also i would reccomend using the binaries now. Check them out in the actions tab (I'll be updating the docs shortly).

Cheers

DOP7 commented 2 years ago

To install crackmapexec: sudo git clone https://github.com/byt3bl33d3r/CrackMapExec cd CrackMapExec pip3 install -r requirements.txt sudo apt install crackmapexec -y

Note: You can remove the folder crackmapexec after running requirements.txt (this is important before you install crackmapexec) This will not get you any above traceback errors,

JohnMorgan1234 commented 2 years ago

To install crackmapexec: sudo git clone https://github.com/byt3bl33d3r/CrackMapExec cd CrackMapExec pip3 install -r requirements.txt sudo apt install crackmapexec -y

Note: You can remove the folder crackmapexec after running requirements.txt (this is important before you install crackmapexec) This will not get you any above traceback errors,

This works 100%