From 4b896bc73ca5c19a23bf7590866eadf4753f87f4 Mon Sep 17 00:00:00 2001 From: Michael Chen Date: Tue, 17 May 2022 13:20:50 +0200 Subject: [PATCH] Completed challenge 249 --- 249/level5.py | 4 ++-- 249/solve.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 249/solve.py diff --git a/249/level5.py b/249/level5.py index b9c2a89..55bd936 100644 --- a/249/level5.py +++ b/249/level5.py @@ -35,6 +35,6 @@ def level_5_pw_check(): print("That password is incorrect") - -level_5_pw_check() +if __name__ == '__main__': + level_5_pw_check() diff --git a/249/solve.py b/249/solve.py new file mode 100644 index 0000000..21e3349 --- /dev/null +++ b/249/solve.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +from level5 import * + +with open('dictionary.txt', 'r') as f: + pos_pw_list = f.read().split('\n') +correct_pw = next(pw for pw in pos_pw_list if hash_pw(pw) == correct_pw_hash) +print(f'Correct password is: {correct_pw}') +print(str_xor(flag_enc.decode(), correct_pw)) \ No newline at end of file