RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list RUN apt-get update && apt-get -y dist-upgrade RUN apt-get install -y lib32z1 xinetd
RUN chmod +x /start.sh RUN chown -R root:ctf /home/ctf RUN chmod -R 750 /home/ctf RUN chmod 740 /home/ctf/flag RUN cp -R /lib* /home/ctf RUN cp -R /usr/lib* /home/ctf RUN mkdir /home/ctf/bin RUN cp /bin/sh /home/ctf/bin RUN cp /bin/ls /home/ctf/bin RUN cp /bin/cat /home/ctf/bin
WORKDIR /home/ctf
CMD ["/start.sh"]
EXPOSE9999
找到配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13
service ctf { disable = no socket_type = stream protocol = tcp wait = no user = root bind = 0.0.0.0 server = /usr/sbin/chroot server_args = --userspec=1000:1000 /home/ctf ./raft type = UNLISTED port = 9999 }
s = requests.Session() r = s.get(url) content = r.content
index = content.find("<!-- SUBSCRIBE SECION -->") index2 = content.find("<!-- END SUBSCRIBE SECION -->")
f = open("raft","wb+") f.write(r.content[index+len("<!-- SUBSCRIBE SECION -->")+2:index2])
f.close()
拿到bin后配个环境跑跑看
1 2 3 4 5 6
root@961e74e128a8:/tmp# ./raft ========================================== Do you want date with Firesun? ========================================== Loading....... Succeed! A date with Firesun is on sale!
Starting Nmap 6.40 ( http://nmap.org ) at 2016-12-18 16:05 CST Nmap scan report for ec2-54-223-241-254.cn-north-1.compute.amazonaws.com.cn (54.223.241.254) Host is up (0.035s latency). Not shown: 49999 closed ports PORT STATE SERVICE 22222/tcp open unknown 22333/tcp open unknown