zmap / zgrab2

Fast Go Application Scanner
Other
1.75k stars 302 forks source link

ssh: Port lib/ssh from x/crypto v0.7.0 #399

Open TrueSkrillor opened 12 months ago

TrueSkrillor commented 12 months ago

This PR updates the lib/ssh package to be on par with x/crypto/ssh v0.7.0. I chose not to update to v0.14.0 to avoid possible incompatibilities with the x/crypto dependency of the project. Updating lib/ssh is necessary for zgrab2 to stay relevant in the future and retain its ability to scan a large variety of different SSH servers.

The following key changes ported from x/crypto are relevant for zgrab2:

In addition, I integrated some minor improvements myself:

How to Test

Simply scan a few SSH servers and observe the results. I was able to perform an entire IPv4 address range scan without issues.

Notes & Caveats

Without this PR (or a similar one), the SSH scanning capabilities of zgrab2 will slowly decline due to its lack of recent key exchange and cipher algorithms. In the future, it may be beneficial to implement additional algorithms to increase the overall coverage of zgrab2. However, since supported algorithms can be captured without supporting the actual algorithms, a sufficient amount of data is already available to the user.