当前位置: 首页 > news >正文

DVWA DOM Based Cross Site Scripting (DOM型 XSS)

DVWA DOM Based Cross Site Scripting (DOM型 XSS)

文章目录

  • DVWA DOM Based Cross Site Scripting (DOM型 XSS)
    • XSS跨站原理
      • DOM型
    • Low
    • Medium
    • High
    • Impossible

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?>
//没有任何防御措施

image-20240425141612735

2、修改default,在URL拼接Payload

<script>alert(/XSS/)</script>

image-20240425141658717

Medium

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: ?default=English");exit;}
}?>

增加对"<script"字符的过滤,查看前端代码

image-20240425143147799

2、构造闭合"option"和"select"标签,执行弹出"/xss/"的语句

</optin></select><img src = 1 onerror = alert(/xss/)>

image-20240616160139823

image-20240616161058852

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: ?default=English");exit;}
}?>

2、在注入的 payload 中加入注释符 “#”,注释后边的内容不会发送到服务端,但是会被前端代码所执行。

(空格)#<script>alert(/xss/)</script>

image-20240616161314789

image-20240616161408461

Impossible

<?php# Don't need to do anything, protction handled on the client side?>
# 大多数情况下浏览器都会对 URL 中的内容进行编码,这会阻止任何注入的 JavaScript 被执行。
http://www.lryc.cn/news/420071.html

相关文章:

  • LinkedList集合及迭代器的源码分析
  • Go调度器
  • 当node节点kubectl 命令无法连接到 Kubernetes API 服务器
  • 直接通过类CURL方式,与GRPC方法交互的命令行工具
  • Hive3:数据的加载与导出
  • React事件绑定的方式有哪些?区别?
  • ibis:极具潜力的Python数据分析新框架
  • SQL Zoo 8+.NSS Tutorial
  • conda pack迁移环境
  • UML建模案例分析-活动图商业建模
  • C++标准模板(STL)- 低层内存管理 - 解分配函数 (operator delete, operator delete[])
  • LeetCode 热题 HOT 100 (025/100)【宇宙最简单版】
  • 【mysql 第三篇章】一条 update语句是怎么持久化到磁盘上的?
  • 深入探索大模型:从基础到实践,开启AI之旅
  • 题解:力扣1567 - 返回乘积为正数的最长子数组
  • 009 | 上证50ETF基金数据分析及预测
  • Wakanda: 1靶场复现【附代码】(权限提升)
  • 内核函数调试
  • Spring IOC使用DButil实现对数据库的操作
  • Android14音频进阶调试之命令播放mp3/aac非裸流音频(八十)
  • vue中怎么自定义组件
  • BM1反转链表[栈+头插法]
  • VisionPro二次开发学习笔记10-使用 PMAlign和Fixture固定Blob工具检测孔
  • 学单片机怎么在3-5个月内找到工作?
  • 探索设计模式:观察者模式
  • gradio之持续输入,持续输出(流式)
  • Git 常用命令指南:从入门到精通
  • Camera驱动 汇总表【小驰行动派】
  • SSRS rdlc报表 九 在.net core中使用RDLC报表
  • 力扣(2024.08.10)