easyctf-2017/self-modifier/grader.py

14 lines
445 B
Python
Raw Normal View History

def grade(random, key):
2017-03-17 23:04:48 +00:00
if key.find("hj3-0p9cgfb-ez") != -1:
return True, "Correct!"
incorrect_txt = 'Wrong. '
2017-03-17 23:04:48 +00:00
if key.find("hj3") == -1:
incorrect_txt += "Phase 1 failed. "
2017-03-17 23:04:48 +00:00
if key.find("-0p9") == -1:
incorrect_txt += "Phase 2 failed. "
2017-03-17 23:04:48 +00:00
if key.find("cgfb") == -1:
incorrect_txt += "Phase 3 failed. "
2017-03-17 23:04:48 +00:00
if key.find("-ez") == -1:
incorrect_txt += "Phase 4 failed. "
return False, incorrect_txt