From 0cf3f0ece31cc0f3d0de19e6a9cd2806f4dd379f Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 3 Sep 2024 13:55:41 -0700 Subject: [PATCH] another unintended one! --- input-restrictions/19-next-2/run | 16 ++++++++++++++++ input-restrictions/module.yml | 4 ++++ 2 files changed, 20 insertions(+) create mode 100755 input-restrictions/19-next-2/run diff --git a/input-restrictions/19-next-2/run b/input-restrictions/19-next-2/run new file mode 100755 index 0000000..cfc3074 --- /dev/null +++ b/input-restrictions/19-next-2/run @@ -0,0 +1,16 @@ +#!/usr/bin/env -iS /opt/pwn.college/bash + +PATH=/usr/bin + +WORKDIR=$(mktemp -d) +[ -n "$WORKDIR" ] || exit 1 +cp "$1" "$WORKDIR/dangerous-script.sh" +cd $WORKDIR + +doit() { + echo -n "" + cat dangerous-script.sh | tr -cd "[\n $\-/0-9a-z]" | grep -E "^(echo|read) " > safe-script.sh + bash safe-script.sh +} + +doit diff --git a/input-restrictions/module.yml b/input-restrictions/module.yml index 4ec068a..4648482 100644 --- a/input-restrictions/module.yml +++ b/input-restrictions/module.yml @@ -47,6 +47,10 @@ challenges: description: In the depth of confusion, seek your true name and find yourself anew. - id: "19-next" + name: Sensing of Secrets + description: In speaking truth, one can reveal mysteries. + +- id: "19-next-2" name: The Stumble From Safety description: A perfect stumble can reveal the path of infinite potential. Is safety binding, or just an illusion?