Skip to content

Commit

Permalink
fixed bug #172
Browse files Browse the repository at this point in the history
  • Loading branch information
ly4k committed Sep 26, 2023
1 parent 8d6ff21 commit 2780d53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions certipy/lib/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ def connect(self, version: ssl._SSLMethod = None) -> None:
ldap_pass = "%s:%s" % (self.target.lmhash, self.target.nthash)
else:
ldap_pass = self.target.password
channel_binding = None
channel_binding = {}
if self.target.ldap_channel_binding:
if not hasattr(ldap3, 'TLS_CHANNEL_BINDING'):
raise Exception("To use LDAP channel binding, install the patched ldap3 module: pip3 install git+https://github.com/ly4k/ldap3")
channel_binding = ldap3.TLS_CHANNEL_BINDING if self.target.ldap_channel_binding else None
channel_binding["channel_binding"] = ldap3.TLS_CHANNEL_BINDING if self.target.ldap_channel_binding else None
ldap_conn = ldap3.Connection(
ldap_server,
user=user,
password=ldap_pass,
authentication=ldap3.NTLM,
auto_referrals=False,
receive_timeout=self.target.timeout * 10,
channel_binding=channel_binding,
**channel_binding
)

if not ldap_conn.bound:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="certipy-ad",
version="4.8.1",
version="4.8.2",
license="MIT",
author="ly4k",
url="https://github.com/ly4k/Certipy",
Expand Down

0 comments on commit 2780d53

Please sign in to comment.