Byte Bandits CTF 2019: EasyPHP [ Basic ]
Challenge Code
To solve this challenge if($hashed_input!==$hashed_key) condition should be matched.
There is one interesting PHP function is used in challenge - parse_str().
As per PHP manual - https://www.php.net/manual/en/function.parse-str.php
In challenge, “result” parameter is not used with parse_str(), therefore it suffers from dynamic variable value assignment issue.
To satisfy if($hashed_input!==$hashed_key) condition, value of $hashed_key can be overwritten with SHA256 hashed value of “key” variable.
- key = abcd
- hashed_input = sha256(abcd) = 88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589