Browse Source

perintah_linux

master
bagushehe 2 years ago
parent
commit
896681a82a
2 changed files with 31 additions and 0 deletions
  1. +31
    -0
      perintah_linux/Dockerfile
  2. +0
    -0
      perintah_linux/chall/perintah_linux.py

+ 31
- 0
perintah_linux/Dockerfile View File

@ -0,0 +1,31 @@
# 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 -y
RUN adduser --disabled-password --gecos "" ksl
RUN echo "ksl:sebuahrahasiamas" | chpasswd
ADD chall/. /chall
WORKDIR /chall
RUN echo 'KSL{FEEL_BETTER_USE_LINUX}' > /chall/flag.txt # ubah isi flagnya
# Secure ENV
RUN echo 'alias kill="echo no kill please!"' >> ~/.bashrc
RUN chmod 700 /tmp /var/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
RUN chown root:ksl /chall/perintah_linux.py # ubah nama file
RUN chmod 775 /chall/perintah_linux.py # ubah nama file
# Run Service
RUN echo '#!/bin/bash'"\n(socat TCP-LISTEN:7000,reuseaddr,fork EXEC:"/chall/perintah_linux.py,su=nobody")" > /var/tmp/.start.sh && chmod +x /var/tmp/.start.sh
CMD ["/var/tmp/.start.sh"]

perintah_linux/perintah_linux.py → perintah_linux/chall/perintah_linux.py View File


Loading…
Cancel
Save