diff --git a/v8ctf/chrome-118/challenge/Dockerfile b/v8ctf/chrome-118/challenge/Dockerfile index 18b09afe..e36da457 100644 --- a/v8ctf/chrome-118/challenge/Dockerfile +++ b/v8ctf/chrome-118/challenge/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM ubuntu:22.04 as chroot -RUN /usr/sbin/useradd --no-create-home -u 1000 user +RUN /usr/sbin/useradd -u 1000 user RUN apt-get update && apt-get install -y gnupg2 wget @@ -32,10 +32,10 @@ RUN apt-get update && apt-get install -y unzip RUN mkdir /home/user # This version is to be released on 2023-11-06 -RUN wget 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chrome-linux64.zip' -O /home/user/chrome-linux.zip -RUN cd /home/user && unzip chrome-linux.zip && rm chrome-linux.zip +RUN wget 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chrome-linux64.zip' -O /opt/chrome-linux.zip +RUN cd /opt && unzip chrome-linux.zip && rm chrome-linux.zip -COPY chal /home/user/ +COPY chal /opt/ FROM gcr.io/kctf-docker/challenge@sha256:0f7d757bcda470c3bbc063606335b915e03795d72ba1d8fdb6f0f9ff3757364f @@ -53,4 +53,4 @@ CMD kctf_setup && \ kctf_drop_privs \ socat \ TCP-LISTEN:1337,reuseaddr,fork \ - EXEC:"kctf_pow nsjail --config /home/user/nsjail.cfg -- /home/user/chal",stderr + EXEC:"kctf_pow nsjail --config /home/user/nsjail.cfg -- /opt/chal",stderr diff --git a/v8ctf/chrome-118/challenge/chal b/v8ctf/chrome-118/challenge/chal index a2c7f981..089fa263 100755 --- a/v8ctf/chrome-118/challenge/chal +++ b/v8ctf/chrome-118/challenge/chal @@ -1,6 +1,6 @@ #!/usr/bin/bash -CHROME=/home/user/chrome-linux64/chrome +CHROME=/opt/chrome-linux64/chrome echo "Version: $($CHROME --version | head -n1)" echo "Please send me a URL to open." @@ -10,6 +10,5 @@ if ! echo $url | grep -E '^https?://[A-Za-z0-9.:/?%\-_+&=]*$' -q; then exit 1 fi -export HOME=/tmp dbus-daemon --system -dbus-run-session -- $CHROME --headless=new --no-sandbox --disable-crashpad --disable-breakpad --disable-crash-reporter --user-data-dir=/tmp/chrome-userdata --enable-logging=stderr "${url}" +dbus-run-session -- $CHROME --headless=new --no-sandbox --disable-crashpad --disable-breakpad --disable-crash-reporter --enable-logging=stderr "${url}" diff --git a/v8ctf/chrome-118/challenge/nsjail.cfg b/v8ctf/chrome-118/challenge/nsjail.cfg index b2d96e8f..05c1595a 100644 --- a/v8ctf/chrome-118/challenge/nsjail.cfg +++ b/v8ctf/chrome-118/challenge/nsjail.cfg @@ -41,6 +41,11 @@ mount: [ fstype: "tmpfs" rw: true }, + { + dst: "/home/user" + fstype: "tmpfs" + rw: true + }, { dst: "/run/dbus" fstype: "tmpfs" diff --git a/v8ctf/chrome/challenge/Dockerfile b/v8ctf/chrome/challenge/Dockerfile index 3cf133e5..90d6053a 100644 --- a/v8ctf/chrome/challenge/Dockerfile +++ b/v8ctf/chrome/challenge/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM ubuntu:22.04 as chroot -RUN /usr/sbin/useradd --no-create-home -u 1000 user +RUN /usr/sbin/useradd -u 1000 user RUN apt-get update && apt-get install -y gnupg2 wget @@ -32,10 +32,10 @@ RUN apt-get update && apt-get install -y unzip RUN mkdir /home/user # This version is to be released on 2024-01-12 -RUN wget 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.71/linux64/chrome-linux64.zip' -O /home/user/chrome-linux.zip -RUN cd /home/user && unzip chrome-linux.zip && rm chrome-linux.zip +RUN wget 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.71/linux64/chrome-linux64.zip' -O /opt/chrome-linux.zip +RUN cd /opt && unzip chrome-linux.zip && rm chrome-linux.zip -COPY chal /home/user/ +COPY chal /opt/ FROM gcr.io/kctf-docker/challenge@sha256:0f7d757bcda470c3bbc063606335b915e03795d72ba1d8fdb6f0f9ff3757364f @@ -53,4 +53,4 @@ CMD kctf_setup && \ kctf_drop_privs \ socat \ TCP-LISTEN:1337,reuseaddr,fork \ - EXEC:"kctf_pow nsjail --config /home/user/nsjail.cfg -- /home/user/chal",stderr + EXEC:"kctf_pow nsjail --config /home/user/nsjail.cfg -- /opt/chal",stderr diff --git a/v8ctf/chrome/challenge/chal b/v8ctf/chrome/challenge/chal index a2c7f981..089fa263 100755 --- a/v8ctf/chrome/challenge/chal +++ b/v8ctf/chrome/challenge/chal @@ -1,6 +1,6 @@ #!/usr/bin/bash -CHROME=/home/user/chrome-linux64/chrome +CHROME=/opt/chrome-linux64/chrome echo "Version: $($CHROME --version | head -n1)" echo "Please send me a URL to open." @@ -10,6 +10,5 @@ if ! echo $url | grep -E '^https?://[A-Za-z0-9.:/?%\-_+&=]*$' -q; then exit 1 fi -export HOME=/tmp dbus-daemon --system -dbus-run-session -- $CHROME --headless=new --no-sandbox --disable-crashpad --disable-breakpad --disable-crash-reporter --user-data-dir=/tmp/chrome-userdata --enable-logging=stderr "${url}" +dbus-run-session -- $CHROME --headless=new --no-sandbox --disable-crashpad --disable-breakpad --disable-crash-reporter --enable-logging=stderr "${url}" diff --git a/v8ctf/chrome/challenge/nsjail.cfg b/v8ctf/chrome/challenge/nsjail.cfg index b2d96e8f..05c1595a 100644 --- a/v8ctf/chrome/challenge/nsjail.cfg +++ b/v8ctf/chrome/challenge/nsjail.cfg @@ -41,6 +41,11 @@ mount: [ fstype: "tmpfs" rw: true }, + { + dst: "/home/user" + fstype: "tmpfs" + rw: true + }, { dst: "/run/dbus" fstype: "tmpfs"