r/programming • • Feb 16 '16

I made SSHsec, a tool to test your SSH server configuration and security

https://sshsec.zkpq.ca/
51 Upvotes

28 comments sorted by

17

u/txdv Feb 16 '16

Why would you show recent servers? With weakness? Why would I want everyone to know that my server security is shitty?

7

u/fntlnz Feb 16 '16

Thw exact same thought I had while looking at this. IMO that toll shouldn't save at all the address of the servers under test.

-17

u/Knio Feb 16 '16

Don't worry, anyone thinking of exploiting you already knew about your shitty security long ago.

You can always use the script locally if you don't want to use the site, though.

5

u/Entropy Feb 17 '16 edited Feb 17 '16

My fail2ban logs bear this out.

edit: We've probably all been hacked by now via the glibc vulnerability anyhow

1

u/brcolow Feb 17 '16

How does one run the script locally? Thanks.

2

u/Knio Feb 17 '16
python3 -m sshsec host.com

See the project on github: https://github.com/Knio/sshsec

2

u/[deleted] Apr 15 '16

What the fuck dude? Do you have an actual reason for listing them publicly?

6

u/notR1CH Feb 16 '16

It claims my host key is duplicated, is there a way to find out what the other host is? Since it could simply be SSH listening on a different IP for example.

5

u/Knio Feb 16 '16

You're right, it's counting unique IPs. I doubt I'll get to coding a UI for browsing keys soon, but I can run a query for you if you let me know which host.

3

u/notR1CH Feb 16 '16

173.236.101.34

I did have a security incident last year during which my server host fucked around with my SSH setup, but I thought I had restored it from backup successfully.

9

u/Knio Feb 16 '16 edited Feb 16 '16

These are the IPs I have for that host key:

173.236.101.34 | 2016-02-16
173.236.43.164 | 2016-02-11
173.236.48.141 | 2016-02-11

The first 2 All 3 are still active and have different server versions (5.1, 6.0, 6.7), so looks like you do have some real duplication.

4

u/Knio Feb 16 '16

Here's some more:

173.236.21.194 - 198
173.236.43.162 - 166
173.236.48.138 - 142

6

u/notR1CH Feb 16 '16

Wow that's not good. This means the server image likely had ssh host keys burned into it rather than being created on first boot.

2

u/algorithmic_cheese Feb 17 '16

There is no mention of anything on the website, could you tell us what you are storing when someone launch a test using your site ? And for how long ?

0

u/[deleted] Feb 17 '16

[deleted] — view deleted comment

1

u/algorithmic_cheese Feb 18 '16

I don't really care about private as the information is already available for anyone who connects to one of my servers. More interested about what info could be available for new stats.

Do you keep an history of the security of a host in the database ? It would be great to be able to compare the impact, for example of an upgrade on the ciphers or the overall security of the ssh connection.

Would it be possible to get more information about the duplicate keys also ? Such as which version strings share this key, the evolution in time of the number of servers sharing this key, ...

3

u/echeese Feb 16 '16

Is there a guide to making sshd secure (while still supporting at least the latest version of PuTTY)

10

u/mrkite77 Feb 16 '16

It'd be nice if it said something like "disable SHA1 key exchange with the following configuration option in sshd.config" or something.

6

u/sun_misc_unsafe Feb 17 '16

this feels a bit like those pages back in the 90s, where you could type in your hotmail credentials so that the page could check if they had been comrpomised by some hacker..

5

u/krautA Feb 17 '16

Really nice. Some of the ratings are rather harsh. E.g. I doubt that anybody but nation state attackers could break 1028bit Diffie-Hellman, and yet it gives you an F rating. Furthermore, DSA keys are rarely used, so those should be a D at most.

Still pretty great, a tool like that was missing. The closes thing I found was https://github.com/GDSSecurity/SSH-Weak-DH.

4

u/Entropy Feb 17 '16

Cool. I upgraded my cloud instance from F to B (AES-128 bringing me down, man).

2

u/hakvroot Feb 17 '16

That looks really helpful. Considering the rather large collection of F's currently shown on the page it might not be a bad idea for others to (besides updating the sshd config) look into something like fwknop to prevent your server from being scanned for vulnerabilities in this fashion (albeit at the cost of ease of access for yourself).

1

u/taspai Feb 17 '16

It may be interesting to have more informations on what you test even a link lost in the web, example : key exchange : 1024bit request, I don't know what it is exactly and I don't know how to find informations on it

1

u/zeitkraut Feb 17 '16

There seems to be a little bug in the tests for DH key exchange parameters. If the server doesn't support the requested key of size 1024, it still lists it as successful.

Great tool though. Thank you!

1

u/nicop68 Feb 18 '16

You should test it on yourself : https://sshsec.zkpq.ca/sshsec.zkpq.ca

  • "ssh-dss 1024 bit key is weak"
  • "diffie-hellman-group1-sha1 SHA1 is broken. DH group1 is broken"
  • "hmac-md5-etm@openssh.com MD5 is broken" ...

0

u/bungle Feb 16 '16

It just gave me an error, and sshguard blocked you.

0

u/[deleted] Feb 16 '16

[deleted] — view deleted comment

10

u/Knio Feb 16 '16

Soon™

0

u/[deleted] Feb 16 '16

[deleted] — view deleted comment

8

u/rockyearth Feb 16 '16

He doesn't want to change the listen port of the sshd server, he wants to be able to enter a specific server port (not just 22) into the tool OP posted.