Skip to content

Commit

Permalink
another unintended one!
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Sep 3, 2024
1 parent 49b50a9 commit 0cf3f0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions input-restrictions/19-next-2/run
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions input-restrictions/module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit 0cf3f0e

Please sign in to comment.