List soal PWN untuk KSL Seleksi
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

30 lignes
1.0 KiB

  1. # Use ubuntu 16.04
  2. FROM ubuntu:16.04
  3. RUN apt-get update && apt-get -y dist-upgrade --fix-missing --fix-broken
  4. # install socat editor ssh
  5. RUN apt-get install curl netcat-openbsd vim nano openssh-server socat lib32ncurses5 python python-pip python-dev -y
  6. RUN adduser --disabled-password --gecos "" ksl
  7. RUN echo "ksl:sebuahrahasiamas" | chpasswd
  8. ADD chall/. /chall
  9. WORKDIR /chall
  10. RUN echo 'KSL{xxxxxxxxxxxxxxxxxx}' > /chall/flag.txt # ubah isi flagnya
  11. # Secure ENV
  12. RUN echo 'alias kill="echo no kill please!"' >> ~/.bashrc
  13. RUN chmod 700 /tmp /var/tmp /usr/bin/* /bin/* /dev/shm
  14. 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
  15. RUN chown root:ksl /chall/namafile.py # ubah nama file
  16. RUN chmod 775 /chall/namafile.py # ubah nama file
  17. # Run Service
  18. RUN echo '#!/bin/bash'"\n(socat TCP-LISTEN:7000,reuseaddr,fork EXEC:"/chall/namafile.py,su=nobody")" > /var/tmp/.start.sh && chmod +x /var/tmp/.start.sh
  19. CMD ["/var/tmp/.start.sh"]