【发布时间】:2013-11-20 01:48:28
【问题描述】:
这是我的 index.html(易受攻击):
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<script>
document.write("<form><select>");
document.write("<option value=1>" +
document.location.href.substring(document.location.href.indexOf("default=") + 8)
+ "</option>");
document.write("<option value=2> French </option>");
document.write("</select> </form>");
document.write(document.location.href);
</script>
<body>
</body>
</html>
它应该从../index.html?default=English 获取默认语言,这会将默认语言设置为英语。
我正在尝试使用../index.html?default=<script>alert(document.cookie)</script> 在屏幕上显示cookie,但浏览器似乎将> 编码为%3E。我也用过\x3Cscript>alert(document.cookie)\x3C/script>、\x3Cscript\3Ealert(document.cookie)\x3C/script\3E and &lt;script&gt;alert(document.cookie)&lt;/script&gt;,但没有运气。
【问题讨论】:
-
您是否尝试过通过控制台向该页面发送直接获取请求?
-
我已经重新格式化了你的代码和also made a plunkr out of it
标签: javascript html dom xss