scanslave -- invoke scanhosts on a scanning node
scanslave [-Hh] [-A authmode] [-d dir] [-n N] [-p post] [-r remote] scan chunkfile [-- scanhost-args]
The scanslave utility is part of the “scanmaster” suite of scripts. It represents the portion of the process that runs on each scanning node and invokes scanhosts(1) . It takes as input the name of a scan and the socalled chunkfile containing the subset of hosts this scanning node should work on.
scanslave supports the following command-line options:
It furthermore takes two mandatory arguments:
Any additional arguments are passed on to scanhosts(1) . However, since scanslave already uses the following flags, they should not be provided as this may lead to undefined results: -n, -f, -o, -s, -p, -r.
Upon invocation, scanslave sets a few variables based on the environment (see below). It then starts an ssh-agent(1) and invokes ssh-add(1) , passing the value of the environment variable SSH_ADD_FLAGS. Next, it creates the output directories in the preferably shared location, adds a crontab entry for tkill(1) and eventually kicks off scanhosts(1) via autopw(1) . When the scanhosts process has terminated, the ssh-agent is killed and the crontab entries removed.
The following examples illustrate common usage of this tool.
To run a scan named “scan1", reading a list of hosts to scan from the file “/tmp/input.list” with the script “remote.sh” from the current working directory to be executed and the script “../post.chunk.sh” used as a per-chunk post script:
scanslave -r ./remote.sh -p ../post.chunk.sh \ scan1 /tmp/input.list
To run the same scan but pass the flags “-I” and “-S” to scanhosts(1) (which is useful when connecting to hosts that are reached via a tunnel, such as vault hosts):
scanslave -r ./remote.sh -p ../post.chunk.sh \ scan1 /tmp/input.list -- -I -S
scanslave honors the following environment variables:
SSH_ADD_FLAGS Flags to be passed to ssh-add(1) . This allows the user to specify custom keys to be added.
autopw(1) , checkhosts(1) , scanhosts(1) , ssh-agent(1) , ssh-add(1) , tkill(1)
The scanslave utility was originally written by Jan Schaumann <firstname.lastname@example.org> in July 2007 as “cmd.chunk".
Please report bugs and feature requests to the author.
Table of Contents