---
- test: ':(){ :|:& };:'
description: "match fork bomb command"
expect_ids: ["base:bash_fork_bomb"]
- test: ':(){ echo hello; };:'
description: "similar syntax but not a fork bomb"
expect_ids: []
- test: "crontab -r"
description: "match command"
expect_ids: ["base:delete_all_cron_tasks"]
- test: "crontab -r"
description: "match command with multiple spaces"
expect_ids: ["base:delete_all_cron_tasks"]
- test: " crontab -r"
description: "match command with multiple spaces"
expect_ids: ["base:delete_all_cron_tasks"]
- test: "crontab-r"
description: "invalid command"
expect_ids: []
- test: "history | bash"
description: "match command that end with bash"
expect_ids: ["base:execute_all_history_commands"]
- test: "history | sh"
description: "match command that end with sh"
expect_ids: ["base:execute_all_history_commands"]
- test: "history | sh"
description: "match command with multiple spaces"
expect_ids: ["base:execute_all_history_commands"]
- test: "history | grep -v | bash"
description: "match command"
expect_ids: ["base:execute_all_history_commands"]
- test: "history|bash"
description: "match command without spaces"
expect_ids: ["base:execute_all_history_commands"]
- test: "history | shh"
description: "not end with sh"
expect_ids: []
- test: "history | bashh"
description: "not end with bash"
expect_ids: []
- test: "reboot"
description: "match command"
expect_ids: ["base:reboot_machine"]
- test: "reboot -r"
description: "match command with flag"
expect_ids: ["base:reboot_machine"]
- test: "reboot -r now"
description: "match command with flag value"
expect_ids: ["base:reboot_machine"]
- test: "reboot -r now"
description: "match command with spaces"
expect_ids: ["base:reboot_machine"]
- test: "reboot"
description: "match command with spaces"
expect_ids: ["base:reboot_machine"]
- test: "reboot now -r"
description: "match command with flag value"
expect_ids: ["base:reboot_machine"]
- test: "reboott"
description: "not match"
expect_ids: []
- test: "shutdown"
description: "match command"
expect_ids: ["base:shutdown_machine", "redis:interactive_shutdown"]
- test: "shutdown -r"
description: "match command with flag"
expect_ids: ["base:shutdown_machine"]
- test: "shutdown -r now"
description: "match command with flag value"
expect_ids: ["base:shutdown_machine"]
- test: "shutdown -r now"
description: "match command with spaces"
expect_ids: ["base:shutdown_machine"]
- test: "shutdown now -r"
description: "match command with spaces"
expect_ids: ["base:shutdown_machine"]
- test: "shutdown"
description: "match command with spaces"
expect_ids: ["base:shutdown_machine", "redis:interactive_shutdown"]
- test: "shutdownn"
description: "not match"
expect_ids: []
- test: "kill -9 1234"
description: "match kill -9 with PID"
expect_ids: ["process:kill_9"]
- test: "kill -9 $(pgrep nginx)"
description: "match kill -9 with command substitution"
expect_ids: ["process:kill_9"]
- test: "kill 1234"
description: "negative: regular kill should not match"
expect_ids: []
- test: "kill -15 1234"
description: "negative: SIGTERM should not match"
expect_ids: []
- test: "killall nginx"
description: "match killall with process name"
expect_ids: ["process:killall"]
- test: "killall -9 node"
description: "match killall with signal"
expect_ids: ["process:killall"]
- test: "kill 1234"
description: "negative: kill single process should not match killall"
expect_ids: []
- test: "pkill nginx"
description: "match pkill with pattern"
expect_ids: ["process:pkill"]
- test: "pkill -f 'node server.js'"
description: "match pkill with full command match"
expect_ids: ["process:pkill"]
- test: "pgrep nginx"
description: "negative: pgrep should not match pkill"
expect_ids: []
- test: "systemctl disable nginx"
description: "match systemctl disable"
expect_ids: ["systemd:disable_service"]
- test: "systemctl mask docker"
description: "match systemctl mask"
expect_ids: ["systemd:disable_service"]
- test: "systemctl enable nginx"
description: "enable is not a disable, but starts the service at every boot (Low)"
expect_ids: ["base:systemctl_enable"]
- test: "systemctl start nginx"
description: "negative: start should not match"
expect_ids: []
- test: "systemctl stop docker"
description: "match stopping docker"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop sshd"
description: "match stopping sshd"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop nginx"
description: "match stopping nginx"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop postgresql"
description: "match stopping postgresql"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop mysql"
description: "match stopping mysql"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop redis"
description: "match stopping redis"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop myapp"
description: "negative: stopping non-critical service should not match"
expect_ids: []
- test: "systemctl restart nginx"
description: "negative: restart should not match stop check"
expect_ids: []
- test: "ssh-add -D"
description: "match ssh-add -D"
expect_ids: ["ssh:delete_all_identities"]
- test: "ssh-add -l"
description: "negative: list identities should not match"
expect_ids: []
- test: "ssh-keygen -R example.com"
description: "match removing known host"
expect_ids: ["ssh:remove_known_host"]
- test: "ssh-keygen -R 192.168.1.1"
description: "match removing known host by IP"
expect_ids: ["ssh:remove_known_host"]
- test: "ssh-keygen -t rsa"
description: "negative: generating key should not match"
expect_ids: []
- test: "halt"
description: "match halt command"
expect_ids: ["base:poweroff_machine"]
- test: "poweroff"
description: "match poweroff command"
expect_ids: ["base:poweroff_machine"]
- test: "halt -f"
description: "match halt with flag"
expect_ids: ["base:poweroff_machine"]
- test: "poweroff -f"
description: "match poweroff with flag"
expect_ids: ["base:poweroff_machine"]
- test: "halting"
description: "negative: word starting with halt should not match"
expect_ids: []
- test: "powerofff"
description: "negative: misspelled poweroff should not match"
expect_ids: []
- test: "init 0"
description: "match init 0 (shutdown)"
expect_ids: ["base:init_shutdown_reboot"]
- test: "init 6"
description: "match init 6 (reboot)"
expect_ids: ["base:init_shutdown_reboot"]
- test: "init 0"
description: "match init 0 with extra spaces"
expect_ids: ["base:init_shutdown_reboot"]
- test: "init 1"
description: "negative: init 1 (single user) should not match"
expect_ids: []
- test: "init 3"
description: "negative: init 3 (multi-user) should not match"
expect_ids: []
- test: "sudo reboot"
description: "EDGE: sudo reboot"
expect_ids: ["base:reboot_machine"]
- test: "myreboot"
description: "negative: substring should not match - reboot requires word boundary"
expect_ids: []
- test: "sudo shutdown -h now"
description: "EDGE: sudo shutdown with flags"
expect_ids: ["base:shutdown_machine"]
- test: "myshutdown"
description: "negative: substring should not match - shutdown requires word boundary"
expect_ids: []
- test: "systemctl stop docker.service"
description: "match stopping docker with .service suffix"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop redis-server"
description: "match stopping redis-server variant"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop postgresql-14"
description: "match stopping postgresql with version suffix"
expect_ids: ["systemd:stop_critical_service"]
- test: "sudo crontab -r"
description: "EDGE: sudo prefix"
expect_ids: ["base:delete_all_cron_tasks"]
- test: "crontab -l"
description: "EDGE: list should not match"
expect_ids: []
- test: "kill -9 1"
description: "SIGKILL to init"
expect_ids: ["process:kill_init_or_all", "process:kill_9"]
- test: "kill -9 -1"
description: "SIGKILL to every process"
expect_ids: ["process:kill_init_or_all", "process:kill_9"]
- test: "kill -s KILL 1"
description: "signal by name"
expect_ids: ["process:kill_init_or_all"]
- test: "kill -- -1"
description: "-- separator"
expect_ids: ["process:kill_init_or_all"]
- test: "kill -9 1234"
description: "negative: an ordinary pid"
expect_ids: ["process:kill_9"]
- test: "kill 12"
description: "negative: pid 12"
expect_ids: []
- test: "history -c"
description: "erases history"
expect_ids: ["base:clear_history"]
- test: "history -cw"
description: "clustered flags"
expect_ids: ["base:clear_history"]
- test: "history 20"
description: "negative: listing history"
expect_ids: []
- test: "history -s kubectl delete namespace prod"
description: "negative: history -s only stores text"
expect_ids: []
- test: "print -s git push -f origin main"
description: "negative: zsh print -s only stores text"
expect_ids: []
- test: 'userdel -r bob'
description: "delete user and home"
expect_ids: ["base:userdel_remove_home"]
- test: 'userdel bob'
description: "negative: keeps the home directory"
expect_ids: []
- test: 'passwd -d root'
description: "remove a password"
expect_ids: ["base:passwd_delete"]
- test: 'passwd bob'
description: "negative: change a password"
expect_ids: []
- test: "deluser --remove-home alice"
description: "Debian deluser with the home directory"
expect_ids: ["base:userdel_remove_home"]
- test: "deluser alice"
description: "deluser keeps the home directory"
expect_ids: []
- test: "echo o | sudo tee /proc/sysrq-trigger"
description: "power off through sysrq"
expect_ids: ["base:sysrq_trigger"]
- test: "crontab /tmp/cron"
description: "replacing the crontab with a file"
expect_ids: ["base:crontab_replace"]
- test: "crontab -"
description: "replacing the crontab from stdin"
expect_ids: ["base:crontab_replace"]
- test: "crontab -l"
description: "negative: listing"
expect_ids: []
- test: "crontab -e"
description: "negative: editing interactively"
expect_ids: []
- test: "systemctl --user enable x.service"
description: "a user service started at every login"
expect_ids: ["base:systemctl_enable"]
- test: "sudo systemctl enable --now nginx"
description: "a system service started at boot"
expect_ids: ["base:systemctl_enable"]
- test: "systemctl status nginx"
description: "negative: status"
expect_ids: []
- test: "sudo systemctl stop kubelet"
description: "stopping the kubelet"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl stop containerd"
description: "stopping the container runtime"
expect_ids: ["systemd:stop_critical_service"]
- test: "sudo service postgresql stop"
description: "the SysV service form"
expect_ids: ["systemd:stop_critical_service"]
- test: "systemctl status kubelet"
description: "negative: status"
expect_ids: []
- test: "sudo systemctl isolate rescue.target"
description: "single-user mode"
expect_ids: ["systemd:isolate_rescue"]
- test: "systemctl isolate graphical.target"
description: "negative: a normal target"
expect_ids: []
- test: "sudo passwd -l root"
description: "locking root"
expect_ids: ["base:lock_root_account"]
- test: "passwd -l alice"
description: "negative: another account"
expect_ids: []
- test: "sudo mount -o remount,ro /"
description: "root read-only"
expect_ids: ["base:remount_root_readonly"]
- test: "sudo mount -o remount,rw /"
description: "negative: read-write again"
expect_ids: []
- test: "journalctl --vacuum-time=1s"
description: "deleting the journal"
expect_ids: ["base:journal_vacuum"]
- test: "journalctl -u nginx --since today"
description: "negative: reading the journal"
expect_ids: []
- test: "systemctl rescue"
description: "the short form of isolate rescue.target"
expect_ids: ["systemd:isolate_rescue"]
- test: "sudo systemctl emergency"
description: "emergency mode"
expect_ids: ["systemd:isolate_rescue"]
- test: "systemctl status rescue.service"
description: "negative: a status query"
expect_ids: []
- test: "pkill_9 x"
description: "not kill"
expect_ids: []
- test: "vssadmin delete shadows /all /quiet"
description: "vssadmin delete shadows /all /quiet"
expect_ids: ["base:delete_shadow_copies"]
- test: "Set-MpPreference -DisableRealtimeMonitoring $true"
description: "Set-MpPreference -DisableRealtimeMonitoring $true"
expect_ids: ["base:disable_antivirus"]
- test: "Set-MpPreference -DisableRealtimeMonitoring:$true"
description: "colon form of DisableRealtimeMonitoring"
expect_ids: ["base:disable_antivirus"]
- test: "Set-MpPreference -DisableBehaviorMonitoring $true"
description: "disable behavior monitoring"
expect_ids: ["base:disable_antivirus"]
- test: "sc stop WinDefend"
description: "stop the Defender service"
expect_ids: ["base:disable_antivirus"]
- test: "sc.exe delete WinDefend"
description: "delete the Defender service"
expect_ids: ["base:disable_antivirus"]
- test: "MpCmdRun.exe -RemoveDefinitions -All"
description: "remove Defender definitions"
expect_ids: ["base:disable_antivirus"]
- test: "reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\" /v DisableAntiSpyware /t REG_DWORD /d 1 /f"
description: "DisableAntiSpyware registry key"
expect_ids: ["base:disable_antivirus"]
- test: "Get-MpComputerStatus"
description: "negative: reading Defender status"
expect_ids: []
- test: "vssadmin resize shadowstorage /for=C: /on=C: /maxsize=401MB"
description: "shrink shadow storage to drop copies"
expect_ids: ["base:delete_shadow_copies"]
- test: "bcdedit /set {default} recoveryenabled No"
description: "disable Windows recovery"
expect_ids: ["base:delete_shadow_copies"]
- test: "Get-WmiObject Win32_Shadowcopy | ForEach-Object { $_.Delete() }"
description: "WMI shadow copy delete"
expect_ids: ["base:delete_shadow_copies"]
- test: "Get-CimInstance Win32_Shadowcopy | Remove-CimInstance"
description: "CIM shadow copy delete"
expect_ids: ["base:delete_shadow_copies"]
- test: "wevtutil cl Security"
description: "clear the Security event log"
expect_ids: ["base:clear_event_logs"]
- test: "Clear-EventLog -LogName Application"
description: "Clear-EventLog"
expect_ids: ["base:clear_event_logs"]
- test: "wevtutil el"
description: "negative: listing event logs"
expect_ids: []
- test: "tmutil delete /Volumes/Backup/2026-01-01-000000"
description: "delete a Time Machine backup"
expect_ids: ["base:delete_backups_macos"]
- test: "tmutil deletelocalsnapshots /"
description: "delete local APFS snapshots"
expect_ids: ["base:delete_backups_macos"]
- test: "tmutil listbackups"
description: "negative: listing backups"
expect_ids: []
- test: "net stop WinDefend"
description: "stop Defender via net stop"
expect_ids: ["base:disable_antivirus"]
- test: "Stop-Service -Name WinDefend"
description: "Stop-Service Defender"
expect_ids: ["base:disable_antivirus"]
- test: "taskkill /F /IM MsMpEng.exe"
description: "kill the Defender engine process"
expect_ids: ["base:disable_antivirus"]
- test: "net stop spooler"
description: "negative: stopping an unrelated service"
expect_ids: []
- test: "Stop-Service nginx"
description: "negative: stopping an unrelated service"
expect_ids: []
- test: "csrutil disable"
description: "disabling macOS System Integrity Protection"
expect_ids: ["base:disable_macos_security"]
- test: "spctl --master-disable"
description: "disabling macOS Gatekeeper"
expect_ids: ["base:disable_macos_security"]
- test: "spctl --global-disable"
description: "disabling Gatekeeper (newer flag)"
expect_ids: ["base:disable_macos_security"]
- test: "Set-MpPreference -MAPSReporting Disabled"
description: "turning off Defender cloud reporting"
expect_ids: ["base:disable_antivirus"]
- test: "Stop-Service WinDefend"
description: "stopping Defender by bare service name"
expect_ids: ["base:disable_antivirus"]
- test: "csrutil status"
description: "negative: querying SIP status is read-only"
expect_ids: []
- test: "unset HISTFILE"
description: "unset HISTFILE"
expect_ids: ["base:disable_history"]
- test: "export HISTFILE=/dev/null"
description: "HISTFILE to /dev/null"
expect_ids: ["base:disable_history"]
- test: "set +o history"
description: "set +o history"
expect_ids: ["base:disable_history"]
- test: "HISTFILE=/dev/null"
description: "plain assignment"
expect_ids: ["base:disable_history"]
- test: "export HISTSIZE=0"
description: "history size zero"
expect_ids: ["base:disable_history"]
- test: "unset HISTFILE HISTSIZE"
description: "several names"
expect_ids: ["base:disable_history"]
- test: "export HISTSIZE=10000"
description: "negative: a larger history"
expect_ids: []
- test: "export HISTFILE=~/.zsh_history"
description: "negative: a history file path"
expect_ids: []
- test: "set -o history"
description: "negative: set -o history"
expect_ids: []
- test: "set -euo pipefail"
description: "negative: strict mode"
expect_ids: []
- test: "unset NODE_OPTIONS"
description: "negative: unset another variable"
expect_ids: []
- test: "shopt -u -o history"
description: "history option off"
expect_ids: ["base:disable_history"]
- test: "shopt -ou history"
description: "bundled -ou"
expect_ids: ["base:disable_history"]
- test: "shopt -s -o history"
description: "negative: history on"
expect_ids: []
- test: "shopt -u histappend"
description: "negative: another option"
expect_ids: []
- test: "rm -f ~/.bash_history"
description: "the bash history deleted"
expect_ids: ["base:clear_history_file", "fs-strict:any_deletion"]
- test: "rm ~/.zsh_history"
description: "the zsh history deleted"
expect_ids: ["base:clear_history_file", "fs-strict:any_deletion"]
- test: "> ~/.bash_history"
description: "emptied by a redirection"
expect_ids: ["base:clear_history_file", "fs:flush_file_content"]
- test: ": > ~/.zsh_history"
description: "emptied with :"
expect_ids: ["base:clear_history_file", "fs:flush_file_content"]
- test: "truncate -s0 ~/.zsh_history"
description: "truncated"
expect_ids: ["base:clear_history_file", "fs:truncate_zero"]
- test: "ln -sf /dev/null ~/.bash_history"
description: "pointed at /dev/null"
expect_ids: ["base:clear_history_file", "fs:clobber_with_dev_null"]
- test: "rm -f ./history.txt"
description: "negative: an ordinary file"
expect_ids: ["fs-strict:any_deletion"]
- test: "history | grep ssh"
description: "negative: reading history"
expect_ids: []
- test: "truncate -s 0 /var/log/auth.log"
description: "the login log emptied"
expect_ids: ["base:wipe_system_logs"]
- test: "sudo truncate -s 0 /var/log/*"
description: "every system log emptied"
expect_ids: ["base:wipe_system_logs", "fs:truncate_zero"]
- test: ": > /var/log/syslog"
description: "the syslog emptied"
expect_ids: ["base:wipe_system_logs", "fs:flush_file_content"]
- test: "cat /dev/null > /var/log/wtmp"
description: "the login records emptied"
expect_ids: ["base:wipe_system_logs", "fs:flush_file_content"]
- test: "truncate -s 0 app.log"
description: "negative: a project log"
expect_ids: []
- test: ": > ./build.log"
description: "negative: a build log"
expect_ids: []
- test: "tail -f /var/log/syslog"
description: "negative: reading the syslog"
expect_ids: []