mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Sort duplicates output in ssh-hostkey.nse.
This commit is contained in:
parent
52e617630a
commit
acaade017b
1 changed files with 2 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ author = "Sven Klemm"
|
|||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"safe","default","discovery"}
|
||||
|
||||
require("ipOps")
|
||||
require("shortport")
|
||||
require("stdnse")
|
||||
stdnse.silent_require("openssl")
|
||||
|
|
@ -151,6 +152,7 @@ local function postaction()
|
|||
-- look for hosts using the same hostkey
|
||||
for key, hosts in pairs(hostkeys) do
|
||||
if #hostkeys[key] > 1 then
|
||||
table.sort(hostkeys[key], function(a, b) return ipOps.compare_ip(a, "lt", b) end)
|
||||
local str = 'Key ' .. key .. ' used by:'
|
||||
for _, host in ipairs(hostkeys[key]) do
|
||||
str = str .. '\n ' .. host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue