RZ-RUN(1)

πŸ“¦
version 0.8.2 Β· 2 versions
, in arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05

πŸ’– RZ-RUN(1) πŸ’–

okay bestie, gather round, because this is the rz-run manual page from section 1 of the manual, and it's literally the little launcher goblin that makes your programs run in whatever weird lil environment you dream up. it's giving "personal assistant for processes" and honestly? iconic. ✨


✨ NAME ✨

rz-run β€” rizin utility to run programs in custom environments πŸŽ€


🌸 SYNOPSIS 🌸

rz-run [[directives]] [[script.rz]] [[--] [program] [args]]

πŸ’… DESCRIPTION πŸ’…

okay so first thing you need to know: this command is part of the Rizin project. 🫢

This program is used as a launcher for running programs with different environment, arguments, permissions, directories and overridden default filedescriptors. no cap, that's the whole job description.

  • -l β€” List all the supported profile options. window shopping, but for profiles πŸ›οΈ
  • -t β€” Output a base template profile. Try rz-run -d > profile.rz β€” it's a starter pack, we love a template πŸ‘‘
  • -w β€” Show the terminal name and wait for a connection from another process. Try rz-run stdio=<ttypath> program=/bin/sh β€” it just sits there, patiently waiting for its bestie to show up πŸ¦‹

The program just accepts a single argument which is the filename of the configuration file to run the program. one arg. that's it. minimalism, periodt.

It is useful when you have to run a program using long arguments or pass long data to stdin or things like that usually required for exploiting crackmes :) β€” yes bestie, this is the crackme exploitation support group and you're welcome here πŸ’€


🌈 DIRECTIVES 🌈

The rrz (rz-run) configuration file accepts the following directives, described as key=value entries and comments defined as lines starting with #. so basically it's a vibe file and every line is a little instruction. slay.

  • arg[0-511] β€” Set value for argument N passed to the program πŸ“
  • aslr β€” Enable or disable ASLR
  • bits β€” Set 32 or 64 bit (if the architecture supports it)
  • chdir β€” Change directory before executing the program
  • chroot β€” Run the program in chroot. requires some previous setup ⚠️ (it needs the whole setup done first, don't skip ahead bestie)
  • core β€” Set no limit the core file size
  • connect β€” Connect stdin/stdout/stderr to a socket
  • pty β€” Use a pty for connection over socket (with connect/listen)
  • envfile β€” Set a file with lines like var=value to be used as env
  • fork β€” Used with the listen option, allow to spawn a different process for each connection. Ignored when debugging.
  • input β€” Set string to be passed to the program via stdin
  • libpath β€” Override path where the dynamic loader will look for shared libraries
  • listen β€” Bound stdin/stdout/stderr to a listening socket
  • maxstack β€” Set the maximum size for the stack
  • maxproc β€” Set the maximum number of processes
  • maxfd β€” Set the maximum number of file descriptors
  • nice β€” Set the niceness level of the process (be nice! or don't, that's the setting πŸ’…)
  • preload β€” Preload a library (not supported on Windows, only linux,osx,bsd)
  • daemon β€” Set to false by default, otherwise it will run the program in background, detached from the terminal. main character energy, leaving the terminal behind πŸšͺ
  • program β€” Path to program to be executed
  • pid β€” Set to true to print the PID of the process to stderr
  • pidfile β€” Print the PID of the process to the specified file
  • runlib β€” Path to the library to be executed
  • runlib.fcn β€” Function name to call from runlib library
  • rzpreload β€” Preload with librz, kill -USR1 to get an rizin shell or -USRZ to spawn a webserver in a thread
  • setenv β€” Set value for given environment variable
  • setegid β€” Set effective process group id
  • seteuid β€” Set effective process uid
  • setgid β€” Set process group id
  • setuid β€” Set process uid
  • sleep β€” Sleep for the given amount of seconds 😴
  • stdio=value β€” Set io streams (stdin, stdout, stderr) to a value
  • stdio=!cmd β€” Redirect input/output to the process created by the specified command
  • stdin β€” Set stdin, stdout, and stderr streams to the specified value
  • stdout β€” Select file to replace stdout file descriptor
  • stderr β€” Select file to replace stderr file descriptor
  • system β€” Execute the given command
  • timeout β€” Set a timeout ⏰
  • timeoutsig β€” Signal to use when killing the child because the timeout happens
  • unsetenv β€” Unset one environment variable

🧚 VALUE PREFIXES 🧚

Every value in this configuration file can contain a special prefix, and these are the little magic spells you can put in front of a value. iykyk ✨

  • @filename β€” Slurp contents of file and put them inside the key
  • text β€” Escape characters useful for hex chars
  • 'string' β€” Escape characters useful for hex chars
  • !cmd β€” Run command to store the output in the variable
  • :102030 β€” Parse hexpair string and store it in the variable
  • :!cmd β€” Parse hexpair string from output of command and store it in the variable
  • %1234 β€” Parses the input string and returns it as integer

πŸ”₯ EXAMPLES πŸ”₯

Sample rz-run script πŸŽ€

$ cat foo.rrz
#!/usr/bin/rz-run
program=./pp400
arg0=10
stdin=foo.txt
chdir=/tmp
clearenv=true
setenv=EGG=eggsy
setenv=NOFUN=nogames
unsetenv=NOFUN
# EGG will be the only env variable
#chroot=.
./foo.rrz

Connecting a program to a socket 🌐

nc -l 9999
rz-run program=/bin/ls connect=localhost:9999

Debugging a program redirecting io to another terminal πŸ–₯️

## open a new terminal and type 'tty' to get
$ tty ; clear ; sleep 999999
/dev/ttyS010
## in another terminal run rizin
$ rizin -r foo.rrz -d ls
$ cat foo.rrz
#!/usr/bin/rz-run
stdio=/dev/ttys010
## Or you can use -R to set a key=value
rizin -R stdio=/dev/ttys010 -d ls

You can also use the -- flag to specify program and arguments in a more natural way:

rz-run timeout=2 -- sleep 4

Run a library function 🧠

rz-run runlib=/lib/libc-2.25.so runlib.fcn=system arg1="ls /"

πŸ‘‘ SEE ALSO πŸ‘‘

rizin(1), rz-hash(1), rz-find(1), rz-bin(1), rz-diff(1), rz-gg(1), rz-asm(1),

go read the whole friend group, they're all icons πŸ’œ


πŸ’– AUTHORS πŸ’–

pancake <pancake@nopcode.org>

byteninjaa0


and that's the whole page bestie!! this was the rz-run page from the Rizin project, dated Jan 24, 2024, and yes it really is called RZ_RUN(1) down at the bottom. no notes. slay. πŸ’…βœ¨πŸŒΈ
πŸ“¦ where this page comes from
  • arch rolling: rizin 0.8.2-2 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC-PDDC AND CC0-1.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-3.0-only AND MIT
  • epel 10: rizin 0.7.4-5.el10_1 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • epel 9: rizin 0.7.4-5.el9 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • fedora 43: rizin 0.7.4-9.fc43 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • fedora 43: rizin 0.7.4-9.fc43 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • fedora 44: rizin 0.7.4-9.fc43 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • fedora 44: rizin 0.7.4-9.fc43 Β· LGPL-3.0-or-later AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Apache-2.0 AND MPL-2.0 AND Zlib
  • nixos 26.05: rizin 0.8.2
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms