mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:27:02 +01:00
Renames this repo's markdown onto README.md / CLAUDE*.md / DOCS*.md / TODO*.md so a future session can tell a live task from a finished record without reading the file to find out. TODO files carry the literal "REMOVE ME AFTER FINISH" and are deleted when the work lands. Enforced by the md-naming pre-commit hook and CI workflow, both delegating to the shared gate in kuhyx/utils so this repo's idea of a valid name cannot drift from every other repo's. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A47aX5DJwmA3QFn3pkEWi7
5.0 KiB
5.0 KiB
Part 1: Current State Analysis
1. /etc/hosts Protection System
Files involved:
- hosts/install.sh - Main hosts installer
- hosts/guard/setup_hosts_guard.sh - Guard layer setup
- hosts/guard/enforce-hosts.sh - Enforcement script
- hosts/guard/psychological/unlock-hosts.sh - Delayed unlock
Current Protection Layers:
- ✅ Immutable attribute (
chattr +i) - ✅ Canonical copy at
/usr/local/share/locked-hosts - ✅ Path watcher (
hosts-guard.path) auto-restores on modification - ✅ Read-only bind mount (
hosts-bind-mount.service) - ✅ Custom entries protection (blocks removal of blocked domains)
- ✅ Shell history suppression for
unlock-hostscommand
CRITICAL VULNERABILITY IDENTIFIED:
- ❌ NO protection for
/etc/nsswitch.conf- A user can simply edit nsswitch.conf and removefilesfrom thehosts:line, completely bypassing ALL /etc/hosts protections without touching the hosts file itself!
Example bypass:
# Original: hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
# Tampered: hosts: mymachines resolve [!UNAVAIL=return] myhostname dns
# Result: /etc/hosts is completely ignored by the system
2. Midnight Shutdown System
Files involved:
Current Protection Layers:
- ✅ Immutable attribute on
/etc/shutdown-schedule.conf - ✅ Canonical copy at
/usr/local/share/locked-shutdown-schedule.conf - ✅ Path watcher restores config if tampered
- ✅ Schedule protection blocks making schedule more lenient
- ✅ Unlock script with psychological delay
VULNERABILITIES IDENTIFIED:
- ❌ The unlock script explicitly tells users how to bypass: "sudo /usr/local/sbin/unlock-shutdown-schedule"
- ❌ The schedule change logic is communicated in the error message
- ❌ No protection against stopping/disabling the timer services
- ❌ No protection against modifying the check script at
/usr/local/bin/day-specific-shutdown-check.sh
3. Screen Locker (Python - External Repo)
File: /home/kuhy/testsAndMisc/python_pkg/screen_locker/screen_lock.py
Current Workout Types:
- Running - distance, time, pace validation
- Strength - exercises, sets, reps, weights, total calculation
- Table Tennis - duration, sets, points won/lost
VULNERABILITIES IDENTIFIED:
- ❌ Running option too easy to fake - just enter plausible numbers
- ❌ Table Tennis lacks real verification - no mathematical cross-check
- ❌ Users can close the window via keyboard shortcuts (Alt+F4, etc.)
- ❌ The unlock mechanism is too simple once you know the forms
- ❌ Shutdown time adjustment is a REWARD for working out (can be exploited)
4. Pacman Wrapper
Files involved:
- periodic_background/digital_wellbeing/pacman/pacman_wrapper.sh (823 lines)
- periodic_background/digital_wellbeing/pacman/pacman_blocked_keywords.txt
- periodic_background/digital_wellbeing/pacman/install_pacman_wrapper.sh
Current Protection:
- ✅ Policy file integrity verification (SHA256)
- ✅ Blocked keywords list
- ✅ Greylist with challenge
- ✅ VirtualBox hardcoded check (cannot bypass via policy files)
- ✅ Steam weekend-only restriction
VULNERABILITIES IDENTIFIED:
- ❌ Google Chrome not blocked -
google-chromeandgoogle-chrome-stablemissing from blocked list - ❌ No automatic LeechBlock installation when browsers are detected
- ❌ User can download
.deb/.tar.gzand install manually
5. Block Compulsive Opening
File: periodic_background/digital_wellbeing/block_compulsive_opening.sh (507 lines)
Current Behavior:
- Records first open per hour in state file
- Blocks subsequent launches within same hour
- Shows notification when blocked
CRITICAL VULNERABILITY:
- ❌ App stays running indefinitely - User can:
- Open app once per hour (allowed)
- Minimize/hide the window
- Keep it running forever in background
- Compulsive checking still happens, just via Alt+Tab instead of launcher
6. YouTube Music Wrapper
File: periodic_background/digital_wellbeing/youtube-music-wrapper.sh
Current Behavior:
- Checks if focus apps (VSCode, games, etc.) are running
- Blocks YouTube Music launch if focus app detected
REQUESTED ENHANCEMENT:
- When Steam is open → Block ALL browsers, close any open browsers
- When browsers open → Block Steam, close Steam if running
- This creates mutual exclusion between gaming and browsing