mirror of
https://github.com/nganhkhoa/CTF-All-In-One.git
synced 2024-12-25 11:41:16 +07:00
1.2 KiB
1.2 KiB
2.1.3 Docker
在配置 pwn 环境时,如果不想每次都用 socat,那么 ctf_xinetd 是个不错的选择。
安装 docker:
$ sudo apt install docker.io
ctf_xinetd 用法示例:
$ git clone https://github.com/Eadom/ctf_xinetd.git
$ sudo docker build -t "helloworld" ./ctf_xinetd/
$ sudo docker run -d -p "0.0.0.0:10001:9999" -h "helloworld" --name="helloworld" helloworld
docker 的一些基本操作:
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
helloworld latest 80b466e06d24 2 hours ago 372 MB
ubuntu 16.04 4a689991aa24 2 weeks ago 116 MB
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8f8a5d22f68e helloworld "/start.sh" About a minute ago Up About a minute 0.0.0.0:10001->9999/tcp helloworld
$ sudo docker stop 8f8a5d22f68e
8f8a5d22f68e
$ sudo docker rm 8f8a5d22f68e
8f8a5d22f68e
$ sudo docker rmi 80b466e06d24
Untagged: helloworld:latest