Sfoglia il codice sorgente

ping-service

master
paulussimanjuntak 6 anni fa
parent
commit
985d771edd
4 ha cambiato i file con 31 aggiunte e 5 eliminazioni
  1. +31
    -0
      ping-service/Dockerfile
  2. +0
    -1
      ping-service/README.md
  3. +0
    -0
      ping-service/chall/ping-service.py
  4. +0
    -4
      ping-service/start.sh

+ 31
- 0
ping-service/Dockerfile Vedi 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{U14RZ_M4M4NXX_KERENZX_4ANEETTT!!}' > /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/ping-service.py # ubah nama file
RUN chmod 775 /chall/ping-service.py # ubah nama file
# Run Service
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
CMD ["/var/tmp/.start.sh"]

+ 0
- 1
ping-service/README.md Vedi File

@ -1 +0,0 @@
ping-service.py

ping-service/ping-service.py → ping-service/chall/ping-service.py Vedi File


+ 0
- 4
ping-service/start.sh Vedi File

@ -1,4 +0,0 @@
#!/bin/bash
#nc ip port
socat TCP-LISTEN:5000,reuseaddr,fork EXEC:./ping-service.py

Caricamento…
Annulla
Salva