dvwa详解_DVWA(六):XSSReflected 反射型XSS全等级详解

XSS 概念:

由于web应用程序对用户的输入过滤不严,通过html注入篡改网页,插入恶意脚本,从而在用户浏览网页时,控制用户浏览器的一种攻击。

XSS类型:

Reflected(反射型):只是简单的把用户输入的数据反射给浏览器,需要诱导用户点击一个恶意链接才能攻击成功。

存储型:将用户输入的数据存储在服务器端,每次用户访问都会被执行js脚本

DOM型:文本对象模式xss,通过修改页面的DOM节点形成的XSS,可存储型,可反射型,取决于输出地点

(关于DOM节点,DOM为Document Obeject Mode首字母缩写,翻译为文档对象模型,在网页中所有对象和内容都被称为节点,如文档、元素、文本、属性、注释等,节点是DOM最基本的单元

并派生出不同类型的节点,他们共同构成了文档的树形结构模式)

XSS应用场景:1.利用xss获得cookie,2.重定向,3.钓鱼网站,4.DDOS

记录一些一般的payload:(这里看不懂可以先看下面的示例,看完返回来看这里就会明白一些了)

1.

2.

3.click1    #点击click1时弹出cookie值

4.  #src地址错误,然后执行onerror的内容

Low级别:

观察源码:

header ("X-XSS-Protection: 0");

// Is there any input?

if( array_key_exists( "name", $_GET ) && $_GET[ 'name' ] != NULL ) {

// Feedback for end user

echo '

Hello ' . $_GET[ 'name' ] . '
';

}

?>

源码没有对参数做任何防御处理措施

下面给一些基本的XSS攻击

1.

2.

3.click1    #点击click1时弹出xss3

4.  #src地址错误,然后执行onerror的内容

例如我们这里输入:

构造获取cookie的payload:

然后Logout 用这段cookie值进行登录即可以被攻击者的身份访问此网站(在未关闭浏览器前)

Medium

观察源码:

if( array_key_exists( "name", $_GET ) && $_GET[ 'name' ] != NULL) {//Get input

$name = str_replace( '

echo "

Hello ${name}
";

}

对于script标签进行了过滤,下面提供几个绕过的方法

1.大小写分开

2.ipt> 类似于SQL注入中的双写

3.用别的标签替换 :

同样也可以获得cookie 之后就可以通过cookie以被攻击者的身份访问此网站

High

观察源码:

if( array_key_exists( "name", $_GET ) && $_GET[ 'name' ] != NULL) {//Get input

$name = preg_replace( '/

echo "

Hello ${name}
";

}?>

分析源码,可以看到,使用了preg_replace正则表达式函数,对参数进行过滤,查看源码可以看到对

执行:

1835657-20200314221411715-807882491.png

Impossible

观察源码:

使用了htmlspecailchars函数做了html实体转义,无法利用XSS

1835657-20200314221629501-2120056006.png

1835657-20200314221755223-393907167.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/442028.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

直线的端点画垂线的lisp_【以课说法】线段、射线、直线

课例概况课例点晴你的课堂是碎片化的知识教学,还是结构化的问题探究?如何把碎片化的知识教学变成结构化的问题探究?实施路径就是问题串,用问题串统整知识点;围绕问题串,从问题引发、问题探究,直…

*【CF#633B】 A Trivial Problem(二分或枚举)

题干: Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such that the factorial of n ends with exactly m zeroes. Are you among those grea…

wordpress拒绝访问_Nginx + Wordpress页面或帖子URL返回拒绝访问

谢谢你的答案 r3wt。但是,我猜上面的配置文件是不合适的我不想保持原样(但是对于我来说开发似乎没问题,因为部署我宁愿为每个站点使用单独的配置文件)。所以,别名部分和我的问题应该正确定义try_files因为我想要捕获链接以localhost / szpetr…

【HDU - 2104】hide handkerchief (素数)

题干: The Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends. Now I introduce the game to you. Suppose there are N peo…

python高级编程装饰器_Python装饰器

def my_decorator(function):def _my_decorator(*args, **kw):#在调用实际函数之前做些填充工作res function(*args, **kw)#做完某些填充工作之后return res#返回子函数return _my_decorator当装饰器需要参数时,必须使用第二级封装。def my_decorator(arg1, arg2):…

【HihoCoder - 1269】 优化延迟 (优先队列+二分优化)

题干&#xff1a; 小Ho编写了一个处理数据包的程序。程序的输入是一个包含N个数据包的序列。每个数据包根据其重要程度不同&#xff0c;具有不同的"延迟惩罚值"。序列中的第i个数据包的"延迟惩罚值"是Pi。如果N个数据包按照<Pi1, Pi2, ... PiN>的顺…

带有风的诗词_带有风的诗句

带有风的诗句1、古道西风瘦马&#xff0c;夕阳西下&#xff0c;断肠人在天涯。——马致远《天净沙秋思》2、欲乘风归去&#xff0c;又恐琼楼玉宇。——苏轼《水调歌头明月几时有》3、道通天地有形外&#xff0c;思入风云变态中。——程颢《秋日》4、津亭杨柳碧毵毵&#xff0c;…

【ZOJ - 3210】A Stack or A Queue? (模拟)

题干&#xff1a; Do you know stack and queue? Theyre both important data structures. A stack is a "first in last out" (FILO) data structure and a queue is a "first in first out" (FIFO) one. Here comes the problem: given the order of …

ehchache验证缓存过期的api_Ehcache缓存配置

Cache的配置很灵活&#xff0c;官方提供的Cache配置方式有好几种。你可以通过声明配置、在xml中配置、在程序里配置或者调用构造方法时传入不同的参数。你可以将Cache的配置从代码中剥离出来&#xff0c;也可以在使用运行时配置&#xff0c;所谓的运行时配置无非也就是在代码中…

*【POJ - 3061】 Subsequence (尺取或二分)

题干&#xff1a; A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive eleme…

alert 回调_JavaScript中到底什么时候回调函数Callback

什么是回调函数Callback简单的理解&#xff1a;回调函数是在另一个函数执行完毕后执行的函数 - 因此名称为call back。复杂的理解&#xff1a;在JavaScript中&#xff0c;函数是对象。因此&#xff0c;函数可以将函数作为参数&#xff0c;并且可以由其他函数返回。执行此操作的…

【CF#148B】Escape(模拟)

题干&#xff1a; The princess is going to escape the dragons cave, and she needs to plan it carefully. The princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the escape after t hours and will chase the…

mysql sql语句分页查询_如何用sql语句 实现分页查询?

我制作了一个数据库其中一张表createtablenews(news_idintprimarykeyidentity(1,1),news_titlevarchar(50)notnull,news_authorvarchar(20),news_summaryvarchar(50),news_contenttext...我制作了一个数据库其中一张表create table news(news_id int primary key identity(1,1)…

*【HDU - 1042 】 N! (大数乘法)

题干&#xff1a; Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For each N, output N! in one line. Sample Input 1 2 3 Sample Output 1 2 6 解题报告&#xff1a; 大数运…

【bzoj 1754】【POJ - 2389 】Bull Math (高精度运算)

题干&#xff1a; Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... or so they say. Farmer John wonders if their answers are correct. Help him check the bulls answers. Read in two…

mysql居左查询abcd_数据库--查询语句

查询语句mysql中要学习的知识&#xff1a;多表关系&#xff0c;查询语句&#xff0c;索引添加数据补充将一个查询结果插入到另一张表中create table student(name char(10), gender int);insert into student values(nalituo, 1);insert into student values(sasigi, 0);create…

druid mysql配置详解_druid 参数配置详解

spring.datasource.typecom.alibaba.druid.pool.DruidDataSource#驱动配置信息spring.datasource.driver-class-namecom.mysql.jdbc.Driver#基本连接信息spring.datasource.username rootspring.datasource.password rootspring.datasource.urljdbc:mysql://192.168.153.23:3…

【POJ - 2376】Cleaning Shifts (贪心)

题干&#xff1a; Farmer John is assigning some of his N (1 < N < 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T shifts (1 < T < 1,000,000), …

mysql sql 片段_MySQL代码片段

1.[代码][SQL]代码--导出为xml文件mysql -X -uroot -proot -e "use testa;select * from test_tb;" > /opt/test.xml--导出为csv文件--fields terminated 分割记录中每个字段的字符--optionally enclosed 包围每个字段的字符--lines terminated 每行结束的字符--P…

【HDU - 4990】 Reading comprehension (构造+矩阵快速幂)

题干&#xff1a; Read the program below carefully then answer the question. #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include<iostream> #include <cstring> #include <cmath> #include &…