mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +00:00
Add support for ECDSA to ssh-hostkey.nse.
Patch by Adam Števko. http://seclists.org/nmap-dev/2012/q4/181
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Added support for ECDSA keys to ssh-hostkey.nse. [Adam Števko]
|
||||
|
||||
o [Nsock] Added new poll and kqueue engines. [Henri Doreau]
|
||||
|
||||
o [Zenmap] Corrected some typos in the Japanese translation.
|
||||
|
||||
@@ -215,6 +215,15 @@ fetch_host_key = function( host, port, key_type )
|
||||
local n
|
||||
_, _, _, n = bin.unpack( ">aaa", public_host_key )
|
||||
bits = openssl.bignum_bin2bn( n ):num_bits()
|
||||
elseif key_type == 'ecdsa-sha2-nistp256' then
|
||||
algorithm = "ECDSA"
|
||||
bits = "256"
|
||||
elseif key_type == 'ecdsa-sha2-nistp384' then
|
||||
algorithm = "ECDSA"
|
||||
bits = "384"
|
||||
elseif key_type == 'ecdsa-sha2-nistp521' then
|
||||
algorithm = "ECDSA"
|
||||
bits = "521"
|
||||
else
|
||||
stdnse.print_debug( "Unsupported key type: %s", key_type )
|
||||
end
|
||||
|
||||
@@ -136,6 +136,15 @@ local function portaction(host, port)
|
||||
key = ssh2.fetch_host_key( host, port, "ssh-rsa" )
|
||||
if key then table.insert( keys, key ) end
|
||||
|
||||
key = ssh2.fetch_host_key( host, port, "ecdsa-sha2-nistp256" )
|
||||
if key then table.insert( keys, key ) end
|
||||
|
||||
key = ssh2.fetch_host_key( host, port, "ecdsa-sha2-nistp384" )
|
||||
if key then table.insert( keys, key ) end
|
||||
|
||||
key = ssh2.fetch_host_key( host, port, "ecdsa-sha2-nistp521" )
|
||||
if key then table.insert( keys, key ) end
|
||||
|
||||
for _, key in ipairs( keys ) do
|
||||
add_key_to_registry( host, key )
|
||||
table.insert(output_tab, {
|
||||
|
||||
Reference in New Issue
Block a user