hunt-ldap
What it does
This skill checks whether login and search features that use LDAP or XML directories can be manipulated by crafted input. It is for authorized testing of directory-based sign-in systems.
When to use it
- βWhen a login form uses LDAP or Active Directory for sign-in.
- βWhen a search feature queries a directory and might not escape special characters.
- βWhen an app uses an XML data store for authentication.
Skill link
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-ldap/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βOur login uses LDAP. Can you check whether special characters can bypass it in our authorized test?β
5 new skills a week. 1 minute to read.
How it works
The agent sends special characters and structured inputs, then compares responses to see whether the search logic changed. It reports confirmed bypasses or data leaks.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
HUNT-LDAP β LDAP Injection & XPath Injection
Grounding note: LDAP injection is rarely disclosed with verbatim payloads on public platforms (most live on internal-pentest reports). This skill is grounded in the OWASP LDAP Injection Prevention / Testing Guide (WSTG-INPV-06), PortSwigger Web Security Academy (LDAP injection), and the RFC 4515 filter grammar β all publicly verifiable references rather than invented HackerOne IDs. Do not cite a report you cannot link.
Crown Jewel Targets
LDAP injection that bypasses authentication = Critical. Blind attribute exfiltration of credentials/secrets = High. AD enumeration alone = Medium-High.
Highest-value chains:
- LDAP auth bypass β close the
uidfilter and append an always-true OR so the bind/search returns the admin entry without a valid password. - Blind attribute exfil β char-by-char extraction of an attribute value via a boolean oracle (login success/failure, result count, or response length).
- userPassword hash exfil (non-AD only) β on OpenLDAP/389-DS the
userPasswordattribute can hold{SSHA}/{CRYPT}hashes that ARE readable by query. See the AD-vs-generic warning below. - XPath injection auth bypass β
' or '1'='1against XML-backed auth.
CRITICAL β Active Directory vs generic LDAP
Do not conflate the two. They behave very differently:
| Generic LDAP (OpenLDAP, 389-DS, ApacheDS) | Active Directory | |
|---|---|---|
| Password attribute | userPassword β may hold {SSHA}/{MD5}/{CRYPT} and is readable if ACL allows |
unicodePwd β write-only, never returned by any search |
| Hash exfil via injection | Possible where ACLs leak userPassword |
Not possible β there is no readable hash attribute over LDAP |
| Useful enum attrs | uid, cn, mail, userPassword |
sAMAccountName, userPrincipalName, mail, memberOf, description (often holds plaintext secrets!) |
Do not tell a reader that blind LDAP injection yields AD password hashes β it
does not. unicodePwd is write-only. Against AD, the win is enumeration
(sAMAccountName, memberOf, description/info fields that admins misuse to
store passwords) and auth bypass β not hash dumping. The hash-exfil technique
applies only to non-AD directories exposing userPassword.
Attack Surface Signals
Corporate SSO / intranet login pages (often legacy Java/Spring/PHP)
Windows + IIS + "integrated" directory auth
/api/ldap/* /api/directory/* /people /address-book /search?dir=
"Find a colleague" / org-chart / employee-search features
XML-backed config or auth β XPath injection candidate
Error strings that confirm an LDAP backend:
javax.naming.NameNotFoundException
javax.naming.directory.InvalidSearchFilterException
LDAP: error code 49 - 80090308 (AD invalid creds / bind failure)
com.sun.jndi.ldap.* / System.DirectoryServices / ldap_search():
"Bad search filter" / net.ldap (Go) / python-ldap SERVER_DOWN
LDAP filter grammar (RFC 4515) β why injection works
A login filter is typically built by string-concat:
(&(uid=<USERNAME>)(userPassword=<PASSWORD>))
& = AND, | = OR, ! = NOT. Filters are prefix/Polish notation β the
operator comes first and every sub-filter is parenthesised. To inject you must
(a) escape the current (uid=...) group, (b) inject your own logic, and
(c) leave the overall parenthesis count balanced or the server throws a
filter-syntax error instead of executing.
The special-character set β TEST EACH ONE
These characters are syntactically meaningful and MUST be escaped by a safe app (RFC 4515 Β§3). If the app reflects an error or behaves differently when you send them raw, the input is unescaped β injectable:
| Char | Filter escape | Why it matters |
|---|---|---|
* |
\2a |
wildcard β matches any value |
( |
\28 |
opens a filter group |
) |
\29 |
closes a filter group |
\ |
\5c |
escape char itself |
| NUL | \00 |
string terminator β truncates filter in C-backed servers |
/ |
(DN context) | RDN separator β relevant for DN injection |
Search-filter context vs DN injection are different bugs:
- Search-filter injection (most common): your input lands inside a
(attr=VALUE)filter. Payloads use* ( ) & | !. - DN injection: your input is concatenated into a Distinguished Name
(
uid=VALUE,ou=people,dc=corp). Here,=+`
FAQ
Which characters matter?
The skill lists LDAP special characters such as asterisks, parentheses and backslashes.
Does it work on Active Directory?
Yes, but the skill warns that Active Directory and generic LDAP behave differently and must be tested separately.
Is LDAP injection common in public reports?
The skill says it is rarely disclosed publicly, so it relies on standard testing guides.
Details
Original description by the author
Hunt LDAP Injection and XPath Injection β authentication bypass, blind char-by-char attribute exfiltration, AD user/group enumeration, XML-store XPath bypass. Covers the LDAP special-character set (* ( ) \\ NUL /), search-filter-context vs DN-injection, parenthesis-balancing, AND/OR filter logic, and {SSHA}/{CRYPT} userPassword exfil on non-AD directories. Use when target uses LDAP/AD authentication, corporate SSO with a directory backend, an address-book/people-search API, or XML-based data stores queried with XPath.
Popularity
- GitHub stars
- 5.4k
- Ranking position
- #14918
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
apk-redteam-pipeline
5.4kHelps your agent test an Android app for security weaknesses, from finding the APK file and decompiling it to checking for exposed secrets.
bugcrowd-reporting
5.4kHelps your agent write better Bugcrowd vulnerability reports, choosing the right category and answering out-of-scope objections.
cloud-iam-deep
5.4kHelps your agent check what a found cloud credential can access on AWS, Azure or Google Cloud, during an authorized security test.
enterprise-vpn-attack
5.4kHelps your agent check VPN and remote-access appliances from Cisco, Fortinet, Citrix and others for known weaknesses during an authorized test.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.