# [CLOSED] Can SSH2 be compromised; is SSH3 on the way?

## trossachs

Just thought that I would ask if there is any further levels than that of SSH v2? Someone remarked recently that SSH can be compromised. What are your thoughts?Last edited by trossachs on Sun Dec 05, 2004 3:56 pm; edited 1 time in total

----------

## inode77

Every system that is connected to a network (or the physical security not guaranteed) can be compromised. 

As for SSH2, you should not have any concers using it as long you use a recent version without known bug/security hole.

But the degree of security is dependant on the configuration of SSH too.

There are several authentication methods (In order of security, weakest top, most secure @ bootom => my opinion):

- Password (A weak password is the BIGGEST security hole imaginable)

- Key

- S-Key

- Secure card

And it doesn't stop here if you like you can use a portnockdeamon to further restrict the access to your system. A lot more possabilities exist to enhance securtiy.

```
man sshd

man sshd_config
```

google ssh and read then offical OpenSSH documentsLast edited by inode77 on Mon Oct 18, 2004 7:28 pm; edited 1 time in total

----------

## amne

As far as i am informed (which is probably informed enough  :Wink: ) ssh 1 can be compromised quite easy by man in the middle attacks. ssh v2 should be sure. Where did you get that information?

----------

## trossachs

I was speaking to a mate about secure remote access to my boxes. I have always used SSH2 by default, but he mentioned that you can "crack into" it. I was a bit dubious, but then I thought, well, ssh2 has been around for an awful long time so maybe he had a point.

I have just checked my version which is 3.7.1_p2-r2. Also  3.8.1_p1-r1 is now available so I will update my configuration. I change my passwords every so often and encourage all my users to do the same. I must apologise if I have given rise to undue concern to anyone here, but I just wanted some reassurance for my own peace of mind. I think I have found it.

----------

## trossachs

On a very different note. I sometimes log into a box in Texas, US for administrative purposes, but I find that I get timed out after just 10 minutes even though I have mirrored by own sshd_config file on the remote server.

Whilst updating openssh just now, I have discovered autossh which could solve my problems. However, in the REDME, it states that to operate:

```

autossh -M <port> [-f] [SSH OPTIONS]

```

Do I select port 22 which is the default ssh port and what, if any, options should I designate as the instructions are not clear? I would rather ask than lock out my current ssh session as I am unable to direcly log into the box.

----------

## speed_bump

Most likely your associate was referring to several known bugs in recent versions of various SSH programs. In this case, it is important to distinguish between weaknesses in the SSH protocol, and implementation bugs which can cause security problems. 

Weaknesses in a protocol are common to all programs which use that protocol for communication. In some cases, it's possible to code around those weaknesses, but at some point, no amount of ridiculous hacking will eliminate the weakness. Implementation bugs are nothing more glorified than the normal bugs we deal with daily. However, these bugs are in a security critical system which typically runs with significant privileges. If you can find a clever way of triggering the bug, you can frequently gain access to the machine. You will see this referred to with the code words "arbitrary code" which is just vendor speak for "anything the cracker wants."

Version 1 of the SSH protocol has several weaknesses at the protocol level which can lead to security problems (for the most part information leakage). In addition, there were several implementation problems which could lead to exploitation (system compromise) as well.

There have been several implementation bugs in various programs which implement the SSH 2 protocol as well. Some of these have been information leakage, others have been system exploits. All have been patched. However, I am not aware of any known (or exploitable) weaknesses in the SSH 2 protocol itself. We see regular scans for systems which are not patched.

As another poster pointed out, there are weaknesses in everything. In most cases discussions of these weaknesses start out in the theoretical realm: "If we could generate 2^96th permutations of ... then we would have a > 50% chance of discovering three bits of the key used to encrypt this data." Eventually they move into more practical range when some clever dick figures out a short cut (Yes! But, if we assume that .. and we can ... then we could 0wn you. And happily because of <obscure property foo> we can assume ... and we're clever, so we can ... so now we 0wn you) And BTW here's the proof of concept code. At which point, the paranoid smugly point out: that's why only n00bs use that protocol; switch to ...

As far as I know, we are not yet ready to switch protocols  :Smile: 

----------

## ponds

SSH2 as a protocol is fine.  If its the only protocol configured for use.  If you are set up to use both protocols through autonegotiation, even though you'll use 2 in a normal scenario, you're still screwed.

What your friend was probably talking about, and this is a huge threat, is the configuration of SSH servers and clients to allow use of SSH1 if the party they're connecting to cannot support SSH2.

In that case the attacker merely needs to man-in-the-middle the protocol declaration of a server to "SSHv1" instead of "SSHv1.99" (SSHv1.99 means "i will use 1 or 2, but prefer 2), then force the client to connect in SSHv1 and man-in-the-middle that session.

----------

