def PlaceTrolololFlags(teams):
    for team in teams:
        # only run when a team is not disabled
        if not str(team).__contains__("d"):
            # create a flag and place it on the server
            m = hashlib.md5()
            m.update(randomString(100))
            flag = m.hexdigest()
            trololol_put.trololol_put(team, flag)
            # each team has a file like 192.168.56.104.flag which contains the enemy's flags.
            # every team also has a file like 192.168.56.104My.flag which contains their own flags.
            for opponent in teams:
                if not str(opponent).__contains__("d"):
                    if opponent != team:
                        ff = open(opponent + ".flag", "a")
                        ff.write(flag + "\n")
                        ff.close()
                    else:
                        ff = open(opponent + "My.flag", "a")
                        ff.write(flag + "\n")
                        ff.close()
Пример #2
0
def PlaceTrolololFlags(teams):
    for team in teams:
        # only run when a team is not disabled
        if not str(team).__contains__('d'):
            # create a flag and place it on the server
            m = hashlib.md5()
            m.update(randomString(100))
            flag = m.hexdigest()
            trololol_put.trololol_put(team, flag)
            # each team has a file like 192.168.56.104.flag which contains the enemy's flags.
            # every team also has a file like 192.168.56.104My.flag which contains their own flags.
            for opponent in teams:
                if not str(opponent).__contains__('d'):
                    if opponent != team:
                        ff = open(opponent + ".flag", "a")
                        ff.write(flag + "\n")
                        ff.close()
                    else:
                        ff = open(opponent + "My.flag", "a")
                        ff.write(flag + "\n")
                        ff.close()
Пример #3
0
fo = open("teams.list", "r")
teams=[]
for team in fo.readlines():
    teams.append(team[:-1])
    ff = open(team[:-1]+"My.flag", "a")
    ff.close()



        
for team in teams:
    print team
    m = hashlib.md5()
    m.update(randomString(100))
    flag=m.hexdigest()
    trololol_put.trololol_put(team,flag)
    for otherteam in teams:
        if otherteam!=team:
            ff = open(otherteam+".flag", "a")
            ff.write(flag+"\n")
            ff.close()
        else:
            ff = open(otherteam+"My.flag", "a")
            ff.write(flag+"\n")
            ff.close()
time.sleep(5)
for team in teams:
    ff = open(team+"My.flag", "r")
    flag=ff.readlines()[-1:][0][:-1]
    ff.close()
    if trololol_get.trololol_get(team,flag):
Пример #4
0
                   for _ in range(n))


fo = open("teams.list", "r")
teams = []
for team in fo.readlines():
    teams.append(team[:-1])
    ff = open(team[:-1] + "My.flag", "a")
    ff.close()

for team in teams:
    print team
    m = hashlib.md5()
    m.update(randomString(100))
    flag = m.hexdigest()
    trololol_put.trololol_put(team, flag)
    for otherteam in teams:
        if otherteam != team:
            ff = open(otherteam + ".flag", "a")
            ff.write(flag + "\n")
            ff.close()
        else:
            ff = open(otherteam + "My.flag", "a")
            ff.write(flag + "\n")
            ff.close()
time.sleep(5)
for team in teams:
    ff = open(team + "My.flag", "r")
    flag = ff.readlines()[-1:][0][:-1]
    ff.close()
    if trololol_get.trololol_get(team, flag):