File size: 1,930 Bytes
965a74c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{"case": "eval1", "code": "def run(e):\n    return eval(e)\n", "truth": true}
{"case": "exec1", "code": "def f(c):\n    exec(c)\n", "truth": true}
{"case": "pickle1", "code": "import pickle\ndef f(b):\n    return pickle.loads(b)\n", "truth": true}
{"case": "shell1", "code": "import os\ndef f(p):\n    return os.system('ls ' + p)\n", "truth": true}
{"case": "subproc1", "code": "import subprocess\ndef f(c):\n    return subprocess.call(c, shell=True)\n", "truth": true}
{"case": "secret1", "code": "K = 'nvapi-ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\n", "truth": true}
{"case": "secret2", "code": "x = 'AKIAIOSFODNN7EXAMPLE'\n", "truth": true}
{"case": "crypto1", "code": "import hashlib\ndef h(x):\n    return hashlib.md5(x)\n", "truth": true}
{"case": "crypto2", "code": "def h(x):\n    return sha1(x)\n", "truth": true}
{"case": "trav1", "code": "def f(n):\n    return open('/tmp/' + n)\n", "truth": true}
{"case": "clean_add", "code": "def add(a, b):\n    return a + b\n", "truth": false}
{"case": "clean_ast", "code": "import ast\ndef run(e):\n    return ast.literal_eval(e)\n", "truth": false}
{"case": "clean_list", "code": "import subprocess\ndef f():\n    return subprocess.run(['ls', '-l'])\n", "truth": false}
{"case": "clean_open", "code": "def f():\n    return open('/tmp/fixed.txt')\n", "truth": false}
{"case": "clean_sha", "code": "import hashlib\ndef h(x):\n    return hashlib.sha256(x)\n", "truth": false}
{"case": "clean_calc", "code": "def mul(a, b):\n    return a * b\n", "truth": false}
{"case": "eval_empty", "code": "def run(e):\n    return eval(e, {})\n", "truth": true}
{"case": "shell_var", "code": "import os\ndef f(u):\n    os.popen('id ' + u)\n", "truth": true}
{"case": "pickle_dumps_ok", "code": "import pickle\ndef f(o):\n    return pickle.dumps(o)\n", "truth": false}
{"case": "subproc_str", "code": "import subprocess\ndef f():\n    return subprocess.run('ls')\n", "truth": false}