byt3bl33d3r / CrackMapExec

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

Add check for sane/up-to-date configuration file format #190

Closed str4n63r closed 7 years ago

str4n63r commented 7 years ago

Command string used -- crackmapexec smb 10.30.8.0/24

CME verbose output (using the --verbose flag)

**root@b0x:~/Desktop/PT_Stuff/impacket/examples# crackmapexec --verbose smb 10.30.8.0/24
Traceback (most recent call last):
  File "/usr/local/bin/crackmapexec", line 11, in <module>
    load_entry_point('crackmapexec==4.0.0.dev0', 'console_scripts', 'crackmapexec')()
  File "/usr/local/lib/python2.7/dist-packages/crackmapexec-4.0.0.dev0-py2.7.egg/cme/crackmapexec.py", line 52, in main
    current_workspace = config.get('CME', 'workspace')
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'CME'**

OS -- Kali Linux 2016 R2 (32-Bit)

Detailed issue explanation -- Received above error while launching crackmapexec

Help appreciated. Thanks in advance.

byt3bl33d3r commented 7 years ago

Delete the ~/.cme/cme.conf file and you should be good to go. Will be adding a check for this now.

byt3bl33d3r commented 7 years ago

Added check for this in https://github.com/byt3bl33d3r/CrackMapExec/commit/0b936def2306047afb7277ad77f8bb8df59d9dfe

It will automatically upgrade the config file if it detects it's in the old format. Cheers

str4n63r commented 7 years ago

@byt3bl33d3r Thanks a lot :+1: