前言
Xpath注入
当前目录创建xpath.php、xpath_user.xml
![image-20210820160428212]()
然后php中写入
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <form method="POST"> 用户名:<input type="text" name="username"><br/> 密码:<input type="password" name="password"><br/> <input type="submit" value="Login" name="submit"> </form> </body> </html> <?php
if(file_exists('xpath_user.xml')){ $xml=simplexml_load_file('xpath_user.xml');
if($_POST['submit']){ $username = $_POST['username']; $password = $_POST['password']; $sql="user[@username='{$username}' and @password='{$password}']"; $result = $xml->xpath($sql); if(count($result)!=0){ echo 'Success'; }else{ echo 'failed'; }
} }
?>
|
下面一个xml文件中写入
1 2 3 4 5 6
|
<?xml version="1.0" encoding="UTF-8"?> <users> <user id="1" username="admin" password="admin"></user> <user id="2" username="root" password="admin"></user> <user id="3" username="system" password="admin"></user> </users>
|
这样就搭建一个xpath形式的登陆框,一样可以使用万能密码登陆
![image-20210820160619564]()
我的个博客
FROM:gylq.gitee Author:孤桜懶契
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
点赞
https://cn-sec.com/archives/729952.html
复制链接
复制链接
-
左青龙
- 微信扫一扫
-
-
右白虎
- 微信扫一扫
-
评论