MCPcopy Create free account
hub / github.com/XiaoliChan/LDAPShell / ldap_connect

Method ldap_connect

ldapsearch-test.py:33–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31 self.lmhash, self.nthash = options.hashes.split(':')
32
33 def ldap_connect(self):
34 if self.ldaps_flag is True:
35 print("[+] Connecting ldap server over ssl (ldaps)")
36 ldapConnection = ldap.LDAPConnection('ldaps://%s' % self.domain , self.baseDN, self.address)
37 elif self.gc_flag is True:
38 print("[+] Connecting ldap server over global catalog (GC)")
39 ldapConnection = ldap.LDAPConnection('gc://%s' % self.domain, self.baseDN, self.address)
40 else:
41 print("[+] Connecting ldap server without any special")
42 ldapConnection = ldap.LDAPConnection('ldap://%s' % self.domain, self.baseDN, self.address)
43
44 ldapConnection.login(self.username, self.password, self.domain, self.lmhash, self.nthash)
45
46 return ldapConnection
47
48 def dummySearch(self, ldapConnection):
49 # Let's do a search just to be sure it's working

Callers 1

ldapsearch-test.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected