SSH-Snake is a self-propagating, file-less Bash script that automates SSH private key discovery and network traversal to map SSH-accessible systems.
SSH-Snake is a self-propagating, self-replicating, file-less script that automates the post-exploitation task of SSH private key and host discovery.
SSH-Snake is primarily used by penetration testers and red teamers to automate the discovery of SSH private keys and accessible hosts within a network, enabling rapid post-exploitation lateral movement and network mapping. System administrators can also use it to audit their infrastructure for SSH key exposure and understand SSH connectivity relationships.
SSH-Snake operates with minimal dependencies but requires common Unix utilities like ssh, bash, and coreutils. It is fileless and self-propagating, so use it carefully in controlled environments to avoid unintended spread. Sysadmins should consider disabling private key printing by commenting out the relevant line in the script to protect sensitive information. This tool emulates adversary behavior and should only be used with proper authorization.
Download the script using wget: wget https://raw.githubusercontent.com/MegaManSec/SSH-Snake/main/Snake.nocomments.sh
Run the script locally: bash ./Snake.nocomments.sh
Alternatively, pipe the script directly into bash: curl https://raw.githubusercontent.com/MegaManSec/SSH-Snake/main/Snake.nocomments.sh | bash
wget https://raw.githubusercontent.com/MegaManSec/SSH-Snake/main/Snake.nocomments.sh
Download the SSH-Snake script to the local system.
bash ./Snake.nocomments.sh
Execute the downloaded SSH-Snake script.
curl https://raw.githubusercontent.com/MegaManSec/SSH-Snake/main/Snake.nocomments.sh | bash
Download and run SSH-Snake in a single command via curl piped to bash.