service ctf { disable = no socket_type = stream protocol = tcp wait = no user = root type = UNLISTED port = 9999 bind = 0.0.0.0 server = /usr/sbin/chroot # replace helloworld to your program server_args = --userspec=1000:1000 /home/ctf ./oneChance banner_fail = /etc/banner_fail # safety options per_source = 10 # the maximum instances of this service per source IP address rlimit_cpu = 20 # the maximum number of CPU seconds that the service may use #rlimit_as = 1024M # the Address Space resource limit for the service #access_times = 2:00-9:00 12:00-24:00 }
#!/bin/sh # Add your startup script #!/bin/sh sed-i"s/cdusec{pwntestflag}/$FLAG/"/home/ctf/flag exportFLAG="" # DO NOT DELETE /etc/init.d/xinetdstart; sleepinfinity;
本地测试
1
docker run -d -p "127.0.0.1:8888:9999" -h "pwn" --name="pwn" pwn