Thursday, April 12, 2012

Running programs on remote machines via ssh

We wanted to run our botloader program simultaneously on 7 machines, all attacking a single host. The idea was to recreate a large-scale flash event: the FIFA 1998 world cup semi-final. We needed 70,000 users, so each of the 7 machines would have to generate traffic from 10,000 hosts. We used botloader for that, but synchronising them all using a script proved hard to achieve.

The trick is to set up passwordless login as root from one master machine to all the machines participating in the attack. Then on the master machine we used rsync to synchronise the configuration file for botloader on each attacker with the copy on the master. Finally we ssh login to each attacker and issue the botloader command:


Putting the command at the end executes it remotely. You have to redirect the output or you won't get any error messages: the ssh session will hang as it tries to return the output to your local terminal. So you have to redirect stdin, stdout and stderr, and also background the process (that's the & at the end). The "nohup" ensures that the invocation of the command persists after you logout.

No comments:

Post a Comment