You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Linux LDAP servers go undetected with a NetExec LDAP scan when there is no SMB/Samba server running on the host. I recently set up an LDAP anonymous bind server to test out something I'm working on and when I run NetExec, either in scan mode or by directly targeting the LDAP server IP address, it returns no results. See the following:
To Reproduce
Steps to reproduce the behavior i.e.:
Command(s): netexec ldap linux_ldap_server_ip_or_hostname --no-smb # this is what triggers the stack trace netexec ldap linux_ldap_server_ip_or_hostname # this doesn't trigger an error but it doesn't identify the LDAP server either
Expected behavior
The LDAP server should be identified by NetExec with or without the --no-smb flag (but especially with the --no-smb flag).
NetExec info
OS:
root@redacted:/opt# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
root@redacted:/opt# uname -a
Linux vpentest 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Version of nxc: 1.2.0 - ItsAlwaysDNS - e927f33
Installed from: pipx
Screenshots
Without the --no-smb-flag:
When I add in the --no-smb flag, I get the following error:
Potential Remediation Idea
LDAP servers will (as far as I know) always allow you to bind to them in order to get the Directory Service Entry (The DSE includes the domain name and naming contexts along with some other details. nmap does this when scanning with the -sC or -A flags). This bind does not require any credentials. See example below:
This is a way you could check if an LDAP server is available without requiring any SMB interaction and would, more specifically, be much more reliable, especially on Linux-based LDAP platforms (OpenLDAP, ApacheDS, etc...).
Thoughts? Let me know if you need more input and thank you!
The text was updated successfully, but these errors were encountered:
Imo NetExec is not designed to "scan" for targets. It rather should be used to exploit/use enumerated targets. Therefore, i think "not detecting" an edge case or unusual setup is not a fault of the tool itself, as we need SMB for enumerating the targets OS/hostname/domain. This should be done with nmap or something similar.
The crash with --no-smb is definitely a bug though! As you are not using a Domain Controller you probably also don't have ntlm available?
Still, in a normal AD environment it looks like it is still working:
Can you provide the debug log for further debugging?
Describe the bug
Linux LDAP servers go undetected with a NetExec LDAP scan when there is no SMB/Samba server running on the host. I recently set up an LDAP anonymous bind server to test out something I'm working on and when I run NetExec, either in scan mode or by directly targeting the LDAP server IP address, it returns no results. See the following:
To Reproduce
Steps to reproduce the behavior i.e.:
Command(s):
netexec ldap linux_ldap_server_ip_or_hostname --no-smb # this is what triggers the stack trace
netexec ldap linux_ldap_server_ip_or_hostname # this doesn't trigger an error but it doesn't identify the LDAP server either
Resulted in:
Expected behavior
The LDAP server should be identified by NetExec with or without the --no-smb flag (but especially with the --no-smb flag).
NetExec info
root@redacted:/opt# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy root@redacted:/opt# uname -a Linux vpentest 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
1.2.0 - ItsAlwaysDNS - e927f33
Screenshots
Without the --no-smb-flag:
When I add in the --no-smb flag, I get the following error:
Potential Remediation Idea
LDAP servers will (as far as I know) always allow you to bind to them in order to get the Directory Service Entry (The DSE includes the domain name and naming contexts along with some other details.
nmap
does this when scanning with the-sC
or-A
flags). This bind does not require any credentials. See example below:This is a way you could check if an LDAP server is available without requiring any SMB interaction and would, more specifically, be much more reliable, especially on Linux-based LDAP platforms (OpenLDAP, ApacheDS, etc...).
Thoughts? Let me know if you need more input and thank you!
The text was updated successfully, but these errors were encountered: