钢铁网站建设,网络推广是什么职位,阿里云商业网站建设视频,永久云虚拟主机DVWA DOM Based Cross Site Scripting (DOM型 XSS) 文章目录 DVWA DOM Based Cross Site Scripting (DOM型 XSS)XSS跨站原理DOM型 LowMediumHighImpossible XSS跨站原理 当应用程序发送给浏览器的页面中包含用户提交的数据#xff0c;但没有经过适当验证或转义时#xff0c;就…DVWA DOM Based Cross Site Scripting (DOM型 XSS) 文章目录 DVWA DOM Based Cross Site Scripting (DOM型 XSS)XSS跨站原理DOM型 LowMediumHighImpossible XSS跨站原理 当应用程序发送给浏览器的页面中包含用户提交的数据但没有经过适当验证或转义时就会导致跨站脚本漏洞。这个“跨”实际上属于浏览器的特性而不是缺陷; 浏览器同源策略只有发布Cookie的网站才能读取Cookie。 会造成Cookie窃取、劫持用户Web行为、结合CSRF进行针对性攻击等危害 DOM型 基于文档对象模型(Document Object Model)的一种漏洞 DOM型与反射型类似都需要攻击者诱使用户点击专门设计的URL Dom型 xss 是通过 url 传入参数去控制触发的 Dom型返回页面源码中看不到输入的payload 而是保存在浏览器的DOM中。 Low
1、分析网页源代码
?php# No protections, anything goes?
//没有任何防御措施2、修改default在URL拼接Payload
scriptalert(/XSS/)/scriptMedium
1、分析网页源代码
?php// Is there any input?
if ( array_key_exists( default, $_GET ) !is_null ($_GET[ default ]) ) {$default $_GET[default];# Do not allow script tagsif (stripos ($default, script) ! false) {header (location: ?defaultEnglish);exit;}
}?增加对script字符的过滤查看前端代码 2、构造闭合option和select标签执行弹出/xss/的语句
/optin/selectimg src 1 onerror alert(/xss/)High
1、分析网页源代码
?php// Is there any input?
if ( array_key_exists( default, $_GET ) !is_null ($_GET[ default ]) ) {# White list the allowable languagesswitch ($_GET[default]) {case French:case English:case German:case Spanish:# okbreak;default:header (location: ?defaultEnglish);exit;}
}?2、在注入的 payload 中加入注释符 “#”注释后边的内容不会发送到服务端但是会被前端代码所执行。
(空格)#scriptalert(/xss/)/scriptImpossible
?php# Dont need to do anything, protction handled on the client side?
# 大多数情况下浏览器都会对 URL 中的内容进行编码这会阻止任何注入的 JavaScript 被执行。