easyctf-2017/wayward-space-junk/grader.py

13 lines
442 B
Python
Raw Normal View History

2016-10-28 20:00:59 +00:00
def generate(random):
key = "".join([random.choice("0123456789abcdef") for i in range(32)])
return dict(variables={
"key": key
})
def grade(autogen, answer):
key = "".join([autogen.choice("0123456789abcdef") for i in range(32)])
autogen.seed("super%secretkeylalalala" % key)
flag = "".join([random.choice("012456789abcdef") for i in range(32)])
if answer.find(flag) != -1:
return True, "Correct!"
return False, "Nope, try again."