Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bool object not iterable #177

Open
executionByFork opened this issue Feb 9, 2024 · 4 comments
Open

bool object not iterable #177

executionByFork opened this issue Feb 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@executionByFork
Copy link

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
@executionByFork
Copy link
Author

May be related: byt3bl33d3r/CrackMapExec#542

@NeffIsBack NeffIsBack added the bug Something isn't working label Feb 16, 2024
@NeffIsBack
Copy link
Contributor

Hey sorry for the late response. Is this somehow reproducible? Or a consistent error? To me this looks like some kind of one-time connection error (e.g. the ldap connection closed for some reason)

@executionByFork
Copy link
Author

executionByFork commented Apr 4, 2024

Yes, I recall being able to reproduce this issue at the time I submitted it, by firewalling off an IP with iptables and then attempting to connect to that IP as described above. I could have sworn I put that info in here with the bug report but looks like I did not. Apologies

@NeffIsBack
Copy link
Contributor

Thanks for the report! I'll dig into it when I find the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants