mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Adjust the output of http-trace and pop3-capabilities to avoid overly long
lines.
This commit is contained in:
@@ -7,7 +7,7 @@ response.
|
||||
-- @output
|
||||
-- 80/tcp open http
|
||||
-- | http-trace: Response differs from request. First 5 additional lines:
|
||||
-- | Cookie: UID=d4287aa38d02f409841b4e0c0050c13148a85d01c0c0a154d4ef56dfc2b4fc1b0
|
||||
-- | Cookie: UID=d4287aa38d02f409841b4e0c0050c131...
|
||||
-- | Country: us
|
||||
-- | Ip_is_advertise_combined: yes
|
||||
-- | Ip_conntype-Confidence: -1
|
||||
|
||||
@@ -14,16 +14,18 @@ categories = {"default"}
|
||||
|
||||
require 'pop3'
|
||||
require 'shortport'
|
||||
require 'stdnse'
|
||||
|
||||
portrule = shortport.port_or_service({110}, "pop3")
|
||||
|
||||
action = function(host, port)
|
||||
local capa = pop3.capabilities(host, port)
|
||||
if capa then
|
||||
local capstr = ""
|
||||
-- Convert the capabilities table into an array of strings.
|
||||
local capstrings = {}
|
||||
local cap, args
|
||||
for cap, args in pairs(capa) do
|
||||
capstr = capstr .. " " .. cap
|
||||
local capstr = cap
|
||||
if type(args) == "string" then capstr = capstr .. "(" .. args .. ")" end
|
||||
if type(args) == "table" then
|
||||
local arg
|
||||
@@ -33,8 +35,9 @@ action = function(host, port)
|
||||
end
|
||||
capstr = string.sub(capstr, 1, #capstr - 1) .. ")"
|
||||
end
|
||||
table.insert(capstrings, capstr)
|
||||
end
|
||||
return capstr
|
||||
return stdnse.strjoin(" ", capstrings)
|
||||
else
|
||||
return "server doesn't support CAPA"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user