skillfed

msldap

Python library to play with MS LDAP

msldap v0.5.15 78.6K downloads/30d#14,433 on PyPI498
Permissive license AGING released

What it is and what it does

msldap is a library for programmatic interaction with Microsoft Active Directory through LDAP. It abstracts away the complexity of LDAP protocol details and AD-specific authentication schemes, letting you query users, groups, computers, and other directory objects with minimal boilerplate. The library supports a wide range of authentication methods—NTLM (password or hash), Kerberos (with multiple key types), SSPI (Windows-native), and anonymous/simple bind—all configured through a single connection URL string. It also includes a built-in interactive LDAP console for ad-hoc queries and supports SOCKS5 proxying for remote AD access.

The package depends on cryptographic and authentication libraries (unicrypto, asyauth, asysocks, asn1crypto) and UI helpers (prompt-toolkit, tqdm, tabulate) to handle the complexity of AD protocols and provide a polished command-line experience. It's designed as a library first, though it ships a command-line tool for interactive use. The codebase is stable but aging, with no formal test suite, so production use should be informed by your own validation.

Use it for:

  • Enumerate users, groups, and computers in an Active Directory domain for security auditing or inventory purposes.
  • Authenticate to AD-integrated services programmatically using NTLM or Kerberos without external dependencies.
  • Query AD for certificate templates, certificate authorities, or other security-relevant objects.
  • Perform AD reconnaissance through a SOCKS5 proxy when direct access to the domain controller is restricted.
  • Build custom AD management or reporting tools that need to read directory data without relying on Windows-only APIs.
  • Integrate AD queries into penetration testing or security research workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

msldap is a Python library for querying and interacting with Microsoft Active Directory via LDAP, supporting multiple authentication methods including NTLM, Kerberos, SSPI, and anonymous bind.

Yes, if you need to query or authenticate against Microsoft Active Directory from Python and want a lightweight, flexible library with support for multiple auth schemes. The permissive MIT license and low install friction make it accessible. However, be aware that maintenance is aging (last release 446 days old), there is no formal test suite, and LDAPS certificate verification is incomplete—so validate thoroughly before using in security-critical production systems. For one-off AD queries or integration into security tools, it's a solid choice.

Install

msldap on PyPI

pip

pip install msldap

uv

uv add msldap

poetry

poetry add msldap

Installing msldap

Before you install

Low install friction with a pure-Python wheel distribution. Maintenance is aging—last commit was 2026-02-11 and the latest release 446 days old—but the repository remains active and unarchived with modest community interest (498 stars).

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute the library freely in both open-source and commercial projects without restriction.

Quickstart

pip install msldap

from msldap import MSLDAPClient

# Create a client with a connection URL
client = MSLDAPClient('ldap+ntlm-password://DOMAIN\\user:password@10.0.0.1')
# Query AD for users, groups, or other objects

Requires Python 3.7 or later. For Kerberos authentication, the domain controller IP must be specified via the 'dc' parameter in the connection URL.

Verify before relying

  • Whether LDAPS certificate verification is actually implemented (description notes 'TODO: actually verify certificate').
  • Current test coverage and stability guarantees (description explicitly states 'No testing suite').
  • Whether all advertised authentication methods (especially Kerberos variants) are equally mature and production-ready.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 9 — unicrypto, asyauth, asysocks, asn1crypto, winacl, prompt-toolkit, tqdm, wcwidth, tabulate
Maintenance aging — 446 days since the last release
Last repo commit
First released
Downloads 78,553/month — #14,433 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: msldap-0.5.15-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

active directory ldap clientms ad query libraryldap authentication ntlm kerberoswindows domain controller queriesldap socks5 proxy supportasn1 ldap protocolinteractive ldap console
active-directoryldap-clientkerberos-ntlm

More Internet packages