NetExec
NetExec copied to clipboard
bool object not iterable
Describe the bug When attempting to run the LAPS module, I get a python error
To Reproduce
Steps to reproduce the behavior i.e.:
Command: netexec ldap <DC> -d <DOMAIN> -u <USER> -p '<PASS>' --module laps
Resulted in:
[13:39:23] ERROR Exception while calling proto_flow() on target X.X.X.X: 'bool' object is not iterable connection.py:124
╭─────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────╮
│ /root/.venvs/netexec/lib/python3.11/site-packages/nxc/connection.py:122 in __init__ │
│ │
│ 119 │ │ │ sleep(value) │
│ 120 │ │ │
│ 121 │ │ try: │
│ ❱ 122 │ │ │ self.proto_flow() │
│ 123 │ │ except Exception as e: │
│ 124 │ │ │ self.logger.exception(f"Exception while calling proto_flow() on target │
│ {self.host}: {e}") │
│ 125 │
│ │
│ /root/.venvs/netexec/lib/python3.11/site-packages/nxc/connection.py:172 in proto_flow │
│ │
│ 169 │ │ │ if self.print_host_info() and (self.login() or (self.username == "" and │
│ self.password == "")): │
│ 170 │ │ │ │ if hasattr(self.args, "module") and self.args.module: │
│ 171 │ │ │ │ │ self.logger.debug("Calling modules") │
│ ❱ 172 │ │ │ │ │ self.call_modules() │
│ 173 │ │ │ │ else: │
│ 174 │ │ │ │ │ self.logger.debug("Calling command arguments") │
│ 175 │ │ │ │ │ self.call_cmd_args() │
│ │
│ /root/.venvs/netexec/lib/python3.11/site-packages/nxc/connection.py:226 in call_modules │
│ │
│ 223 │ │ │ │
│ 224 │ │ │ if hasattr(module, "on_login"): │
│ 225 │ │ │ │ self.logger.debug(f"Module {module.name} has on_login method") │
│ ❱ 226 │ │ │ │ module.on_login(context, self) │
│ 227 │ │ │ │
│ 228 │ │ │ if self.admin_privs and hasattr(module, "on_admin_login"): │
│ 229 │ │ │ │ self.logger.debug(f"Module {module.name} has on_admin_login method") │
│ │
│ /root/.venvs/netexec/lib/python3.11/site-packages/nxc/modules/laps.py:39 in on_login │
│ │
│ 36 │ │ │ "sAMAccountName", │
│ 37 │ │ ] │
│ 38 │ │ results = connection.search(searchFilter, attributes, 0) │
│ ❱ 39 │ │ results = [r for r in results if isinstance(r, │
│ ldapasn1_impacket.SearchResultEntry)] │
│ 40 │ │ if len(results) != 0: │
│ 41 │ │ │ laps_computers = [] │
│ 42 │ │ │ for computer in results: │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'bool' object is not iterable
Expected behavior Either LAPS passwords are output, or a clean error as to what went wrong
NetExec info
- OS: Kali
- Version of nxc: 1.1.0
- Installed from: Cloned github, made a virtual env,
pip install .
as per docs