远程访问

Radare can be run locally, or it can be started as a server process which is controlled by a local radare2 process. This is possible because everything uses radare's IO subsystem which abstracts access to system(), cmd() and all basic IO operations so to work over a network.

Help for commands useful for remote access to radare:

[0x00405a04]> =?
|Usage:  =[:!+-=hH] [...] # radare remote command execution protocol
|
rap commands:
| =           list all open connections
| =<[fd] cmd  send output of local command to remote fd
| =[fd] cmd   exec cmd at remote 'fd' (last open is default one)
| =! cmd      run command via r_io_system
| =+ [proto://]host  add host (default=rap://, tcp://, udp://)
| =-[fd]      remove all hosts or host 'fd'
| ==[fd]      open remote session with host 'fd', 'q' to quit
| =!=         disable remote cmd mode
| !=!         enable remote cmd mode
|
rap server:
| =:port      listen on given port using rap protocol (o rap://9999)
| =&:port     start rap server in background
| =:host:port run 'cmd' command on remote server
|
other servers:
| =h[?]       listen for http connections
| =g[?]       using gdbserver

You can learn radare2 remote capabilities by displaying the list of supported IO plugins: radare2 -L.

A little example should make this clearer. A typical remote session might look like this:

At the remote host1:

At the remote host2:

At localhost:

Add hosts

You can open remote files in debug mode (or using any IO plugin) specifying URI when adding hosts:

To execute commands on host1:

To open a session with host2:

To remove hosts (and close connections):

You can also redirect radare output to a TCP or UDP server (such as nc -l). First, Add the server with '=+ tcp://' or '=+ udp://', then you can redirect the output of a command to be sent to the server:

The =< command will send the output from the execution of cmd to the remote connection number N (or the last one used if no id specified).

最后更新于

这有帮助吗?