the-binary - Command 3 - exec command and transmit results

Purpose:

This command causes the agent to execute a command on its host system and return any results via its transmission list (see description of command 2).

Format:

A handler sends the following command to have the agent execute an arbitrary command and transmit the results (xxx = don't care):
 
2 xxx xxx 3
null terminated command to execute
padding for a minimum packet size
of 201 bytes including the IP header
NOTE: the shaded bytes must be encoded prior to transmission to the agent.

Response:

Upon receipt of an exec command message, the agent will execute the specified command on the host system.  Any output from the command will be transmitted via the transmission list in the following format:

First 398 bytes of output for a given command:
3 xxx xxx
3
up to 398 bytes of command output
padding for a random packet
size of 400-600 bytes

Second and successive 398 bytes of output for a given command:
3 xxx xxx
4
up to 398 bytes of command output
padding for a random packet
size of 400-600 bytes
NOTE: The shaded fields are encoded by the agent and must be decoded by the handler.