This commit is contained in:
30
service/docker-entrypoint.sh
Normal file
30
service/docker-entrypoint.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get the user
|
||||
user=$(ls /home)
|
||||
|
||||
# Check the environment variables for the flag and assign to INSERT_FLAG
|
||||
if [ "$DASFLAG" ]; then
|
||||
INSERT_FLAG="$DASFLAG"
|
||||
export DASFLAG=no_FLAG
|
||||
DASFLAG=no_FLAG
|
||||
elif [ "$FLAG" ]; then
|
||||
INSERT_FLAG="$FLAG"
|
||||
export FLAG=no_FLAG
|
||||
FLAG=no_FLAG
|
||||
elif [ "$GZCTF_FLAG" ]; then
|
||||
INSERT_FLAG="$GZCTF_FLAG"
|
||||
export GZCTF_FLAG=no_FLAG
|
||||
GZCTF_FLAG=no_FLAG
|
||||
else
|
||||
INSERT_FLAG="flag{TEST_Dynamic_FLAG}"
|
||||
fi
|
||||
|
||||
# 将FLAG写入文件 请根据需要修改
|
||||
echo $INSERT_FLAG | tee /home/$user/flag
|
||||
|
||||
# 赋予程序运行权限
|
||||
chmod 711 /home/ctf/pwn
|
||||
|
||||
/etc/init.d/xinetd start;
|
||||
sleep infinity;
|
||||
Reference in New Issue
Block a user