A secure remote client/server terminal, written in Golang. Intended as a test-bed for experimental key exchanges and symmetric session crypto. Integrated traffic chaffing.
Go to file
Russ Magee 64e511c3c5 Moved mutex to front of Conn struct 2018-05-04 23:39:19 -07:00
hkexpasswd -Added error checking for all stages of hkex.Conn.Accept() and GetStream() 2018-04-28 16:05:33 -07:00
hkexsh No need for custom hkexsh.Copy() 2018-05-04 23:31:06 -07:00
hkexshd No need for custom hkexsh.Copy() 2018-05-04 23:31:06 -07:00
spinsult MSYS+mintty support; pkg renaming to hkexsh 2018-04-04 15:43:27 -07:00
LICENSE.gpl misc. cleanup, LICENSE.{gpl,mit} updates 2018-04-07 13:04:10 -07:00
LICENSE.mit misc. cleanup, LICENSE.{gpl,mit} updates 2018-04-07 13:04:10 -07:00
Makefile Quick 'n dirty Makefile 2018-04-04 15:51:03 +00:00
README.md misc. cleanup, LICENSE.{gpl,mit} updates 2018-04-07 13:04:10 -07:00
herradurakex.go misc. cleanup, LICENSE.{gpl,mit} updates 2018-04-07 13:04:10 -07:00
hkexauth.go Got client hangup working again. Security scrub auth vars. 2018-05-04 23:25:26 -07:00
hkexchan.go -Added error checking for all stages of hkex.Conn.Accept() and GetStream() 2018-04-28 16:05:33 -07:00
hkexnet.go Moved mutex to front of Conn struct 2018-05-04 23:39:19 -07:00
termmode_unix.go MSYS+mintty support; pkg renaming to hkexsh 2018-04-04 15:43:27 -07:00
termmode_windows.go MSYS+mintty support; pkg renaming to hkexsh 2018-04-04 15:43:27 -07:00

README.md

HKExSh

'hkexsh' (HerraduraKEx shell) is a golang implementation of a simple remote shell client and server, similar in role to ssh, offering encrypted interactive and non-interactive sessions. The client and server programs (hkexsh and hkexshd) use a mostly drop-in replacement for golang's standard golang/pkg/net facilities (net.Dial(), net.Listen(), net.Accept() and the net.Conn type), which automatically negotiate keying material for 'secure' sockets using the experimental HerraduraKEx key exchange algorithm first released at Omar Elejandro Herrera Reyna's HerraduraKEx project.

One can simply replace calls to net.Dial() with hkex.Dial(), and likewise net.Listen() with hkex.Listen(), to obtain connections (hkex.Conn) conforming to the basic net.Conn interface. Upon Dial(), the HerraduraKEx key exchange is initiated (whereby client and server independently derive the same keying material).

Above the hkex.Conn layer, the server and client apps in this repository (server/hkexshd and client/hkexsh) negotiate session settings (cipher/hmac algorithms, interactive/non-interactive, etc.) to be used for further communication.

NOTE: Due to the experimental nature of the HerraduraKEx algorithm used to derive crypto keying material, this algorithm and the demonstration remote shell client/server programs should be used with caution and should definitely NOT be used for any sensitive applications, or at the very least at one's own risk.

As of this time (Jan 2018) no verdict by acknowledged 'crypto experts' as to the level of security of the HerraduraKEx algorithm for purposes of session key exchange over an insecure channel has been rendered. It is hoped that experts in the field will analyze the algorithm and determine if it is indeed a suitable one for use in situations where Diffie-Hellman or other key exchange algorithms are currently utilized.

Finally, within the hkexpasswd/ directory is a password-setting utility using its own user/password file distinct from the system /etc/passwd, which is used by the hkexshd server to authenticate clients.

Dependencies:

Get source code

  • $ go get -u github.com/Russtopia/hkexsh
  • $ go get github.com/mattn/go-isatty ## only used by demos, not picked up by above go get -u?

To build

  • $ cd $GOPATH/src/github.com/Russtopia/hkexsh
  • $ make clean all

To set accounts & passwords:

  • $ sudo echo "joebloggs:::*" >/etc/hkexsh.passwd
  • $ sudo hkexpasswd/hkexpasswd -u joebloggs
  • $ <enter a password, enter again to confirm>

Running Clent and Server. In separate shells:

  • [A]$ sudo hkexshd/hkexshd &
  • [B]$ hkexsh/hkexsh -u joebloggs