Dockerfile challenge docker-compose.xml flag pwn.xinetd start.sh
FROM ubuntu:16.04
MAINTAINER koharin
RUN apt-get update
RUN apt-get install -y xinetd netcat socat
RUN mkdir /home/pwn
RUN useradd -d /home/pwn pwn -s /bin/bash
RUN chown -R pwn:pwn /home/pwn/
CMD chown -R root:pwn /home/pwn
RUN chmod 750 /home/pwn
ADD ./challenge /home/pwn/test
RUN chmod +x /home/pwn/test
ADD ./flag /
RUN chown root:pwn /flag
RUN chmod 440 /flag
ADD pwn.xinetd /etc/xinetd/pwn
ADD ./start.sh /
RUN chmod +x /start.sh
CMD ["/usr/sbin/xinetd","-dontfork"]
xinetd
및 start.sh
파일 추가
version: '3'
services:
challenge:
build: .
ports:
- "20518:8080"
command:
- /start.sh
service challenge
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = pwn
server = /home/pwn/test
type = UNLISTED
port = 8080
}
#!/bin/sh
/etc/init.d/xinetd restart
/bin/bash
socat TCP-LISTEN:8080,reuseaddr,fork EXEC:'su pwn -c /home/pwn/test'
sleep infinity
docker-compose up -d
Mac M1 Vmware Fusion Ubuntu 설치 (2) | 2022.09.03 |
---|---|
Mac M1 Ghidra 설치 (0) | 2022.09.03 |
Target Packages is configured multiple times in /etc/apt/sources.list 해결 (0) | 2021.09.07 |
다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 해결 (0) | 2021.09.07 |
[Android] Apktool 프레임워크(framework) 관련 디컴파일/리컴파일 에러 (0) | 2021.08.24 |