---
title: "Discussion on \"BrunnerCTF - php-2003 Writeup\" | Hashnode"
description: "Discussion on \"BrunnerCTF - php-2003 Writeup\". BrunnerCTF PHP-2003 walkthrough covering PHP object injection, magic hashes, soft-hyphen bypass, duplicate properties, unserialize, and destructors."
url: "https://hashnode.com/posts/brunnerctf-php-2003-writeup/6a8b0bd013d6c9e2a997446f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [BrunnerCTF - php-2003 Writeup](https://exploitnotes.hashnode.dev/brunnerctf-php-2003-writeup?utm_source=hashnode&utm_medium=feed)

BrunnerCTF PHP-2003 walkthrough covering PHP object injection, magic hashes, soft-hyphen bypass, duplicate properties, unserialize, and destructors.

Aug 23 · 7 min read · exploitnotes.hashnode.dev  
Read the article

-   [#brunnerctf](https://hashnode.com/tag/brunnerctf)
-   [#php-2003](https://hashnode.com/tag/php-2003)
-   [#brunnerctf-walkthrough](https://hashnode.com/tag/brunnerctf-walkthrough)
-   [#ctf](https://hashnode.com/tag/ctf)
-   [#php](https://hashnode.com/tag/php)
-   [#php-object-injection](https://hashnode.com/tag/php-object-injection)
-   [#php-unserialize](https://hashnode.com/tag/php-unserialize)
-   [#magic-hash](https://hashnode.com/tag/magic-hash)
-   [#type-juggling](https://hashnode.com/tag/type-juggling)
-   [#web-exploitation](https://hashnode.com/tag/web-exploitation)
-   [#source-disclosure](https://hashnode.com/tag/source-disclosure)
-   [#soft-hyphen-bypass](https://hashnode.com/tag/soft-hyphen-bypass)
-   [#deserialization](https://hashnode.com/tag/deserialization)
-   [#ctf-writeup](https://hashnode.com/tag/ctf-writeup)
-   [#web-security](https://hashnode.com/tag/web-security)

## Written by

[Yogeshwar Peela](https://hashnode.com/@exploitnotes)

@exploitnotes · Vishakapatnam, India

  
[View profile](https://hashnode.com/@exploitnotes)

I write detailed writeups on HackTheBox, PicoCTF and other CTF challenges. Passionate about web exploitation, Active Directory attacks and ethical hacking

## Responses 1

Markdown supported · ⌘↵ to post

[jahanzaib12](https://hashnode.com/@jahanzaib12)

[Aug 27](https://hashnode.com/posts/brunnerctf-php-2003-writeup/6a8b0bd013d6c9e2a997446f/comment/6a8fb5afea05c087ba62a034)

The interesting part here is how several small validation weaknesses have to line up before the deserialization issue becomes useful. The Unicode soft-hyphen bypass and the loose `!=` comparison are good examples of why validation needs to match the actual application logic.

The duplicate-property trick is probably the most interesting part, since the application's regex sees `role=request` while PHP ultimately ends up with `role=admin`. It shows how validating a serialized representation without considering how PHP will interpret it can be dangerous.

Overall, the write-up does a nice job of showing that the vulnerability wasn't just `unserialize()` itself. The surrounding validation checks also played an important role in the exploit chain.
