Adds support for Ed25519 keys to script ssh-hostkey

This commit is contained in:
nnposter 2016-12-28 18:23:58 +00:00
parent 3961450aad
commit 8bc9473a55
3 changed files with 8 additions and 0 deletions

View file

@ -1,5 +1,7 @@
# Nmap Changelog ($Id$); -*-text-*-
o [NSE] Script ssh-hostkey now recognizes and reports Ed25519 keys [nnposter]
o [NSE][GH#627] Fixed script hang in several brute scripts due to the "threads"
script-arg not being converted to a number. Error message was
"nselib/brute.lua:1188: attempt to compare number with string" [Arne Beer]

View file

@ -314,6 +314,9 @@ fetch_host_key = function( host, port, key_type )
elseif key_type == 'ecdsa-sha2-nistp521' then
algorithm = "ECDSA"
bits = "521"
elseif key_type == 'ssh-ed25519' then
algorithm = "EdDSA"
bits = "256"
else
stdnse.debug1("Unsupported key type: %s", key_type )
end

View file

@ -300,6 +300,9 @@ local function portaction(host, port)
key = ssh2.fetch_host_key( host, port, "ecdsa-sha2-nistp521" )
if key then table.insert( keys, key ) end
key = ssh2.fetch_host_key( host, port, "ssh-ed25519" )
if key then table.insert( keys, key ) end
if #keys == 0 then
return nil
end