Multi-threaded Command multiplexer for SSH wich features shell commands forwarder ( with verbose output ), connection-only mode and csv reports.
Installing required modules
pip3 install -r requirements.txt
Make the script executable ( waiting for an installer :P )
chmod +x swarm.py
...and start the script and dive into the arguments :)
./swarm.py --help
Swarm can be use mainly for two tasks:
- Checking the SSH connectivity of remote(s) host(s)
- Forward a shell command trought ssh to remote(s) host(s)
There are, despite of your scope, some arguments that are required.
-i, --ips: Targets IPs for the swarm to connect to. IPs can be specified in comma-separeted format within the command line or can be specified a file with an ip on evely line.
./swarm.py --ips 192.168.0.2,192.168.0.3
./swarm.py --ips ip_list.txt
-u, --ssh-user: Username used to connect to remote(s) host(s).
-p, --ssh-password: Password used to connect to remote(s) host(s).
To only check if a remote ssh connection can be made the swarm arguments are these
./swarm.py --ips 192.168.0.2,192.168.0.3 -u username -p password --connect-only --verbose
To forward a shell command to remote(s) host(s)
./swarm.py --ips 192.168.0.2,192.168.0.3 -u username -p password --cmd "uname -a" -v
This command will connect to remote host(s) and forwardthe command specified with the --cmd parameter.
./swarm.py --ips ip_list.txt --cmd "uname -a" --threads 20
Change the default multithread limit ( Default: 4 ) to customize the speed.
Tip: Avoid thread > ~200 this will break the ulimit.
./swarm.py --ips ip_list.txt --cmd "uname -a" -o report
Creates a report of the swarm action. The output will be a csv file named: <name_specified>.swarm.csv and will have a record for every remote host the swarm connects to.
- Clone repo and create a new branch:
$ git checkout https://github.com/misfotto/swarm -b name_for_new_branch
. - Make changes and test
- Submit Pull Request with comprehensive description of changes