rarun2
radare2 utility to run programs in exotic environments
- Provided by: radare2 (Version: 4.2.1+dfsg-2)
- Report a bug
radare2 utility to run programs in exotic environments
rarun2 |
[[directives]] [[script.rr2]] [[--] [program] [args]] |
This program is used as a launcher for running programs with different environment, arguments, permissions, directories and overridden default filedescriptors.
rarun2 -t will show the terminal name and wait for a connection from another process. try rarun2 stdio=<ttypath> program=/bin/sh
The program just accepts a single argument which is the filename of the configuration file to run the program.
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 :)
The rr2 (rarun2) configuration file accepts the following directives, described as key=value entries and comments defined as lines starting with '#'.
Every value in this configuration file can contain a special
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 in a more natural way:
$ rarun2 timeout=2 -- sleep 4
Run a library function
$ rarun2 runlib=/lib/libc-2.25.so runlib.fcn=system arg1="ls /"
radare2(1), rahash2(1), rafind2(1), rabin2(1), radiff2(1), ragg2(1), rasm2(1),
Written by pancake <pancake@nopcode.org>