Skip to content

Instantly share code, notes, and snippets.

@lionaneesh
Created November 5, 2019 10:50
Show Gist options
  • Save lionaneesh/314e97e3c60c9e4874178dca9e38b84c to your computer and use it in GitHub Desktop.
Save lionaneesh/314e97e3c60c9e4874178dca9e38b84c to your computer and use it in GitHub Desktop.
pyjail, N-CTF 2019
#! /usr/bin/python3
#-*- coding:utf-8 -*-
def main():
print("Hi! Welcome to pyjail!")
print("========================================================================")
print(open(__file__).read())
print("========================================================================")
print("RUN")
text = input('>>> ')
for keyword in ['eval', 'exec', 'import', 'open', 'os', 'read', 'system', 'write']:
if keyword in text:
print("No!!!")
return;
else:
exec(text)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment