byt3bl33d3r / CrackMapExec

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

CME fails to start because pywerview is python2 only #396

Closed GIJack closed 4 years ago

GIJack commented 4 years ago

Steps to reproduce

  1. Install CME 5.1.0dev
  2. run cme --version

Command string used

CME

CME verbose output (using the --verbose flag)

$ cme Traceback (most recent call last): File "/usr/bin/cme", line 33, in sys.exit(load_entry_point('crackmapexec==5.1.0.dev0', 'console_scripts', 'cme')()) File "/usr/lib/python3.8/site-packages/cme/crackmapexec.py", line 36, in main args = gen_cli_args() File "/usr/lib/python3.8/site-packages/cme/cli.py", line 71, in gen_cli_args protocol_object = p_loader.load_protocol(protocols[protocol]['path']) File "/usr/lib/python3.8/site-packages/cme/loaders/protocol_loader.py", line 12, in load_protocol protocol = imp.load_source('protocol', protocol_path) File "/usr/lib/python3.8/imp.py", line 169, in load_source module = _exec(spec, sys.modules[name]) File "", line 604, in _exec File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/usr/lib/python3.8/site-packages/cme/protocols/smb.py", line 31, in from pywerview.cli.helpers import * File "/usr/lib/python3.8/site-packages/pywerview/cli/helpers.py", line 187 return requester.get_netgpo(queried_gponame=queried_gponame, ^ TabError: inconsistent use of tabs and spaces in indentation

CME Version (cme --version)

5.2.0

OS

Arch Linux

Target OS

Arch Linux

Detailed issue explanation

Upon further investigation the error seemed to be comming from pywerview. This is core part of the program.

build/lib/cme/protocols/smb.py:from pywerview.cli.helpers import *

https://github.com/the-useless-one/pywerview

Python 2.7

Python3 program is attempting to call a python2 lib, and failing.

Should be noted that pypi has this lib that will pull from pip3, but this is still python2 only code.

mpgn commented 4 years ago

How did you install cme ?

GIJack commented 4 years ago

I tried three methods.

  1. using python-pip from archlinux.
  2. using git on archliunux
  3. Trying to write a PKGBUILD script for Arch AUR:

https://pastebin.com/ceAr4Jmd

mpgn commented 4 years ago

Fixed in https://github.com/byt3bl33d3r/CrackMapExec/commit/e58930581e2419bd94d3549b540cf510cc645df5 :)