-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
47 lines (33 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM i386/ubuntu
RUN mkdir /protostar
WORKDIR /protostar
# Install requirements
RUN apt update && apt install build-essential -y && apt-get install manpages-dev openssh-server git gdb -y
# Configure SSH server
RUN mkdir /var/run/sshd
RUN echo 'root:protostar' | chpasswd
COPY ./sshd_config /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# Disable ASLR
COPY ./01-disable-aslr.conf /etc/sysctl.d/
EXPOSE 22
# Disable ASLR
CMD ["echo 0 | tee /proc/sys/kernel/randomize_va_space"]
# copy protostar code source
COPY . .
# move protostar bins
RUN mv ./protostar /opt
RUN chmod u+s /opt/protostar/bin/*
# install tools
RUN chmod u+x ./tools/*
# RUN ./tools/checksec
# RUN ./tools/pwntools
# RUN ./tools/radare2
# create a user
RUN useradd -ms /bin/bash proto
RUN echo 'proto:proto' | chpasswd
# start sshd
CMD ["/usr/sbin/sshd","-D"]