From acaade017b33fe6477b66e885674677f90517a09 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 30 Dec 2011 04:05:36 +0000 Subject: [PATCH] Sort duplicates output in ssh-hostkey.nse. --- scripts/ssh-hostkey.nse | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ssh-hostkey.nse b/scripts/ssh-hostkey.nse index 3f97759f4..9907d057f 100644 --- a/scripts/ssh-hostkey.nse +++ b/scripts/ssh-hostkey.nse @@ -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