Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Failed to load latest commit information.
contrib Pristine OpenSSH 5.2 portable sources
openbsd-compat Pristine OpenSSH 5.2 portable sources
regress Pristine OpenSSH 5.2 portable sources
scard Pristine OpenSSH 5.2 portable sources
.gitignore List of files to ignore
CREDITS Pristine OpenSSH 5.2 portable sources
ChangeLog Pristine OpenSSH 5.2 portable sources
INSTALL Pristine OpenSSH 5.2 portable sources
LICENCE Pristine OpenSSH 5.2 portable sources
Makefile.in Obfuscated handshake implementation
OVERVIEW Pristine OpenSSH 5.2 portable sources
PROTOCOL Pristine OpenSSH 5.2 portable sources
PROTOCOL.agent Pristine OpenSSH 5.2 portable sources
README
README.dns Pristine OpenSSH 5.2 portable sources
README.obfuscation
README.platform Pristine OpenSSH 5.2 portable sources
README.privsep Pristine OpenSSH 5.2 portable sources
README.smartcard Pristine OpenSSH 5.2 portable sources
README.tun Pristine OpenSSH 5.2 portable sources
TODO Pristine OpenSSH 5.2 portable sources
WARNING.RNG Pristine OpenSSH 5.2 portable sources
aclocal.m4 Pristine OpenSSH 5.2 portable sources
acss.c Pristine OpenSSH 5.2 portable sources
acss.h Pristine OpenSSH 5.2 portable sources
addrmatch.c Pristine OpenSSH 5.2 portable sources
atomicio.c Pristine OpenSSH 5.2 portable sources
atomicio.h Pristine OpenSSH 5.2 portable sources
audit-bsm.c Pristine OpenSSH 5.2 portable sources
audit.c Pristine OpenSSH 5.2 portable sources
audit.h Pristine OpenSSH 5.2 portable sources
auth-bsdauth.c Pristine OpenSSH 5.2 portable sources
auth-chall.c Pristine OpenSSH 5.2 portable sources
auth-krb5.c Pristine OpenSSH 5.2 portable sources
auth-options.c Pristine OpenSSH 5.2 portable sources
auth-options.h Pristine OpenSSH 5.2 portable sources
auth-pam.c Pristine OpenSSH 5.2 portable sources
auth-pam.h Pristine OpenSSH 5.2 portable sources
auth-passwd.c Pristine OpenSSH 5.2 portable sources
auth-rh-rsa.c Pristine OpenSSH 5.2 portable sources
auth-rhosts.c Pristine OpenSSH 5.2 portable sources
auth-rsa.c Pristine OpenSSH 5.2 portable sources
auth-shadow.c Pristine OpenSSH 5.2 portable sources
auth-sia.c Pristine OpenSSH 5.2 portable sources
auth-sia.h Pristine OpenSSH 5.2 portable sources
auth-skey.c Pristine OpenSSH 5.2 portable sources
auth.c Pristine OpenSSH 5.2 portable sources
auth.h Pristine OpenSSH 5.2 portable sources
auth1.c Pristine OpenSSH 5.2 portable sources
auth2-chall.c Pristine OpenSSH 5.2 portable sources
auth2-gss.c Pristine OpenSSH 5.2 portable sources
auth2-hostbased.c Pristine OpenSSH 5.2 portable sources
auth2-jpake.c Pristine OpenSSH 5.2 portable sources
auth2-kbdint.c Pristine OpenSSH 5.2 portable sources
auth2-none.c Pristine OpenSSH 5.2 portable sources
auth2-passwd.c Pristine OpenSSH 5.2 portable sources
auth2-pubkey.c Pristine OpenSSH 5.2 portable sources
auth2.c Pristine OpenSSH 5.2 portable sources
authfd.c Pristine OpenSSH 5.2 portable sources
authfd.h Pristine OpenSSH 5.2 portable sources
authfile.c Pristine OpenSSH 5.2 portable sources
authfile.h Pristine OpenSSH 5.2 portable sources
bufaux.c Pristine OpenSSH 5.2 portable sources
bufbn.c Pristine OpenSSH 5.2 portable sources
buffer.c Pristine OpenSSH 5.2 portable sources
buffer.h Pristine OpenSSH 5.2 portable sources
buildpkg.sh.in Pristine OpenSSH 5.2 portable sources
canohost.c Pristine OpenSSH 5.2 portable sources
canohost.h Pristine OpenSSH 5.2 portable sources
channels.c Pristine OpenSSH 5.2 portable sources
channels.h Pristine OpenSSH 5.2 portable sources
cipher-3des1.c Pristine OpenSSH 5.2 portable sources
cipher-acss.c Pristine OpenSSH 5.2 portable sources
cipher-aes.c Pristine OpenSSH 5.2 portable sources
cipher-bf1.c Pristine OpenSSH 5.2 portable sources
cipher-ctr.c Pristine OpenSSH 5.2 portable sources
cipher.c Pristine OpenSSH 5.2 portable sources
cipher.h Pristine OpenSSH 5.2 portable sources
cleanup.c Pristine OpenSSH 5.2 portable sources
clientloop.c Pristine OpenSSH 5.2 portable sources
clientloop.h Pristine OpenSSH 5.2 portable sources
compat.c Pristine OpenSSH 5.2 portable sources
compat.h Pristine OpenSSH 5.2 portable sources
compress.c Pristine OpenSSH 5.2 portable sources
compress.h Pristine OpenSSH 5.2 portable sources
config.guess Pristine OpenSSH 5.2 portable sources
config.h.in Pristine OpenSSH 5.2 portable sources
config.sub Pristine OpenSSH 5.2 portable sources
configure Pristine OpenSSH 5.2 portable sources
configure.ac Pristine OpenSSH 5.2 portable sources
crc32.c Pristine OpenSSH 5.2 portable sources
crc32.h Pristine OpenSSH 5.2 portable sources
deattack.c Pristine OpenSSH 5.2 portable sources
deattack.h Pristine OpenSSH 5.2 portable sources
defines.h Pristine OpenSSH 5.2 portable sources
dh.c Pristine OpenSSH 5.2 portable sources
dh.h Pristine OpenSSH 5.2 portable sources
dispatch.c Pristine OpenSSH 5.2 portable sources
dispatch.h Pristine OpenSSH 5.2 portable sources
dns.c Pristine OpenSSH 5.2 portable sources
dns.h Pristine OpenSSH 5.2 portable sources
entropy.c Pristine OpenSSH 5.2 portable sources
entropy.h Pristine OpenSSH 5.2 portable sources
fatal.c Pristine OpenSSH 5.2 portable sources
fixpaths Pristine OpenSSH 5.2 portable sources
fixprogs Pristine OpenSSH 5.2 portable sources
groupaccess.c Pristine OpenSSH 5.2 portable sources
groupaccess.h Pristine OpenSSH 5.2 portable sources
gss-genr.c Pristine OpenSSH 5.2 portable sources
gss-serv-krb5.c Pristine OpenSSH 5.2 portable sources
gss-serv.c Pristine OpenSSH 5.2 portable sources
hostfile.c Pristine OpenSSH 5.2 portable sources
hostfile.h Pristine OpenSSH 5.2 portable sources
includes.h Pristine OpenSSH 5.2 portable sources
install-sh Pristine OpenSSH 5.2 portable sources
jpake.c Pristine OpenSSH 5.2 portable sources
jpake.h Pristine OpenSSH 5.2 portable sources
kex.c Obfuscated handshake implementation
kex.h Pristine OpenSSH 5.2 portable sources
kexdh.c Pristine OpenSSH 5.2 portable sources
kexdhc.c Pristine OpenSSH 5.2 portable sources
kexdhs.c Pristine OpenSSH 5.2 portable sources
kexgex.c Pristine OpenSSH 5.2 portable sources
kexgexc.c Pristine OpenSSH 5.2 portable sources
kexgexs.c Pristine OpenSSH 5.2 portable sources
key.c Pristine OpenSSH 5.2 portable sources
key.h Pristine OpenSSH 5.2 portable sources
log.c Pristine OpenSSH 5.2 portable sources
log.h Pristine OpenSSH 5.2 portable sources
loginrec.c Pristine OpenSSH 5.2 portable sources
loginrec.h Pristine OpenSSH 5.2 portable sources
logintest.c Pristine OpenSSH 5.2 portable sources
mac.c Pristine OpenSSH 5.2 portable sources
mac.h Pristine OpenSSH 5.2 portable sources
match.c Pristine OpenSSH 5.2 portable sources
match.h Pristine OpenSSH 5.2 portable sources
md-sha256.c Pristine OpenSSH 5.2 portable sources
md5crypt.c Pristine OpenSSH 5.2 portable sources
md5crypt.h Pristine OpenSSH 5.2 portable sources
mdoc2man.awk Pristine OpenSSH 5.2 portable sources
misc.c Pristine OpenSSH 5.2 portable sources
misc.h Pristine OpenSSH 5.2 portable sources
mkinstalldirs Pristine OpenSSH 5.2 portable sources
moduli Pristine OpenSSH 5.2 portable sources
moduli.0 Pristine OpenSSH 5.2 portable sources
moduli.5 Pristine OpenSSH 5.2 portable sources
moduli.c Pristine OpenSSH 5.2 portable sources
monitor.c Pristine OpenSSH 5.2 portable sources
monitor.h Pristine OpenSSH 5.2 portable sources
monitor_fdpass.c Pristine OpenSSH 5.2 portable sources
monitor_fdpass.h Pristine OpenSSH 5.2 portable sources
monitor_mm.c Pristine OpenSSH 5.2 portable sources
monitor_mm.h Pristine OpenSSH 5.2 portable sources
monitor_wrap.c Pristine OpenSSH 5.2 portable sources
monitor_wrap.h Pristine OpenSSH 5.2 portable sources
msg.c Pristine OpenSSH 5.2 portable sources
msg.h Pristine OpenSSH 5.2 portable sources
mux.c Pristine OpenSSH 5.2 portable sources
myproposal.h Pristine OpenSSH 5.2 portable sources
nchan.c Pristine OpenSSH 5.2 portable sources
nchan.ms Pristine OpenSSH 5.2 portable sources
nchan2.ms Pristine OpenSSH 5.2 portable sources
obfuscate.c Obfuscated handshake implementation
obfuscate.h Obfuscated handshake implementation
openssh.xml.in Pristine OpenSSH 5.2 portable sources
opensshd.init.in Pristine OpenSSH 5.2 portable sources
packet.c Obfuscated handshake implementation
packet.h Obfuscated handshake implementation
pathnames.h Pristine OpenSSH 5.2 portable sources
platform.c Pristine OpenSSH 5.2 portable sources
platform.h Pristine OpenSSH 5.2 portable sources
progressmeter.c Pristine OpenSSH 5.2 portable sources
progressmeter.h Pristine OpenSSH 5.2 portable sources
readconf.c Obfuscated handshake implementation
readconf.h Obfuscated handshake implementation
readpass.c Pristine OpenSSH 5.2 portable sources
rijndael.c Pristine OpenSSH 5.2 portable sources
rijndael.h Pristine OpenSSH 5.2 portable sources
rsa.c Pristine OpenSSH 5.2 portable sources
rsa.h Pristine OpenSSH 5.2 portable sources
scard-opensc.c Pristine OpenSSH 5.2 portable sources
scard.c Pristine OpenSSH 5.2 portable sources
scard.h Pristine OpenSSH 5.2 portable sources
schnorr.c Pristine OpenSSH 5.2 portable sources
scp.0 Pristine OpenSSH 5.2 portable sources
scp.1 Pristine OpenSSH 5.2 portable sources
scp.c Command line options to enable handshake obfuscation
servconf.c Obfuscated handshake implementation
servconf.h Obfuscated handshake implementation
serverloop.c Pristine OpenSSH 5.2 portable sources
serverloop.h Pristine OpenSSH 5.2 portable sources
session.c Pristine OpenSSH 5.2 portable sources
session.h Pristine OpenSSH 5.2 portable sources
sftp-client.c Pristine OpenSSH 5.2 portable sources
sftp-client.h Pristine OpenSSH 5.2 portable sources
sftp-common.c Pristine OpenSSH 5.2 portable sources
sftp-common.h Pristine OpenSSH 5.2 portable sources
sftp-glob.c Pristine OpenSSH 5.2 portable sources
sftp-server-main.c Pristine OpenSSH 5.2 portable sources
sftp-server.0 Pristine OpenSSH 5.2 portable sources
sftp-server.8 Pristine OpenSSH 5.2 portable sources
sftp-server.c Pristine OpenSSH 5.2 portable sources
sftp.0 Pristine OpenSSH 5.2 portable sources
sftp.1 Pristine OpenSSH 5.2 portable sources
sftp.c Command line options to enable handshake obfuscation
sftp.h Pristine OpenSSH 5.2 portable sources
ssh-add.0 Pristine OpenSSH 5.2 portable sources
ssh-add.1 Pristine OpenSSH 5.2 portable sources
ssh-add.c Pristine OpenSSH 5.2 portable sources
ssh-agent.0 Pristine OpenSSH 5.2 portable sources
ssh-agent.1 Pristine OpenSSH 5.2 portable sources
ssh-agent.c Pristine OpenSSH 5.2 portable sources
ssh-dss.c Pristine OpenSSH 5.2 portable sources
ssh-gss.h Pristine OpenSSH 5.2 portable sources
ssh-keygen.0 Pristine OpenSSH 5.2 portable sources
ssh-keygen.1 Pristine OpenSSH 5.2 portable sources
ssh-keygen.c Pristine OpenSSH 5.2 portable sources
ssh-keyscan.0 Pristine OpenSSH 5.2 portable sources
ssh-keyscan.1 Pristine OpenSSH 5.2 portable sources
ssh-keyscan.c Pristine OpenSSH 5.2 portable sources
ssh-keysign.0 Pristine OpenSSH 5.2 portable sources
ssh-keysign.8 Pristine OpenSSH 5.2 portable sources
ssh-keysign.c Pristine OpenSSH 5.2 portable sources
ssh-rand-helper.0 Pristine OpenSSH 5.2 portable sources
ssh-rand-helper.8 Pristine OpenSSH 5.2 portable sources
ssh-rand-helper.c Pristine OpenSSH 5.2 portable sources
ssh-rsa.c Pristine OpenSSH 5.2 portable sources
ssh.0 Pristine OpenSSH 5.2 portable sources
ssh.1 Pristine OpenSSH 5.2 portable sources
ssh.c Obfuscated handshake implementation
ssh.h Pristine OpenSSH 5.2 portable sources
ssh1.h Pristine OpenSSH 5.2 portable sources
ssh2.h Pristine OpenSSH 5.2 portable sources
ssh_config Pristine OpenSSH 5.2 portable sources
ssh_config.0 Pristine OpenSSH 5.2 portable sources
ssh_config.5 Pristine OpenSSH 5.2 portable sources
ssh_prng_cmds.in Pristine OpenSSH 5.2 portable sources
sshconnect.c Obfuscated handshake was not correctly enabled when connecting throug…
sshconnect.h Pristine OpenSSH 5.2 portable sources
sshconnect1.c Pristine OpenSSH 5.2 portable sources
sshconnect2.c Pristine OpenSSH 5.2 portable sources
sshd.0 Pristine OpenSSH 5.2 portable sources
sshd.8 Pristine OpenSSH 5.2 portable sources
sshd.c Don't call strlen() on the encrypted banner.
sshd_config Pristine OpenSSH 5.2 portable sources
sshd_config.0 Pristine OpenSSH 5.2 portable sources
sshd_config.5 Pristine OpenSSH 5.2 portable sources
sshlogin.c Pristine OpenSSH 5.2 portable sources
sshlogin.h Pristine OpenSSH 5.2 portable sources
sshpty.c Pristine OpenSSH 5.2 portable sources
sshpty.h Pristine OpenSSH 5.2 portable sources
sshtty.c Pristine OpenSSH 5.2 portable sources
survey.sh.in Pristine OpenSSH 5.2 portable sources
ttymodes.c Pristine OpenSSH 5.2 portable sources
ttymodes.h Pristine OpenSSH 5.2 portable sources
uidswap.c Pristine OpenSSH 5.2 portable sources
uidswap.h Pristine OpenSSH 5.2 portable sources
umac.c Pristine OpenSSH 5.2 portable sources
umac.h Pristine OpenSSH 5.2 portable sources
uuencode.c Pristine OpenSSH 5.2 portable sources
uuencode.h Pristine OpenSSH 5.2 portable sources
version.h Pristine OpenSSH 5.2 portable sources
xmalloc.c Pristine OpenSSH 5.2 portable sources
xmalloc.h Pristine OpenSSH 5.2 portable sources

README

Handshake Obfuscation
---------------------

Handshake obfuscation strengthens the initial SSH handshake against systems
that identify or classify various network protocols by examining data in 
transit for static signatures.  Such automatic classification of traffic is 
often used to provide different levels of network service for each protocol
and sometimes used to implement policies which prohibit certain uses of a
network.

When an SSH connection is initiated, the client and server exchange several
packets to configure the cryptographic parameters for the session.  Since
the encryption algorithms and keys have not yet been determined, this exchange
of messages is not encrypted and is vulnerable to analysis which can conclusively
identify the connection as SSH protocol traffic no matter what port the server
is listening on.  For most users this is of no concern, because merely being
able to identify a connection as an SSH session does not introduce any security
vulnerabilities in the protocol itself.

Some users may have special security needs where they would prefer not to 
disclose that they are using the SSH protocol to somebody who may be monitoring
the network.  Handshake obfuscation prevents automatic identification of SSH
protocol traffic by encrypting the entire handshake with a stream cipher, and 
is designed to make it difficult to implement an automated analysis tool even
understanding how the obfuscation protocol works. 

The obfuscation encryption key is generated in a way which is deliberately 
slow to make it difficult to implement on the type of high performance network
hardware which is usually used for classifying protocol traffic.  Additionally
an option is provided for the client and server to share a 'keyword' which is
a simple kind of password that is used only for securing the handshake.  No
connection can be initiated to a server which has keyword obfuscation enabled 
without knowing the keyword, and the obfuscation keyword is used to derive the
keys that encrypt the handshake in order prevent decrypting the handshake 
traffic without knowing the keyword.



Configuration
-------------

Server:

The server configuration for obufscated handshakes adds two new keywords which may
be used in a sshd_config file to enable obfuscation.

    ObfuscatedPort
           This option is similar to the Port option and specifies one or more ports
           on which to listen for obfuscated handshake connections.  Both this option
           and the Port option may be used in the same configuration file to create a
           configuration with both regular and obfuscated listening ports.

    ObfuscateKeyword
           Enables the keyword protected obfuscated handshake which prevents initiating
           a handshake to the server without knowing the keyword.

Client:

The OpenSSH client can be configured to use the obfuscated handshake protocol by passing
command line options as well as through configuration file options.

    -z             Initiate an obfuscated handshake to the remote server.
    -Z keyword     Initiate a keyword protected obfuscated handshake to the remote server.

Two new client configuration file options hve been added.

    ObfuscateHandshake
           Requests that the client use the obfuscated handshake protocol.  The default is 'no'

    ObfuscateKeyword
           Enables keyword protected obfuscated handshake.  The server and client must be
           configured with the same keyword in order to initiate a connection.

Protocol Description
--------------------

The first step in the obfuscation protocol is that the client connects to a port
running the protocol and sends a seed message which is used to derive the keys
for obfuscating the handshake.

#define OBFUSCATE_MAGIC_VALUE        0x0BF5CA7E
#define OBFUSCATE_SEED_LENGTH        16
#define OBFUSCATE_MAX_PADDING        8192


[     16 byte random seed           ][  magic  ][ plength ][ .. plength bytes of random padding ... ]
|___________________________________||______________________________________________________________|
                |                                                   |
            Plaintext                                Encrypted with key derived from seed 

To create the seed message the client first generates 16 pseudo random bytes from which
the handshake obfuscation keys will be derived.  The client also runs the key derivation algorithm
(described below) to initialize the obfuscation cipher.

The 'magic' field and the 'plength' field are 32 bit unsigned values transfered in network byte order (MSB first).

The magic field must contain the constant OBFUSCATE_MAGIC_VALUE and the 'plength' field must
contain a randomly selected value between 0 and OBFUSCATE_MAX_PADDING.  Then 'plength' bytes of
pseudo randomly generated data is appended after the length field.

The purpose of the padding is to prevent a trivial traffic analysis attack which allows the protocol
to be identified my merely observing the size of the first message.

Upon receiving the seed message from the client, the server must extract the seed bytes
and perform the key derivation algorithm (described below) before decrypting the rest of the
message.  Then the server must verify that the magic value is correct and also that the padding length
is below OBFUSCATE_MAX_PADDING.

If these checks fail the server will continue reading and discarding all data until
the client closes the connection without sending anything in response.

Key Derivation
--------------

The key derivation produces a pair of keys (one for each direction) by performing an iterated 
hash function over the random seed value concatenated with a constant value.

A different constant value is used for each direction to guarantee that the two stream ciphers
instances are initialized with unique keys.

#define OBFUSCATE_HASH_ITERATIONS     6000
#define OBFUSCATE_KEY_LENGTH          16

    h = SHA1(seed || constant)

    for(i = 0; i < OBFUSCATE_HASH_ITERATIONS; i++)
        h = SHA1(h);

    key = [first OBFUSCATE_KEY_LENGTH bytes of h]

For traffic from the client to the server the constant is the string "client_to_server"

For traffic from the server to the client the constant is the string "server_to_clint"

Passworded Key Derivation
-------------------------

A configuration option is provided which allows specification of a password which must be specified by a client in order
to initiate a handshake with the server.  This feature should not be considered as strong authentication as it is only
for preventing casual portscanning and fingerprinting of your ssh server.

    h = SHA1(seed || password || constant)


Something went wrong with that request. Please try again.