test114514

简介: test114514
import code, os, subprocess
import pty
def blacklist_fun_callback(*args):
    print("Player! It's already banned!")
pty.spawn = blacklist_fun_callback
os.system = blacklist_fun_callback
os.popen = blacklist_fun_callback
subprocess.Popen = blacklist_fun_callback
subprocess.call = blacklist_fun_callback
code.interact = blacklist_fun_callback
code.compile_command = blacklist_fun_callback
vars = blacklist_fun_callback
attr = blacklist_fun_callback
dir = blacklist_fun_callback
getattr = blacklist_fun_callback
exec = blacklist_fun_callback
__import__ = blacklist_fun_callback
compile = blacklist_fun_callback
breakpoint = blacklist_fun_callback
del os, subprocess, code, pty, blacklist_fun_callback
input_code = input("Can u input your code to escape > ")
blacklist_words = [
    "subprocess",
    "os",
    "code",
    "interact",
    "pty",
    "pdb",
    "platform",
    "importlib",
    "timeit",
    "imp",
    "commands",
    "popen",
    "load_module",
    "spawn",
    "system",
    "/bin/sh",
    "/bin/bash",
    "flag",
    "eval",
    "exec",
    "compile",
    "input",
    "vars",
    "attr",
    "dir",
    "getattr"
    "__import__",
    "__builtins__",
    "__getattribute__",
    "__class__",
    "__base__",
    "__subclasses__",
    "__getitem__",
    "__self__",
    "__globals__",
    "__init__",
    "__name__",
    "__dict__",
    "._module",
    "builtins",
    "breakpoint",
    "import",
]
def my_filter(input_code):
    for x in blacklist_words:
        if x in input_code:
            return False
    return True
while '{' in input_code and '}' in input_code and input_code.isascii() and my_filter(input_code) and "eval" not in input_code and len(input_code) < 65:
    input_code = eval(f"f'{input_code}'")
else:
    print("Player! Please obey the filter rules which I set!")
目录
相关文章
|
6月前
tag test
tag test
32 0
|
9月前
test
test
33 0
|
3月前
|
数据安全/隐私保护 虚拟化 Windows
可能是最全的:虚拟机使用失败解决方案汇总
可能是最全的:虚拟机使用失败解决方案汇总
97 0
|
存储 SQL 缓存
OPA 7 - opaTest
Created by Wang, Jerry, last modified on Nov 08, 2015
119 0
OPA 7 - opaTest
|
数据安全/隐私保护 开发者
ctfshow-WEB-web1签到题
ctf.show WEB模块的第一关,这一关的flag藏在注释中,由于开发人员的粗心,没有及时删除开发过程中的代码注释,从而留下了敏感信息
596 0
ctfshow-WEB-web1签到题
test1
1340009911118900001111
320 0