Skip to content
Snippets Groups Projects
changeme.py 744 B
Newer Older
Ruben Anthony Gonzalez's avatar
Ruben Anthony Gonzalez committed
"""
These are ctf dependent functions.
They have to be aligned.
"""
from random import randint
Ruben Anthony Gonzalez's avatar
Ruben Anthony Gonzalez committed


MESSAGES = [
        "SUCCESS",
        "INVALID",
        "ALREADY_SUBMITTED",
        "ERROR"
]


# TODO: Change these values
# list of team ids
Ruben Anthony Gonzalez's avatar
Ruben Anthony Gonzalez committed
all_teams = [i for i in range(16)]
# Has to be byte string since wre looking through byte output (STDOUT)
flag_regex = b"flag{[A-Za-z0-9_.]+}"

exploit_dir = "exploits"
wait_between_runs = 10
# Number of exploit workers
proc_num = 4
res_file_path =  "results.txt"

Ruben Anthony Gonzalez's avatar
Ruben Anthony Gonzalez committed

def submission_logic(flag):
    # TODO: Add actual submission logic
    return randint(0, len(MESSAGES) - 1)
Ruben Anthony Gonzalez's avatar
Ruben Anthony Gonzalez committed

def team_id_to_ip(team_id):
    """
    Somehow map team id to ip adress
    """
    return "10.13.37.{}".format(team_id)