RARUN2(1)

πŸ“¦
version 6.2.2 Β· 3 versions
, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

✨ 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, arg0 is 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 like var=value to be used as env.
  • execve= β€” Use execve instead of posix_spawn (osx tricks). 🍎
  • fork= β€” Allow spawning different process for each connection with listen.
  • 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 -USR1 for r2 shell, -USR2 for webserver.
  • r2preweb= β€” Run webserver in a thread at start with r2preload.
  • runlib= β€” Path to the library to be executed.
  • runlib.fcn= β€” Function name to call from runlib library.
  • 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 with ABCD pattern. The chaos, the artistry. πŸ”₯

🫢 ENVIRONMENT 🫢

  • RARUN2_ARGS β€” Useful to run rarun2 but 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