What is an LDAP search filter?
LDAP directories are searched with filters such as (&(objectClass=person)(mail=*@example.com)). RFC 4515 defines the syntax: & | ! for logic, =, ~=, >= and <= comparisons, * wildcards, and extensible matches with matching rules.
Special characters in values must be escaped as \2a, \28, \29 and \5c. Building filters from unescaped user input lets an attacker change the query (LDAP injection), which this tool helps catch.
How to use this tool
- Paste a filter to validate it and see it indented.
- Edit the JSON entry to check whether the filter would match it.
- Type a user-supplied value to see it escaped and whether it would have injected.
Frequently asked questions
Does this query a directory?
No. Everything runs in your browser; no LDAP server is contacted.
How is matching done?
Case-insensitively, like caseIgnoreMatch, with numeric ordering for numbers. caseExactMatch and the bitwise AND / OR rules used for flag attributes are supported; unknown rules evaluate to Undefined.
Which characters must be escaped?
*, (, ), \ and NUL, as \2a, \28, \29, \5c and \00 (RFC 4515 §3).