byt3bl33d3r / CrackMapExec

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

Fail to initializing SSH protocol at first run #193

Closed Mys7ic closed 7 years ago

Mys7ic commented 7 years ago

Steps to reproduce

reinitialize

  1. rm -R .cme/
  2. cme

CME verbose output (using the --verbose flag)

[] First time use detected [] Creating home directory structure [] Creating default workspace [] Initializing SMB protocol database [] Initializing HTTP protocol database [] Initializing SSH protocol database Traceback (most recent call last): File "/usr/local/bin/cme", line 11, in load_entry_point('crackmapexec==4.0.0.dev0', 'console_scripts', 'cme')() File "/usr/local/lib/python2.7/site-packages/crackmapexec-4.0.0.dev0-py2.7.egg/cme/crackmapexec.py", line 31, in main first_run_setup(logger) File "/usr/local/lib/python2.7/site-packages/crackmapexec-4.0.0.dev0-py2.7.egg/cme/first_run.py", line 55, in first_run_setup getattr(protocol_object, 'database').db_schema(c) File "/usr/local/lib/python2.7/site-packages/crackmapexec-4.0.0.dev0-py2.7.egg/cme/protocols/ssh/database.py", line 13, in db_schema )''') sqlite3.OperationalError: near ")": syntax error

OS

every OS

Target OS

2.7.13-alpine

Detailed issue explanation

while run cme the first time, it drop a error. I search for the reason in the code and find the problem. There is a comma too much in line 12 of the Python file CrackMapExec/cme/protocols/ssh/database.py

https://github.com/byt3bl33d3r/CrackMapExec/blob/master/cme/protocols/ssh/database.py#L12

byt3bl33d3r commented 7 years ago

@evs-as nice catch, just pushed the fix. delete the ~/.cme directory and you should be good to go