image.png

Want to run this Docker Container Locally?

docker run -d -p 9045:80 --name flag-red64 --restart always joshbeck2024/ctf-php-serialization-explained-flag-red64

What is Serialization?

Consider this Basic Object written using PHP:

class House {
    public $color;
    public $rooms;
    public $price;

    // The constructor helps us build the house with specific details
    public function __construct($color, $rooms, $price) {
        $this->color = $color;
        $this->rooms = $rooms;
        $this->price = $price;
    }
}

// Creating the instance
$myHouse = new House("blue", 3, 150000);

// Converting it to a string
echo serialize($myHouse);

We have an object (House) with properties:

We create an instance of this object called $myhouse And we populate this instance with the values below:

The serialized or string equivalent of this object would look like what I have in the code block below: