List soal PWN untuk KSL Seleksi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

преди 6 години
преди 6 години
преди 6 години
преди 6 години
преди 6 години
преди 6 години
преди 6 години
  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 iputils-ping -y
  6. RUN adduser --disabled-password --gecos "" ksl
  7. RUN echo "ksl:sebuahrahasiamas" | chpasswd
  8. ADD chall/. /chall
  9. WORKDIR /chall
  10. RUN cp /bin/ping /usr/local/bin/
  11. RUN echo 'KSL{U14RZ_M4M4NXX_KERENZX_4ANEETTT!!}' > /chall/flag.txt # ubah isi flagnya
  12. # Secure ENV
  13. RUN echo 'alias kill="echo no kill please!"' >> ~/.bashrc
  14. RUN chmod 700 /usr/bin/* /bin/* /dev/shm
  15. 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 /bin/ping
  16. RUN chown root:ksl /chall/ping-service.py # ubah nama file
  17. RUN chmod 775 /chall/ping-service.py # ubah nama file
  18. # Run Service
  19. RUN echo '#!/bin/bash'"\n(socat TCP-LISTEN:7000,reuseaddr,fork EXEC:"/chall/ping-service.py,su=nobody")" > /var/tmp/.start.sh && chmod +x /var/tmp/.start.sh
  20. CMD ["/var/tmp/.start.sh"]