[复现]-2021强网杯 [强网先锋]赌徒
主要过程
首先我是centos7 php 。然后vim /flag根目录创建flag
flag{35-44c7-850e-131e10c9a6ud} 我省略了zip.www扫描源码。
1、 在根目录下建立flag文件(这个文件在正式做题中我们是见不到的,实际上是需要我们通过解题找到这个文件的)
vim /flag输入flag:
flag{70702196032-ec35-44c7-850e-131e10c9a6ud}
保存退出
2、 在网站目录建立test.php, 将以下代码放入其中。(注意这个文件在正式考试中我们是见不到的,我们只能在浏览器中看到html代码而不是php代码。)
<meta charset="utf-8">
<?php
//hint is in hint.php
error_reporting(1);
class Start
{
public $name='guest';
public $flag='syst3m("cat 127.0.0.1/etc/hint");';
public function __construct(){
echo "I think you need /etc/hint . Before this you need to see the source code";
}
public function _sayhello(){
echo $this->name;
return 'ok';
}
public function __wakeup(){
echo "hi";
$this->_sayhello();
}
public function __get($cc){
echo "give you flag : ".$this->flag;
return ;
}