Advertisement
7oSkaaa

Click

Mar 20th, 2024
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import requests
  2.  
  3.  
  4. def get_the_flag():
  5.     # make a request to the server to get the flag and print it
  6.     response = requests.post('https://click.ctf.about-noon.com/api/increment')
  7.  
  8.     # check if the request was successful
  9.     flag = response.json().get('flag')
  10.    
  11.     if flag:
  12.         print(f"Flag: {flag}")
  13.         return flag
  14.  
  15.  
  16. def main():
  17.     while True:
  18.         # get the flag
  19.         flag = get_the_flag()
  20.        
  21.         # if the flag is not None, break the loop
  22.         if flag:
  23.             break
  24.  
  25.    
  26. if __name__ == "__main__":
  27.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement