I was recently fuzzing a bunch of SSH servers, hoping to find some remote code execution in a non-mainstream server. I ended up finding no code execution in the several that I tried, but I did find one pre-auth denial of service in Syax Multi Server 6.10.

Try this at home!

The vulnerable version can be downloaded here for anyone that would like to duplicate the DoS conditions.

Understanding the Key Exchange

I found that during the key exchange, where the SSH client and SSH server negotiate which ciphers to use, if you messed up just a single specific byte, the server would crash. I started reading through the RFC for SSH keyexchange, and found the key exchange to be mostly ASCII.

I started playing with the byte that caused the crash, and it seemed that it was some sort of control character, or separator. I’m still unsure. However, changing it would cause a crash every time.

I wasn’t able to figure out any way to get remote code execution, although someone smarter than me, may be able to do it. For now, I’ll settle with a DoS exploit.

Remediation

I contacted the developers of Sysax Multi Server on March 18 2013 and April 6 2013. They were able to release a new version (6.11) which is no longer vulnerable to this bug. If you’re running Sysax Multi Server with SSH (off by default, but plenty of users on ShodanHQ), I would highly recommend updating to 6.11, available here.

Update:

It looks like the Metasploit module I wrote for this has been merged! You can view it here