crbin (Clearly Random Binary) is a small utility that executes a randomly
chosen executable file from a configurable set of directories. The program
randomly chooses a binary from default or provided directories and
simply invokes theselected binary with any arguments passed to crbin.
On each invocation, crbin:
- Scans one or more filesystem directories for executable regular files.
- Chooses one random binary entry.
- Executes the chosen path.
crbin [arguments...]
By default, the following directories are scanned:
/bin
/usr/bin
/usr/local/bin
/sbin
/usr/sbin
/usr/local/sbin
Scanning is non-recursive unless explicitly enabled.
Overrides the default directory list. Value must be a comma-separated list of absolute paths.
Example:
export BINDIRECTORIES="/bin,/usr/bin,/home/user/tools"
Controls recursive traversal.
RECURSE=1 enable recursion
RECURSE=unset disable recursion (default)
Example:
export RECURSE=1
All arguments provided to crbin are forwarded unchanged to the randomly
chosen executable.
Example:
crbin --version
The executed binary receives --version regardless of whether it supports it.
A C compiler such as GCC or Clang is required.
gcc crbin.c -o crbin
System-wide installation:
sudo install -m 755 crbin /usr/local/bin/crbin
User-local installation:
install -m 755 crbin "$HOME/.local/bin/crbin"
Examples:
crbin
crbin --help
crbin -rf /
BINDIRECTORIES="/bin" crbin
RECURSE=1 crbin
crbin intentionally implements no protection against executing programs that
may modify system state, terminate the current session, or affect running
processes. Running crbin as root or via sudo is strongly unrecommended.
crbin is licensed under the GNU General Public License v3.0 or (at your
option) any later version. See the source header for complete terms.