From 6e0c50e620655cb7f7c5ac480e10375f2dff9ab5 Mon Sep 17 00:00:00 2001 From: OkaAditya Date: Wed, 24 Oct 2018 19:09:47 +0800 Subject: [PATCH] Upload files to 'Kepala' --- Kepala/Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Kepala/Dockerfile diff --git a/Kepala/Dockerfile b/Kepala/Dockerfile new file mode 100644 index 0000000..95099a0 --- /dev/null +++ b/Kepala/Dockerfile @@ -0,0 +1,33 @@ +# Use ubuntu 16.04 +FROM ubuntu:16.04 + +RUN apt-get update && apt-get -y dist-upgrade --fix-missing --fix-broken + +# install socat editor ssh +RUN apt-get install curl netcat-openbsd vim nano openssh-server socat lib32ncurses5 python python-pip python-dev ruby-full -y + +RUN adduser --disabled-password --gecos "" ksl +RUN echo "ksl:sebuahrahasiamas" | chpasswd + +ADD chall/. /chall +WORKDIR /chall + +RUN cp /usr/bin/ruby /usr/local/bin/ +RUN cp /usr/bin/curl /usr/local/bin/ +RUN echo 'KSL{n0T_0nLy_p1P3_L1n3_C4n_D0_Th4T}' > /chall/flag.txt # ubah isi flagnya + +# Secure ENV + +RUN echo 'alias kill="echo no kill please!"' >> ~/.bashrc +RUN chmod 700 /tmp /usr/bin/* /bin/* /dev/shm +RUN chmod 755 /usr/bin/env /bin/dash /bin/bash /bin/sh /bin/nc /bin/cat /usr/bin/curl /usr/bin/groups /usr/bin/id /bin/ls /usr/bin/python /usr/bin/ruby + + +RUN chown root:ksl /chall/header.rb # ubah nama file +RUN chmod 775 /chall/header.rb # ubah nama file + +# Run Service + +RUN echo '#!/bin/bash'"\n(socat TCP-LISTEN:5550,reuseaddr,fork EXEC:"/chall/header.rb,su=nobody")" > /var/tmp/.start.sh && chmod +x /var/tmp/.start.sh + +CMD ["/var/tmp/.start.sh"]