Files
attack-defense-platform/services/naraka/src/scripts/execute.py
T
2025-10-10 22:18:06 +07:00

24 lines
555 B
Python

import sys
import string
BLACKLIST =['FLAG','cat']
# BLACKLIST = ""
# You cannot change the value of FLAG, FLAG can only be filled with sys.argv[2]
FLAG = sys.argv[2]
def security_check(user_input, blacklist):
for bl in blacklist:
if bl in user_input:
return 1
if __name__ == "__main__":
user_input = sys.argv[1]
if(security_check(user_input,BLACKLIST)):
print("too bads")
else:
try:
user_input = eval(user_input)
except Exception as e:
pass
exec(user_input)