How to avoid the Debian SSH key attacks

It only took two days, but viable, simple attacks against the weak Debian SSH key generation flaw have surfaced

If you are running a Debian-based Linux system and haven't already caught up with the announcement that there was a major flaw with the generation of SSH, OpenVPN, DNSSEC, SSL/TLS session keys and X.509 certificate key material, you might want to update your system to address the problem.

This doesn't just affect Debian, but Debian derivatives as well, such as Ubuntu.

The flaw was the removal of most of the entropy (randomness) from the key generation process in OpenSSL in September 2006, and wasn't picked up on until just last week.

This means that any keys you have generated since that time should be regenerated as the only entropy present was the pid (Process ID) of the currently running process that generated the key.

This means that there are only 32,767 possible keys for each key length and there are a number of resources starting to appear that are targeting the weak key issue. One of the tools, developed by Markus Mueller, claims to defeat a 2048 bit RSA SSH key in less than 20 minutes.

H D Moore, the founder of Metasploit, points out that there are several features of Debian that make the process of brute forcing a key even simpler, given that a lot of Debian systems use sequential pid allocation and most keys are likely to have been user generated with a pid between 500 and 10,000 (which effectively reduces the keyspace to 9,500 keys).

Systems being developed at the moment are focussing on brute forcing the weakened keys and are being released as people finish creating the complete set of each key length.

If you thought you were safe by using a key length of more than 2048 bits, that isn't the case, as tables of 8192 bit RSA SSH keys have begun to appear (as well as lengths below that).

Keys created with GnuPG or GNUTLS are reported as not being affected by this issue. If you are not in the position to update your system (which you should really be doing), you should look at limiting the number of SSH login attempts to less than one per minute.

SSH brute forcing login attempts (using a set of assumed weak keys) have been a problem plaguing most systems with an exposed SSH port for a long time. Now that attackers have ready access to the complete keyspace for affected Debian systems it is guaranteed that they will gain SSH access if there is nothing set up to limit login attempts.

Some of the best means to limit login attempts include limiting the number of attempts per minute from all sources, blacklisting IPs that fail 2 or more login attempts, or only permitting whitelisted IPs to attempt SSH login (and trusting that those IPs are not compromised themselves).

While these measures will not prevent a successful brute force attack from working, it will mean that a successful attack won't take 20 minutes, it may take many hours or days to succeed.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Carl Jongsma

Computerworld
Show Comments

Cool Tech

Toys for Boys

Family Friendly

Stocking Stuffer

SmartLens - Clip on Phone Camera Lens Set of 3

Learn more >

Christmas Gift Guide

Click for more ›

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill

MSI GT75 TITAN

I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?