byt3bl33d3r / CrackMapExec

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

configparser.NoSectionError: No section: 'BloodHound' #530

Closed 0xGreen closed 2 years ago

0xGreen commented 2 years ago

Hi,

Updated kali that updates CME to 5.2.2 but start facing "configparser.NoSectionError: No section: 'BloodHound'"

Describe the bug configparser.NoSectionError: No section: 'BloodHound'

Expected behavior I had tried exact same command with CME version 5.1.7dev on the exact same target and it works absolutely fine.

Screenshots Output of the cme 5.2.2 release.

python cme smb win7 -u users.txt -p passwords.txt
SMB         win7            445    VM-WIN7          [*] Windows 7 Professional (...)
SMB         win7            445    VM-WIN7          [-] vm-win7\XXXXX:XXX STATUS_LOGON_FAILURE 
SMB         win7            445    VM-WIN7          [+] vm-win7\XXXX:XXXX (Pwn3d!)
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/cme/__main__.py", line 3, in <module>
  File "/tmp/cme/_bootstrap/__init__.py", line 247, in bootstrap
  File "/tmp/cme/_bootstrap/__init__.py", line 38, in run
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/crackmapexec.py", line 254, in main
    asyncio.run(
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/crackmapexec.py", line 102, in start_threadpool
    await asyncio.gather(*jobs)
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/crackmapexec.py", line 68, in run_protocol
    await asyncio.wait_for(
  File "/usr/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
    return await fut
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/protocols/smb.py", line 125, in __init__
    connection.__init__(self, args, db, host)
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/connection.py", line 62, in __init__
    self.proto_flow()
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/connection.py", line 98, in proto_flow
    if self.login() or (self.username == '' and self.password == ''):
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/connection.py", line 230, in login
    if self.plaintext_login(self.domain, usr.strip(), f_pass.strip()): return True
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/protocols/smb.py", line 366, in plaintext_login
    add_user_bh(self.username, self.domain, self.logger, self.config)
  File "/root/.shiv/cme_07092b96173e355ff627274451b8bc2652f1e95de5d91a29675c59dea64de19a/site-packages/cme/helpers/bloodhound.py", line 7, in add_user_bh
    if config.get('BloodHound', 'bh_enabled') != "False":
  File "/usr/lib/python3.9/configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.9/configparser.py", line 1152, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'BloodHound'

Crackmapexec info

Additional context No such issue with 5.1.7dev

Thanks.

mpgn commented 2 years ago

Duplicate of #519