It’s a simple XSS Challenge in PHP. The catch is that there is a nonce that prevents us from getting XSS directly and the nonce is basically the crc32 hash of our payload. But our payload must contain the nonce
Basically We should have the crc32 hash of the WHOLE MESSAGE inside the MESSAGE
Trying the Bruteforce
For a while, we were trying to brute force the nonce, hoping it will be the same at least one time since the crc32 has only 8 bytes.
funcAddLetter(c chanstring, combo string, alphabet string, length int) { // Check if we reached the length limit // If so, we just return without adding anything if length <= 0 { return }
var newCombo string for _, ch := range alphabet { newCombo = combo + string(ch) c <- newCombo AddLetter(c, newCombo, alphabet, length-1) } }
funcworker(wChan chanstring, target uint32) { for tString := range wChan { if crc32.ChecksumIEEE([]byte(tString)) == target { fmt.Println("Collision found:", tString) } } }
This is just a crc32 hash collider written in go. It will start with a String and append as many characters as maxLen would allow and try if the hash matches. So all that was left was for us to decide on a nonce and give its corresponding integer as the target in the code.
Note: Here we had to use a domain as the payload can only contain 127 characters and if we use webhook url we won’t have enough charcters left to bruteforce
By running the code on 16 different laptops with 16 cores with 16 different nonces, we were able to collide it just in time.
But we made one mistake in the domain to which the flag is sent. Where the domain was supposed to be `https://axol.space` I put `https://asol.space` :sob:
Now we had to put the correct domain and hash it again. This time it took even longer. It took so much time that we were just going to buy `https://asol.space`. But we collided that payload too and finally got the flag