rev: add a few more challenges
This commit is contained in:
3
rev/patchme_py/flag.txt.enc
Normal file
3
rev/patchme_py/flag.txt.enc
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
* ' UYX+
|
||||
CR1@
|
4
rev/patchme_py/output.txt
Normal file
4
rev/patchme_py/output.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
$ python patchme.flag.py
|
||||
Please enter correct password for flag: ak98-=90adfjhgj321sleuth9000
|
||||
Welcome back... your flag, user:
|
||||
picoCTF{p47ch1ng_l1f3_h4ck_c4a4688b}
|
31
rev/patchme_py/patchme.flag.py
Normal file
31
rev/patchme_py/patchme.flag.py
Normal file
@@ -0,0 +1,31 @@
|
||||
### THIS FUNCTION WILL NOT HELP YOU FIND THE FLAG --LT ########################
|
||||
def str_xor(secret, key):
|
||||
#extend key to secret length
|
||||
new_key = key
|
||||
i = 0
|
||||
while len(new_key) < len(secret):
|
||||
new_key = new_key + key[i]
|
||||
i = (i + 1) % len(key)
|
||||
return "".join([chr(ord(secret_c) ^ ord(new_key_c)) for (secret_c,new_key_c) in zip(secret,new_key)])
|
||||
###############################################################################
|
||||
|
||||
|
||||
flag_enc = open('flag.txt.enc', 'rb').read()
|
||||
|
||||
|
||||
|
||||
def level_1_pw_check():
|
||||
user_pw = input("Please enter correct password for flag: ")
|
||||
if( user_pw == "ak98" + \
|
||||
"-=90" + \
|
||||
"adfjhgj321" + \
|
||||
"sleuth9000"):
|
||||
print("Welcome back... your flag, user:")
|
||||
decryption = str_xor(flag_enc.decode(), "utilitarian")
|
||||
print(decryption)
|
||||
return
|
||||
print("That password is incorrect")
|
||||
|
||||
|
||||
|
||||
level_1_pw_check()
|
Reference in New Issue
Block a user