Skip to content

Fix references to LDAP Datastore Options #20262

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bwatters-r7
Copy link
Contributor

Fixes #20259
Replaces old datastore options with new datastore options.

@adfoster-r7
Copy link
Contributor

          If the bind username and password are provided (BIND_DN and BIND_PW
          options), these credentials will be used instead of attempting an
          anonymous bind.

Looks like the module's description needs updated

Co-authored-by: Brendan <bwatters@rapid7.com>
@smcintyre-r7
Copy link
Contributor

This is crashing with network errors but they're unrelated to the changes in this PR. If you apply this patch however I can test these changes by showing that it's successfully binding to the target LDAP server.

diff --git modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb
index ac48322022..3fa1f789db 100644
--- modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb
+++ modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb
@@ -102,9 +102,16 @@ class MetasploitModule < Msf::Auxiliary
       # HACK: Stash discovered base DN in CheckCode reason
       Exploit::CheckCode::Vulnerable(base_dn)
     end
+  rescue Errno::ECONNRESET
+    fail_with(Failure::Disconnected, 'The connection was reset.')
+  rescue Rex::ConnectionError => e
+    fail_with(Failure::Unreachable, e.message)
+  rescue Rex::Proto::Kerberos::Model::Error::KerberosError => e
+    fail_with(Failure::NoAccess, e.message)
+  rescue Rex::Proto::LDAP::LdapException => e
+    fail_with(Failure::NoAccess, e.message)
   rescue Net::LDAP::Error => e
-    print_error("#{e.class}: #{e.message}")
-    Exploit::CheckCode::Unknown
+    fail_with(Failure::Unknown, "#{e.class}: #{e.message}")
   end
 
   def pillage(entries)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Fix auxiliary/gather/vmware_vcenter_vmdir_ldap
3 participants