‹Back


unssh

  Source

Demo of unssh

About

(unssh: an [uns]ecure [sh]ell)

I built part of an SSH server. It’s enough to get a shell on the host machine using an OpenSSH client. This included implementing the binary protocol, performing key exchange, hooking up encryption and decryption, session management, PTY allocation, and launching shells or running commands.

Obvious Disclaimer: Don’t use this

It’s got no authentication mechanisms, doesn’t follow any standards for configuration, and could have serious security vulnerabilities. This was nothing more than a weekend project.

Key Exchange

By far the hardest part was implementing the key exchange. I thought this would be easier given that there are detailed spec documents and reference implementations, but I underestimated how finicky it would be to get right and how hard it would be to debug, since even a single bit wrong somewhere is as broken as not implementing it at all.

The key exchange is implemented using the Diffie-Hellman Group 14 method, which I don’t actually understand, if I’m honest — again, I just followed the spec.

I actually found the spec wildly ambiguous and confusing in places. Things like:

Conclusion

In the end, it kinda works. Please don’t use it.