Detecting SSH Snake existence and usage

 

Existence and usage detection is not obvious, because Snake makes use of Living Off the Land Binaries (LOLBins), which are programs of a non-malicious nature. For Linux, macOS and Unix systems these LOLBins are part of the standard vendor released operating systems. On Microsoft Windows systems you must install additional software. For SSH server functionality you have Microsoft’s OpenSSH for Windows while for SSH client functionality (scp, sftp, rsync, ssh, etc.) you often see 3rd party software solutions like Filezilla, MobaXterm, PuTTY, WinSCP, etc.

Up-to-date antivirus solutions will detect the utility, and I observed this in my own testing. However, these signature-based detections are fragile and may get bypassed by common code obfuscation techniques. Signatures will likely continue to improve detecting presence, but they do not detect specific behavior associated with it. This is because the behavior observed is often the same as the behavior of the intended functionality.

The AV detection is not a proof of usage, but of existence. To detect usage, you would IMHO need a combination of network monitoring (capable to decode base64) and process monitoring to detect process trees like:


3 Expected process tree

Picture 6. Expected process tree during SSH Snake execution

As the software is only a script of about 1250 lines, it is very easy to change to bypass the obvious detection facilities. As SSH is mostly used on Linux systems, and AV usage on Linux is not widespread you can wonder if its existence and malicious usage gets detected at an early stage.