To understand this document

This document assumes you have an have an understanding of the standard UNIX™ shell and some idea of how a network service works.

What is recvmux?

The recvmux manual page explains that it receives a stream sent via tcpmux and stores it away in a file based on the peer and do contents of the dead-drop itself.

Basic examples

To setup a stoage service like mine:
Build a mortal login "storage"

Give it a group via local site policy. Mine is in the sample group, so that it can share files with the other samplers without world read permissions.

Add the service to the inetd (aka tcpmux) configuration

My configuration for inetd.conf looks like

tcpmux/storage stream tcp nowait storage:sample /usr/local/libexec/recvmux recvmux
That drops all the incoming files into ~storage, which is not usually a problem.
Send a text payload

In a scratch file create a dummy payload:

$ vi /tmp/$USER.dummy
	# $Which: echo 'localhost.example.gg' $$
	Mock payload
$ muxsend -f /tmp/$USER.dummy localhost storage
Check the spool directory for the test file

Just page the file:

$ less ~storage/localhost.example.gg
# $Which: echo 'localhost.example.gg' $$
Mock payload
Remove the test file

Use sudo or op to become the storage login to remove the file (or use a root shell):

$ sudo -u storage rm ~storage/localhost.exampe.gg
You are good to go
The rest is a matter of building a script to collect the data you need from each host, running that script from cron or kicker (see that HTML document).

How to turn off the service

Remove the line from inetd.conf or tcpmux.conf, or disable the service in the file under xinetd.d.

There is another way to manage the service

If you are running the ksb version of tcpmux you may chain the configuration for a mortal user to a configuration file that login owns:
<sample stream tcp nowait sample:sample /home/sample/.muxconf tcpmux
In the /home/sample/.muxconf file we provide the service: for the sender:
storage stream tcp nowait * /usr/local/libexec/recvmux recvmux -Dstorage
Note that this renames the service to "sample storage", so the sending script must target:
muxsend -f payload localhost sample storage

This has the benefit that additional samplers may be installed without superuser access (under the sample account). It also forces a directory structure for each sample type.

Be sure to mkdir the directories for each new sampler. And be sure to reload inetd.

See also

See the muxsend HTML document.
$Id: recvmux.html,v 1.1 2012/08/20 23:17:27 ksb Exp $