ldap-injection-testing
LDAP注入深度测试与域渗透联动高级技能:RFC 4515过滤器语义深度、AND/OR注入、通配符滥用横向接管、认证绕过、RDN/过滤器混淆、盲注高效提取(二分/位运算OID/OAST外带)、非标准属性与AD专属属性利用、LDAPS/StartTLS/通道绑定与NTLM Relay、Spring Data…
Skill by langbyyi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/langbyyi-ldap-injection-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, data, security, marketing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ldap-injection-testing
What's inside
- Skill name
ldap-injection-testing- Description
- LDAP注入深度测试与域渗透联动高级技能:RFC 4515过滤器语义深度、AND/OR注入、通配符滥用横向接管、认证绕过、RDN/过滤器混淆、盲注高效提取(二分/位运算OID/OAST外带)、非标准属性与AD专属属性利用、LDAPS/StartTLS/通道绑定与NTLM Relay、Spring Data LDAP/ldap3/ldapjs等框架注入差异、WAF绕过、LDAP注入→域枚举→Kerberoasting/noPac/gMSA→提权完整攻击链、2025-2026新CVE实战(CVE-2026-46619/CVE-2026-40459/CVE-2026-58222/CVE-2026-42568)、AI大模型辅助生成Payload与审计LDAP拼接代码
- License
- Apache-2.0
- Metadata
- version: 3.0.0
- Instructions
- 925 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 925 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# LDAP注入深度测试与域渗透联动技能
> **AI LOAD INSTRUCTION**: LDAP 注入深度测试(v3.0 深攻防版)。覆盖 RFC 4515 过滤器语义、认证绕过、通配符滥用横向接管、OID 位运算盲注高效提取、NTLM Relay 与通道绑定绕过、注入→域枚举→Kerberoasting/noPAC/gMSA 联动链及 2025-2026 新 CVE。基础 `*)(&` 通配绕过按已知前提,直击高阶对抗与域渗透联动。
## 概述
LDAP(轻量级目录访问协议)注入与SQL注入同源(CWE-90:对LDAP查询中特殊元素中和不当),攻击者通过注入LDAP过滤器元字符(`*`、`(`、`)`、`\`、`&`、`|`、`!`)改写查询逻辑,实现**认证绕过、信息泄露、数据盲注提取、权限提升**。由于LDAP目录几乎都是企业的身份基座(Active Directory/OpenLDAP/FreeIPA),一次成功的LDAP注入通常意味着企业身份仓库失守,可沿"注入→信息泄露→域枚举→凭据获取→横向移动→域管"链路直接打通域渗透。
本技能v3.0.0在v2.0基础上深化到**攻防专家实战维度**:不仅覆盖经典AND/OR注入与认证绕过,更深入**RFC 4515过滤器语义与类型混淆、通配符滥用(Wildcard Abuse)横向接管、OID位掩码/位运算盲注提取、OAST外带、非标准属性利用、LDAPS/StartTLS/通道绑定攻击面、主流框架注入差异(Spring Data LDAP/ldap3/ldapjs)、LDAP注入与AD域渗透攻击链联动**,并引入**2025-2026年最新实战漏洞案例**(CVE-2026-46619 OpenAM MSISDN、CVE-2026-40459 PAC4J、CVE-2026-58222 Samba AD、CVE-2026-42568 Yamcs、CVE-2026-11770 389 DS、CVE-2025-61911 python-ldap)与**AI大模型结合**(AI辅助Payload变异、LLM审计拼接代码、Agent/SSO平台LDAP面)。
### 核心概念
- **LDAP过滤器(Filter)**:RFC 4515定义的布尔表达式字符串,用波兰前缀记法,是注入的目标语法
- **DN(Distinguished Name)/RDN(Relative DN)**:条目在目录树中的唯一路径,DN拼接注入与过滤器注入是两类独立攻击面
- **元字符**:`* ( ) \ NUL` 为过滤器转义核心(RFC 4515),`+ ; < > \ # " , =` 为DN转义核心(RFC 4514),两者转义规则不同,混用即漏洞
- **绑定(Bind)**:LDAP认证机制,与"搜索过滤器认证"是两种不同模式——过滤器认证才是注入重灾区
- **OID扩展匹配**:`attr:oid:=value` 语法,AD位掩码(`:1.2.840.113556.1.4.803:`)、递归组成员(`:1.2.840.113556.1.4.1941:`)都是注入可操纵的语义
- **LDAPS/StartTLS**:636端口的SSL/TLS封装与389端口的StartTLS升级,决定中间人/中继攻击面
- **通道绑定/签名**:AD的LDAP安全加固(ADV190023),缺失时NTLM Relay to LDAP可通杀
- **userPassword**:OCTET STRING类型,可用`octetStringOrderingMatch`(OID 2.5.13.18)按字节位运算盲注,这是v3.0新增的高效提取面
### 攻击链全景(v3.0核心方法论)
```
注入点发现 → 过滤器结构推断 → 认证绕过/信息枚举
↓
盲注数据提取(布尔/二分/位运算/OAST)
↓
AD环境联动:域枚举 → SPN/Kerberoasting → noPac(CVE-2021-42278/42287) → DCSync → 域管
↓
AI维度:LLM审计定位拼接点 / AI生成Payload变体加速循环
```
## 一、LDAP协议与过滤器语义深度
### 1.1 LDAP架构基础
```
目录树结构:dc=example,dc=com(根)→ ou=people(组织单元)→ cn=admin(条目)
条目(Entry)= 属性(Attribute)集合,属性由 OID 引用
DN 示例:CN=James Bond,OU=Users,DC=corp,DC=local
RDN 示例:CN=James Bond(DN中最左的组分)
作用域(Scope):base(仅基DN)/ one(直接子级)/ sub(全部子树)
```
### 1.2 RFC 4515 过滤器语法精讲
**过滤器是前缀(波兰)记法**,与SQL的中缀语法不同,注入时需要精确闭合括号:
```
(attr=value) 等于/存在(value为*时是存在性测试)
(&(a=1)(b=2)) AND(集合,至少1个元素)
(|(a=1)(b=2)) OR(集合,至少1个元素)
(!(a=1)) NOT(恰1个元素)
(attr>=value) 大于等于(按匹配规则排序)
(attr<=value) 小于等于
(attr~=value) 近似匹配(实现相关,AD支持有限)
(attr=*value*) 子串匹配(可混合:*a*b*)
(attr:oid:=value) OID扩展匹配(AD位掩码/递归成员的关键语法)
```
**RFC 4515 转义规则(关键——注入与防护都围绕它):**
过滤器值中必须对以下字符转义,转义形式为`\`+十六进制:
```
\ → \5c
* → \2a
( → \28
) → \29
NUL → \00
```
**未列入转义集**的`& | ! = < > ~`等在等号右侧(值上下文)无需转义——但若攻击者把输入放在属性名/结构位置(如括号外),它们就变成逻辑运算符。**这就是"转义了却仍然可注入"的经典根因**:开发者只转义了部分场景,或把过滤器转义函数用在了DN上(或反之)。
**匹配规则(大小写敏感性差异)——盲注设计必须知道:**
| 匹配规则 | 属性示例 | 大小写 |
|---------|---------|--------|
| caseIgnoreMatch | cn、sn、mail、sAMAccountName | 不敏感 |
| caseExactMatch | uid(OpenLDAP默认) | 敏感 |
| caseExactIA5Match | userPrincipalName、url | 敏感 |
| octetStringMatch | userPassword、objectSid | 按字节 |
### 1.3 过滤器类型混淆与解析差异
**(1)值/结构上下文混淆:** 同一输入进入不同拼接位置产生不同漏洞类型:
```
# 值上下文(等号右侧)→ 注入元字符闭合再扩展
filter = "(&(uid=" + user + ")(userPassword=" + pass + "))"
输入 user = *)(|(uid=* → 闭合 (uid= 后注入OR
# 属性名上下文 → 可注入OID扩展/替换属性
filter = "(" + attr + "=" + val + ")"
输入 attr = uid)(|(objectClass=* → 直接改写整个过滤器结构
# DN上下文 → 需按RFC 4514转义,逗号/加号是分隔符
base = "ou=" + input + ",dc=corp,dc=local"
输入 input = people,dc=evil,dc=com → 基DN逃逸
```
**(2)OID扩展匹配的类型混淆(AD特有,盲注利器):**
```
# 普通属性比较
(sAMAccountName=admin)
# 换成位掩码OID → 语义从"等于"变为"按位与":
(userAccountControl:1.2.840.113556.1.4.803:=2) # 值第2位为1(禁用账户)
(userAccountControl:1.2.840.113556.1.4.803:=65536) # 值第17位为1(DONT_EXPIRE_PASSWORD)
# 换成递归匹配OID → 深度组成员:
(memberOf:1.2.840.113556.1.4.1941:=CN=Domain Admins,CN=Users,DC=corp,DC=local)
# 换成排序OID → 按字节序比较(OID 2.5.13.18,见第五章5.3位运算提取)
(userPassword:2.5.13.18:=\64\00\01\02...)
```
**(3)实现差异:** 同一过滤器在不同服务器上解析结果不同(RFC实现偏差):
- AD对`(attr=*)`存在性测试、空值、超长过滤器的容错与OpenLDAP不同
- OpenLDAP有`sizeLimit/timeLimit`,AD有`MaxPageSize`(默认1000/2000),影响枚举上限
- 某些服务器对尾随未闭合括号的容错度不同(`(&(uid=admin)(|(password=x)`可被部分实现容忍)——**模糊测试时按"畸形→半闭合→完整闭合"梯度递进**
### 1.4 注入点识别与过滤器结构推断
**识别注入点的特征请求(Burp/ffuf):**
```
# 1. 提交包含LDAP元字符的输入,观察响应差异/错误
user=* → 若返回用户或不同错误 → 存在通配符注入
user=)(&(1=1)) → 若报错信息含filter语法 → 确认后端LDAPFrom langbyyi/CyberStrikeAI-SRC, Apache-2.0.
More from langbyyi/CyberStrikeAI-SRC
- 0.735score
burp-mcp-vuln-check
langbyyi
Automate low-impact web vulnerability verification through Burp MCP.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
crlf-injection
langbyyi
CRLF injection playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
business-logic-vulnerabilities
langbyyi
Business logic vulnerability playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
clickjacking
langbyyi
Clickjacking playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
cmdi-command-injection
langbyyi
Command injection playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
cors-cross-origin-misconfiguration
langbyyi
CORS misconfiguration testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
csrf-cross-site-request-forgery
langbyyi
CSRF testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
api-sec
langbyyi
Entry P1 category router for API security.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
authbypass-authentication-flaws
langbyyi
Authentication bypass testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
ssti-server-side-template-injection
langbyyi
SSTI playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
browser-assisted-hunting
langbyyi
浏览器交互式挖洞:登录态操作、双账号越权对比、SPA渲染取证、DOM XSS确认、验证码登录、前端隐藏功能绕过。 Use when CLI/HTTP evidence is insufficient and the target needs real browser interaction to confirm.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
dependency-confusion
langbyyi
Supply-chain testing via package-manager dependency confusion.
SkillAFreshness: A★ 131Claude Code +9
Signals
- Stars
- 131
- Forks
- 11
- Open issues
- 0
- Last commit (this folder)
- Sep 9, 2026 (1 month ago)
- Last release
- Oct 16, 2026 (13 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 3.0.0
- License
- Apache-2.0
- Repository
- github.com/langbyyi/CyberStrikeAI-SRC
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from langbyyi
- 0.735score
burp-mcp-vuln-check
langbyyi
Automate low-impact web vulnerability verification through Burp MCP.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
browser-assisted-hunting
langbyyi
浏览器交互式挖洞:登录态操作、双账号越权对比、SPA渲染取证、DOM XSS确认、验证码登录、前端隐藏功能绕过。 Use when CLI/HTTP evidence is insufficient and the target needs real browser interaction to confirm.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
api-sec
langbyyi
Entry P1 category router for API security.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
ssti-server-side-template-injection
langbyyi
SSTI playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
authbypass-authentication-flaws
langbyyi
Authentication bypass testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
business-logic-vulnerabilities
langbyyi
Business logic vulnerability playbook.
SkillAFreshness: A★ 131Claude Code +9
Cite this page
ldap-injection-testing skill. Agent Mart. https://agentmart.dev/skills/langbyyi-ldap-injection-testing (last updated 2026-10-24)