This is a really interesting paper from MIT that describes how a worm could spread over SSH.

[1]SSH Worm

Enjoy ...