diff --git a/crypto-sagemath_9.6/Dockerfile b/crypto-sagemath_9.6/Dockerfile index 268730f..5e2d2f6 100644 --- a/crypto-sagemath_9.6/Dockerfile +++ b/crypto-sagemath_9.6/Dockerfile @@ -25,10 +25,10 @@ RUN sage --python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \ COPY ./src/main.sage /home/sage # 拷贝启动脚本至根目录 -COPY ./service/docker-entrypoint.sh / +COPY ./service/docker-entrypoint.sh /home/sage/docker-entrypoint.sh # [可选]指定对外暴露端口,对于GZCTF等平台,强制EXPOSE可能会造成非预期端口泄露,请酌情启用 # EXPOSE 9999 # 指定容器入口点 -ENTRYPOINT ["/bin/bash","/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/bin/bash","/home/sage/docker-entrypoint.sh"] \ No newline at end of file diff --git a/crypto-sagemath_9.6/service/docker-entrypoint.sh b/crypto-sagemath_9.6/service/docker-entrypoint.sh index e19166e..143653e 100644 --- a/crypto-sagemath_9.6/service/docker-entrypoint.sh +++ b/crypto-sagemath_9.6/service/docker-entrypoint.sh @@ -1,5 +1,8 @@ #!/bin/sh +# 删除启动脚本,以防非预期 +rm -f /home/sage/docker-entrypoint.sh + # 通过socat转发SageMath会话 # TCP4-LISTEN:9999 服务将会转发到9999端口 # reuseaddr 启用端口复用,便于多用户同时连接同一个端口 diff --git a/crypto-sagemath_9.6/src/main.sage b/crypto-sagemath_9.6/src/main.sage index 0928115..6d84753 100644 --- a/crypto-sagemath_9.6/src/main.sage +++ b/crypto-sagemath_9.6/src/main.sage @@ -8,7 +8,18 @@ Introduction = """ flag = os.getenv('FLAG') +BANNER = r''' + ____ _____ _____ _ _ _ + / ___|_ _| ___| / \ _ __ ___| |__ (_)_ _____ ___ + | | | | | |_ _____ / _ \ | '__/ __| '_ \| \ \ / / _ \/ __| + | |___ | | | _|_____/ ___ \| | | (__| | | | |\ V / __/\__ \ + \____| |_| |_| /_/ \_\_| \___|_| |_|_| \_/ \___||___/ + + +''' + if __name__ == "__main__": + print(BANNER) while True: ins = input("Please input 'ctf':") if ins == "ctf":