Created
November 5, 2019 10:50
-
-
Save lionaneesh/314e97e3c60c9e4874178dca9e38b84c to your computer and use it in GitHub Desktop.
pyjail, N-CTF 2019
This file contains hidden or 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
| #! /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