Captcha1 | the Missing Lake

to get the flag we have to solve 300 captchas, each captcha is an image that contains text we have to extract the text from the image correctly and submit it if it's valid we have solved 1 captcha

we cannot do this manually so what we have to do is create a python script to automate the work done.

first we have to see the request done when we open the page and get new captcha image

in the response we have an encoded image embedded within the HTML response as a data:image/png;base64, so we'll need to extract and decode it from the HTML content using a script to save it as an image file.

In this script:

  1. We send a GET request to the URL

  2. We use a regular expression to extract the base64-encoded image data from the HTML response.

  3. We decode the base64-encoded image data and save it as an image file named "output.png" using the Python Imaging Library (PIL).

  4. We use the pytesseract library to perform OCR on the image obtained from the HTML response.

  5. The image_to_string function is used to extract text from the image.

  6. The extracted text is then printed to the console.

Make sure you have the requests and Pillow (PIL) libraries installed in your Python environment:

after we get the extracted text from the image we have to send a POST Request where we send the captcha value to the server

modified script to send the extracted text as the captcha value in a POST request

to solve 300 captchas by sending captcha values, we can modify the script to keep track of the number of captchas solved and continue the loop until we reach 300.

This script will continue sending captcha values and counting the number of captchas solved until it reaches the goal of 300. It will print the number of captchas solved as it progresses and a final message when 300 captchas are solved.

now let's run this script

and when the script finishes

and we have got the flag

Flag

Last updated

Was this helpful?