Skip to content

Instantly share code, notes, and snippets.

@key-moon
Last active May 6, 2022 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save key-moon/4717600f841174b368abbea6fef6a2be to your computer and use it in GitHub Desktop.
Save key-moon/4717600f841174b368abbea6fef6a2be to your computer and use it in GitHub Desktop.
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()
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