You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fangdingjun f41c629080 change to socks.Conn 8 years ago
obfssh_client add custom help message 8 years ago
obfssh_scp more error check 8 years ago
obfssh_server correct ssh key generate command 8 years ago
.gitignore server: add sftp support 8 years ago
LICENSE first version 8 years ago
README.md first version 8 years ago
client.go change to socks.Conn 8 years ago
conf.go add more commandline options 8 years ago
conn.go first version 8 years ago
conn_test.go add connection test case 8 years ago
doc.go first version 8 years ago
server.go fix printf format 8 years ago
util.go first version 8 years ago

README.md

obfssh

obfssh is wrapper for ssh protocol, use AES or RC4 to encrypt the transport data, ssh is a good designed protocol and with the good encryption, but the protocol has a especially figerprint, the firewall can easily identify the protocol and block it or QOS it, especial when we use its port forward function to escape from the state censorship.

obfssh encrypt the ssh protocol and hide the figerprint, the firewall can not identify the protocol.

We borrow the idea from https://github.com/brl/obfuscated-openssh, but not compatible with it, beause the limitions of golang ssh library.

server usage example

import "github.com/fangdingjun/obfssh"
import "golang.org/x/crypto/ssh"

// key for encryption
obfs_key := "some keyword"

// encrypt method
obfs_method := "rc4"

config := &ssh.ServerConfig{
	// add ssh server configure here
	// for example auth method, cipher, MAC
	...
}

l, err := net.Listen(":2022")
c, err := l.Accept()

sc, err := obfssh.NewServer(c, config, obfs_method, obfs_key)

sc.Run()

client usage example

import "github.com/fangdingjun/obfssh"
import "golang.org/x/crypto/ssh"

addr := "localhost:2022"

// key for encryption
obfs_key := "some keyword"

// encrypt method
obfs_method := "rc4"

config := ssh.ClientConfig{
	// add ssh client config here
	// for example auth method
	...
}

c, err := net.Dial("tcp", addr)

// create connection
client, err := obfssh.NewClient(c, config, addr, obfs_method, obfs_key)

// local to remote port forward
client.AddLocalForward(":2234:10.0.0.1:3221")

// remote to local port forward
client.AddRemoteForward(":2234:10.2.0.1:3221")

// dynamic port forward
client.AddDynamicForward(":4321")

// wait to be done
client.Run()

limitions

now, the server side only implements the port forward function, start shell or execute a command is not suppurted

if set the obfs_method to none, obfssh is compatible with standard ssh server/client(OpenSSH)

License

GPLv3, see LICENSE file details