hunt-ldap
यह क्या करती है
यह स्किल जाँचती है कि LDAP या XML डायरेक्टरी इस्तेमाल करने वाले लॉगिन और सर्च फ़ीचर गढ़े हुए इनपुट से हेरफेर किए जा सकते हैं या नहीं। यह डायरेक्टरी-आधारित साइन-इन सिस्टम के अधिकृत परीक्षण के लिए है।
कब इस्तेमाल करें
- ✓जब लॉगिन फ़ॉर्म साइन-इन के लिए LDAP या Active Directory इस्तेमाल करता है।
- ✓जब सर्च फ़ीचर डायरेक्टरी से पूछता है और विशेष वर्णों को escape नहीं करता।
- ✓जब कोई ऐप प्रमाणीकरण के लिए XML डेटा स्टोर इस्तेमाल करता है।
Skill का लिंक
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-ldap/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारा लॉगिन LDAP इस्तेमाल करता है। क्या आप हमारे अधिकृत परीक्षण में जाँच सकते हैं कि विशेष वर्ण उसे बायपास कर सकते हैं या नहीं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट विशेष वर्ण और संरचित इनपुट भेजता है, फिर जवाबों की तुलना करता है कि सर्च का तर्क बदला या नहीं। वह पक्की बायपास या डेटा लीक की रिपोर्ट देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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,=+`
अक्सर पूछे जाने वाले सवाल
कौन-से वर्ण मायने रखते हैं?
स्किल LDAP के विशेष वर्ण जैसे तारांकन, कोष्ठक और बैकस्लैश सूचीबद्ध करती है।
क्या यह Active Directory पर काम करता है?
हाँ, लेकिन स्किल चेताती है कि Active Directory और सामान्य LDAP अलग व्यवहार करते हैं, इसलिए उन्हें अलग से परखना होगा।
क्या सार्वजनिक रिपोर्ट में LDAP इंजेक्शन आम है?
स्किल कहती है कि यह सार्वजनिक रूप से कम बताया जाता है, इसलिए वह मानक परीक्षण गाइड पर निर्भर है।
जानकारी
लेखक का मूल विवरण
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.
लोकप्रियता
- GitHub स्टार
- 5.4k
- रैंकिंग में स्थान
- #14918
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
apk-redteam-pipeline
5.4kयह आपके एजेंट को Android ऐप में सुरक्षा कमज़ोरियाँ परखने देती है: APK फ़ाइल ढूँढने और उसे decompile करने से लेकर उजागर secrets जाँचने तक।
bugcrowd-reporting
5.4kयह आपके एजेंट को Bugcrowd पर बेहतर कमज़ोरी रिपोर्ट लिखने देती है, सही श्रेणी चुनते हुए और दायरे से बाहर वाली आपत्तियों का जवाब देते हुए।
cloud-iam-deep
5.4kयह आपके एजेंट को अधिकृत सुरक्षा परीक्षण में जाँचने देती है कि मिली क्लाउड credential AWS, Azure या Google Cloud पर क्या-क्या एक्सेस कर सकती है।
enterprise-vpn-attack
5.4kयह आपके एजेंट को अधिकृत परीक्षण में Cisco, Fortinet, Citrix और अन्य VPN उपकरणों की ज्ञात कमज़ोरियाँ जाँचने देती है।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।