exploiting-ldap-injection

Exploit LDAP injection flaws to bypass authentication and blind-extract directory attribute values.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill exploiting-ldap-injection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploiting-ldap-injection
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/web-application-security/exploiting-ldap-injection
Command: npx skills add https://github.com/xalgord/xalgorix --skill exploiting-ldap-injection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests.

What problem does it solve?

Web applications that build LDAP search filters from unsanitized user input let attackers manipulate filter logic to bypass logins, enumerate directory objects, and extract sensitive attributes like passwords. This Skill provides a structured methodology to identify, confirm, and exploit these injection points during authorized penetration tests.

Core Features & Use Cases

  • Authentication Bypass Payloads: A tested matrix of wildcard, negation, NULL-byte, and filter-injection payloads covering OpenLDAP, ADAM/Microsoft LDS, and SunOne server quirks.
  • Blind Attribute Extraction: Boolean-oracle techniques and a Python script for per-character brute-forcing of attributes such as userPassword, cn, mail, and uid.
  • Confirmation Methods: TRUE/FALSE oracle comparison and error-based detection to avoid false negatives before reporting.
  • Use Case: During an authorized test of an intranet portal login backed by Active Directory, submit user=*&password=* to confirm a wildcard bypass, then use the blind extraction script to recover the admin userPassword one character at a time and document the finding with CVSS scoring and remediation guidance.

Quick Start

Test the target login form for LDAP injection by submitting wildcard payloads like user=* and password=*, then confirm with TRUE/FALSE boolean oracle payloads and extract attributes character by character.

Frequently Asked Questions about exploiting-ldap-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a login form for LDAP injection?

Submit wildcard payloads like user=* and password=* to see if the filter matches any directory user. Then confirm with boolean oracles: a TRUE payload such as *)(objectClass=*))(&objectClass=void should return data while a FALSE variant returns none.

How to bypass LDAP authentication with filter injection?

Inject payloads that neutralize the password clause, such as user=admin)(!(&(| with any password, which makes the password subtree FALSE-negated and therefore TRUE. NULL-byte truncation with user=*))%00 also discards trailing filter clauses on vulnerable servers.

How do I extract passwords via blind LDAP injection?

Use per-character brute force with a wildcard anchor, injecting filters like *)(uid=admin)(userPassword=A* and iterating through the alphabet. A result/no-result oracle reveals each correct character, and the included Python script automates this over common attributes.

Does LDAP injection behave differently on OpenLDAP vs Active Directory?

Yes. OpenLDAP executes only the first filter when two arrive, ADAM/Microsoft LDS throws an error on two filters, and SunOne Directory Server 5.0 executes both. Payload selection must account for these server quirks.

Why does my LDAP injection payload return no results?

Filters must remain syntactically valid prefix notation, so malformed parentheses silently fail. Send one clean filter, verify with a TRUE/FALSE oracle pair, and check for error-based confirmation that input actually reaches the filter.

How do I prevent LDAP injection in web applications?

Escape LDAP special characters per RFC 4515 (\28 \29 \2a \5c \00) on all user input and use parameterized directory APIs instead of string concatenation. Apply least-privilege bind accounts and allow-lists for searchable attributes.