Skip to content
Tasos Laskos edited this page Aug 6, 2014 · 24 revisions

Home

This page will go through the protocol data units and their trasnmission.

(If you are looking for how to communicate with Arachni please see the RPC API page on Arachni's wiki, this document only focuses on the RPC protocol.)

The basic PDU is an RPC Message which can either be a Request or a Response.
Each message is formatted as a Hash data structure and transmitted in serialized form -- the serialization type is up to the implementation.

Request messages contain the following key-value pairs:

  • message -- RPC message in the form of handler.method.
  • args -- Array of arguments for the remote method or empty array if the method expects no arguments.
  • token -- Optional authentication token to be verified by the server implementation.

Response messages contain the following key-value pairs:

  • obj -- The return value of the Request.
  • exception -- Used to denote a server-side error and is a Hash containing:
    • type -- Exception type, basically a Ruby class name as a string.
    • message -- Assotiated message.
    • backtrace -- Array of String objects.

Flow

The flow is very simple:

  • Client -- Initiates connection to server.
  • Server -- Accepts connection.
  • Client -- Sends RPC request.
  • Server -- Recieves RPC request, sends RPC response.
  • Client -- Receives RPC response.

The Server will keep the connection alive so that it can be re-used, however the Client is free to close it if it so chooses.

Reference implementation

For a reference implementation of a client, please see the Arachni-RPC Pure repository.

Clone this wiki locally