diff --git a/pyjail-2/chall.yaml b/pyjail-2/chall.yaml deleted file mode 100644 index 555862e..0000000 --- a/pyjail-2/chall.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: JailBreak 2 -categories: - - misc -value: 125 -flag: bcactf{PyTH0n_M4st3R_Pr0veD} -description: |- - The prison has increased security measures since you last escaped it. - Can you still manage to escape? -hints: - - What in python is evaluated to a number? -files: - - src: ./main.py -authors: - - Jack Crowley -visible: true -#TODO Deployment \ No newline at end of file diff --git a/pyjail-2/deploy.py b/pyjail-2/deploy.py deleted file mode 100644 index 4ad71f3..0000000 --- a/pyjail-2/deploy.py +++ /dev/null @@ -1,27 +0,0 @@ -def sanitize(letter): - print("Checking for contraband...") - return any([i in letter.lower() for i in BANNED_CHARS]) - -def end(): - print("Contraband letters found!\nMessages Deleted!") - exit() - -BANNED_CHARS = "gdvxfiyundmn'~`@#$%^&.{}0123456789" -flag = "bcactf{PyTH0n_M4st3R_Pr0veD}" - -print("Welcome to the prison's mail center") - -msg = input("\nPlease enter your message: ") - -while msg != "": - if sanitize(msg): - end() - - try: - x = eval(msg) - if len(x) != len(flag): end() - print(x) - except Exception as e: - print(f'Error occured: {str(e)}; Message could not be sent.') - - msg = input("\nPlease enter your message: ") \ No newline at end of file diff --git a/pyjail-2/main.py b/pyjail-2/main.py deleted file mode 100644 index c97549c..0000000 --- a/pyjail-2/main.py +++ /dev/null @@ -1,27 +0,0 @@ -def sanitize(letter): - print("Checking for contraband...") - return any([i in letter.lower() for i in BANNED_CHARS]) - -def end(): - print("Contraband letters found!\nMessages Deleted!") - exit() - -BANNED_CHARS = "gdvxfiyundmnet/\\'~`@#$%^&.{}0123456789" -flag = "REDACTED" - -print("Welcome to the prison's mail center") - -msg = input("\nPlease enter your message: ") - -while msg != "": - if sanitize(msg): - end() - - try: - x = eval(msg) - if len(x) != len(flag): end() - print(x) - except Exception as e: - print(f'Error occured: {str(e)}; Message could not be sent.') - - msg = input("\nPlease enter your message: ") \ No newline at end of file diff --git a/pyjail-2/solve.md b/pyjail-2/solve.md deleted file mode 100644 index 99f52a8..0000000 --- a/pyjail-2/solve.md +++ /dev/null @@ -1,7 +0,0 @@ -# JailBreak 2 - -Unlike the first JailBreak, this time the security measures banned numbers. However, this does not factor into the fact the both `True` and `False` are counted as 1 and 0 respectedly. Using the `bool` function, which when presented with a not empty argument evaluates to true, we can then do math to get the the needed ascii values, counting the `bool("a")` as 1. - -``` -locals()[chr(((bool("a")+bool("a")+bool("a")+bool("a")+bool("a"))*(bool("a")+bool("a")))**(bool("a")+bool("a"))+bool("a")+bool("a"))+chr(((bool("a")+bool("a")+bool("a")+bool("a")+bool("a"))*(bool("a")+bool("a")))**(bool("a")+bool("a"))+(bool("a")+bool("a")+bool("a")+bool("a"))*(bool("a")+bool("a")))+chr(((bool("a")+bool("a")+bool("a")+bool("a")+bool("a"))*(bool("a")+bool("a")))**(bool("a")+bool("a"))-bool("a")-bool("a")-bool("a"))+chr(((bool("a")+bool("a")+bool("a")+bool("a")+bool("a"))*(bool("a")+bool("a")))**(bool("a")+bool("a"))+bool("a")+bool("a")+bool("a"))] -``` \ No newline at end of file