RARUN2(1)
β¨ RARUN2 β the radare2 utility that runs your programs in exotic environments π
okay bestie, welcome to rarun2(1), and honestly? she's a baddie. This is the page for rarun2, the radare2 utility whose whole thing is running programs in ~exotic~ environments. Custom envs, custom args, custom permissions, custom working directories, redirected file descriptors β she does it all and she does it cute. π¦
πΈ SYNOPSIS πΈ
rarun2 [-vt] [directives ...] [script.rr2] [Fl- program args ...]
π DESCRIPTION π
She's a launcher. A launcher for executing programs with custom environments, arguments, permissions, working directories, and redirected file descriptors. Lowkey the whole toolkit in one tiny binary.
She supports inline directive arguments, script files, or program specifications after the -- separator. Pick your fighter.
Ideal for simplifying complex command lines, preparing specialized environments, and automating testing or exploitation scenarios. It's giving "I made this because typing 40 flags by hand was NOT the vibe." π
π OPTIONS π
-vβ Show version. Iconic, brief, slays.-tβ Show terminal name. Like, which terminal are we even in, bestie?--β Use remaining arguments as program and program arguments. Everything after this is the program's business, not ours. Periodt.
π DIRECTIVES π
The rr2 (rarun2) configuration file accepts the following directives, described as key=value entries, and comments defined as lines starting with #. Yes, comments. Live a little. π
program=β Path to program to be executed.arg0=..argN=β Set values for arguments passed to the program. Zero-indexed, bestie,arg0is the first one.aslr=β Enable or disable ASLR (yes|no).bits=β Set 32 or 64 bit (if the architecture supports it). Only if the arch is cool with it, obviously.chdir=β Change directory before executing the program.chroot=β Run the program in chroot (requires some previous setup). Do your homework first, she's not doing it for you.clearenv=β Unset the whole environment (true|false).connect=β Connect stdin/stdout/stderr to a socket (host:port).core=β Set no limit to the core file size (true|false).daemon=β Run in background, detached from terminal (default:false). Main character energy, zero tty.envfile=β Set a file with lines likevar=valueto be used as env.execve=β Useexecveinstead ofposix_spawn(osx tricks). πfork=β Allow spawning different process for each connection withlisten.input=β Set string to be passed to the program via stdin.libpath=β Override path where the dynamic loader looks for shared libraries.listen=β Bind stdin/stdout/stderr to a listening socket (port).maxfd=β Set the maximum number of file descriptors.maxproc=β Set the maximum number of processes.maxstack=β Set the maximum size for the stack.nice=β Set the niceness level of the process. Be nice. Or don't, your call.pid=β Set process pid.pidfile=β Write pid to a file.preload=β Preload a library (not supported on Windows, only linux, osx, bsd). Windows girlies, sit this one out. πpty=β Use a pty for connection over socket (true|false).r2preload=β Preload with libr2,kill -USR1for r2 shell,-USR2for webserver.r2preweb=β Run webserver in a thread at start withr2preload.runlib=β Path to the library to be executed.runlib.fcn=β Function name to call fromrunliblibrary.setegid=β Set effective process group id.seteuid=β Set effective process uid.setenv=β Set value for given environment variable (NAME=VALUE).setgid=β Set process group id.setuid=β Set process uid.sleep=β Sleep for the given amount of seconds before execution. Self-care. π§stderrout=β Redirect stderr file descriptor to stdout (true|false).stdio=β Select file or terminal for stdout/stderr/stdin.stdin=β Select file to read data from stdin.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 in seconds.timeoutsig=β Signal to use when killing child on timeout (SIGTERM). The default is right there, she's polite about it.times=β Print runtime in milliseconds to stderr (true|false).unsetenv=β Unset one environment variable.
π VALUE PREFIXES π
Every value in this configuration file can contain a special prefix. Yes bestie, every single one. The glow-up is real:
@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.@300@ABCDβ 300 characters filled withABCDpattern. The chaos, the artistry. π₯
π«Ά ENVIRONMENT π«Ά
RARUN2_ARGSβ Useful to runrarun2but parse arguments from environment var. Sneaky. Love that for her.
π EXAMPLES π
Sample rarun2 script:
$ cat foo.rr2
#!/usr/bin/rarun2
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.rr2
Connecting a program to a socket:
$ nc -l 9999
$ rarun2 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 r2
$ r2 -r foo.rr2 -d ls
$ cat foo.rr2
#!/usr/bin/rarun2
stdio=/dev/ttys010
## Or you can use -R to set a key=value
r2 -R stdio=/dev/ttys010 -d ls
You can also use the -- flag to specify program and arguments:
$ rarun2 timeout=2 -- sleep 4
Run a library function:
$ rarun2 runlib=/lib/libc-2.25.so runlib.fcn=system arg1="ls /"
π SEE ALSO π
π AUTHORS π
Written by pancake <pancake@nopcode.org>. Stan a legend. π
okay that's the whole page bestie, no notes. This RARUN2(1) manual is dated Jul 10, 2025 β go run something in a weird environment, you've earned it. slay, stay hydrated, and remember: it's not a hack, it's a custom environment. π
β¨πΈ
π¦ where this page comes from
- alpine 3.24: radare2-doc 6.1.6-r0 Β· GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: radare2 6.2.2-1 Β· GPL-3.0-only AND LGPL-3.0-only
- nixos 26.05: radare2 6.1.8
- nixpkgs unstable: radare2 6.2.4
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- ubuntu resolute: radare2 6.0.7+ds-1 Β· LGPL-3.0-only
- ubuntu stonking: radare2 6.1.8+ds-1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms