Shellfirm includes a set of 'Base Checks' designed to identify and prevent the execution of highly destructive or system-altering shell commands. These checks act as a safety layer against common patterns that can lead to resource exhaustion, accidental data loss, or unexpected system state changes.
Key patterns covered by Base Checks include:
- Fork Bombs: Detecting recursive function definitions that replicate processes to exhaust CPU and memory (e.g.,
:(){ :|: & };:). - History Execution: Detecting attempts to pipe the entire command history directly into a shell (e.g.,
history | bash). - Task Removal: Detecting commands that wipe scheduled tasks (e.g.,
crontab -r). - System Power Commands: Detecting commands that trigger reboots or shutdowns (e.g.,
reboot, shutdown).