Skip to main content

Overview

The Impacket LDAP module provides a minimalistic implementation of RFC 4511 with Active Directory-specific functionality (MS-ADTS). It enables LDAP operations against domain controllers for querying and manipulating directory data.

Key Components

LDAPConnection

The main class for establishing and managing LDAP connections with support for:
  • LDAP and LDAPS protocols
  • NTLM and Kerberos authentication
  • LDAP signing and sealing
  • Paged search results
  • Channel binding for LDAPS

ldaptypes Module

Structures for working with LDAP-specific data types including:
  • Security descriptors (SR_SECURITY_DESCRIPTOR)
  • Access Control Lists (ACL)
  • Access Control Entries (ACE)
  • Security Identifiers (LDAP_SID)

Connection URLs

Supported URL formats:
  • ldap://hostname - Standard LDAP (port 389)
  • ldaps://hostname - LDAP over SSL (port 636)
  • gc://hostname - Global Catalog (port 3268)

Authentication Methods

NTLM Authentication

Kerberos Authentication

Common Operations

Add Entry

Modify Entry

Delete Entry

Paged Searches

For large result sets, use paged searches:

Security Considerations

  • Always use LDAPS when possible for encrypted communication
  • Enable signing for LDAP connections to prevent tampering
  • Channel binding is automatically applied for LDAPS connections
  • Kerberos authentication supports mutual authentication

Error Handling

References

  • RFC 4511 - LDAP Protocol
  • MS-ADTS - Active Directory Technical Specification