<?phpinclude"../../config.php";if($_GET["view-source"]==1){view_source();}?>...<?phpsleep(1);// anti brute forceif(isset($_SESSION["chall4"])&&$_POST["key"]==$_SESSION["chall4"]){solve(4);}$hash=rand(10000000,99999999)."salt_for_you";$_SESSION["chall4"]=$hash;for($i=0;$i<500;$i++){$hash=sha1($hash);}?>
Looks like we are given a sha1 hash which is generated from random number + salt, then iterated 500 on itself...
I used Golang to do multithreading and logging the already iterated hashes:
After ~40min there was no success, so I decided grep generated hashes (around ~20mil)
The very first hash was success, but I was kicked out of my session lol. After logging in and try last number + salt we can pwn the challenge.
old-04-1.png
Note: The image shows my first attempt, not second. Results still same.