Lab: DOM XSS in document.write sink using source location.search:document.write使用源的接收器中的DOM XSSlocation.search

该实验室在搜索查询跟踪功能中包含一个基于 DOM 的跨站点脚本漏洞。它使用 JavaScriptdocument.write函数将数据写入页面。document.write使用来自 的数据调用该函数location.search,您可以使用网站 URL 控制该数据。

要解决此实验,请执行调用该函数的跨站点脚本攻击alert。

解析

在搜索框中输入随机字母数字字符串。
右键单击并检查元素,并观察您的随机字符串已放置在img src属性中。
img通过搜索 打破属性:"><svg onload=alert(1)>或者 "><script>alert(1)</script>

image

posted @ 2021-08-25 15:00  Zeker62  阅读(125)  评论(0编辑  收藏  举报