hunt-ldap

Detect and exploit LDAP and XPath injection vulnerabilities in authentication and directory search endpoints.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/inventashif/helpful-code-sidekick --skill hunt-ldap-inventashif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hunt-ldap
Source: https://github.com/inventashif/helpful-code-sidekick/tree/main/scripts/hackerai/skills/bughunter/hunt-ldap
Command: npx skills add https://github.com/inventashif/helpful-code-sidekick --skill hunt-ldap-inventashif

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Security testers need a rigorous methodology to find LDAP and XPath injection flaws in login forms, SSO portals, and directory search APIs, while avoiding false positives from syntax errors, WAF blocks, and response-length jitter. ## Core Features & Use Cases - Injection Detection & Auth Bypass: Confirm an LDAP backend with baseline responses, then test RFC 4515 special characters and balanced parenthesis payloads to bypass authentication filters. - Blind Attribute Exfiltration: Extract attribute values character-by-character using paired true/false oracle controls instead of unreliable raw byte-count diffing. - AD vs Generic LDAP Discipline: Distinguish Active Directory (write-only unicodePwd, enumeration-focused) from OpenLDAP/389-DS (readable userPassword hashes) so claims stay technically accurate. - Use Case: While testing a corporate SSO login backed by AD, you send an unbalanced parenthesis, observe a filter-syntax error, then use an always-true OR filter payload to bypass authentication and validate with a false-control payload before reporting. ## Quick Start Test the login endpoint at the target URL for LDAP injection by first capturing a baseline response and then probing with an unbalanced parenthesis payload.

Frequently Asked Questions about hunt-ldap

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

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

Capture a baseline response with valid-format credentials first, then send a single unbalanced parenthesis in the username. A filter-syntax error or 500 on the unbalanced input but not on balanced input indicates the input reaches an LDAP filter unescaped.

How to bypass LDAP authentication with injection payloads?

Close the current filter group and append an always-true OR condition, such as *)(uid=*))(|(uid=*, keeping total parentheses balanced. Validate the bypass returns a real authenticated session and that a logically false control payload still fails.

Can LDAP injection extract Active Directory password hashes?

No. Active Directory stores passwords in unicodePwd, which is write-only and never returned by searches. Hash exfiltration via userPassword only works on non-AD directories like OpenLDAP or 389-DS where ACLs expose that attribute.

Why does blind LDAP exfiltration give false positives?

Raw response-size diffing is distorted by WAF banners, CSRF tokens, and length jitter from the injected character itself. Use paired true/false control filters, repeat each positive character three times, and re-verify the false control between rounds.

What is the difference between search-filter injection and DN injection?

Search-filter injection places input inside an (attr=value) filter where * ( ) & | ! are significant. DN injection places input inside a Distinguished Name where , = + " and / matter and * is not a wildcard, so payloads do not transfer between the two.

How does XPath injection differ from SQL injection?

XPath has no comment syntax, so payloads like ' or '1'='1 must keep quotes and brackets balanced rather than truncating the query. It targets XML-backed authentication stores using predicates like //users/user[name/text()='x'].