Last active
May 6, 2022 04:54
-
-
Save key-moon/4717600f841174b368abbea6fef6a2be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def _getflag(): | |
orig_file = sys._getframe(1).f_code.co_filename | |
if orig_file != __file__: | |
print('who are you...?') | |
exit(1) | |
print("0nepts{fakeflag}") | |
def getflag(): | |
_getflag() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import secret | |
from secret import getflag | |
def trace(frame, op, args): | |
if "secret" in frame.f_code.co_filename: | |
print("DO NOT TOUCH MY PRECIOUS") | |
exit(1) | |
sys.settrace(trace) | |
def audit(name, args): | |
if name in ["builtins.id", "open", "sys.settrace", "object.__getattr__"] or name.startswith("gc."): | |
exit(1) | |
sys.addaudithook(audit) | |
while True: | |
print(eval(input(), {"getflag": getflag}, {})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment