1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00
Files
nmap/scripts/popcapa.nse
david 8bd71aaf43 Normalize NSEDoc documentation of scripts.
I made every script follow a standard form: it starts with the id, followed by
the description. The description is contained in [[ ]] delimiters. The
description is in the global description variable, not in a LuaDoc comment.
Other LuaDoc information such as @args and @usage follows the description in a
comment.

The first paragraph of each description is a a short summary of what the script
does. More detailed information, if any, is given in following paragraphs.

I also improved some wording and formatting in a few cases.
2008-10-14 20:52:50 +00:00

38 lines
890 B
Lua

id = "POP3 Capabilites"
description = [[
Retrieves POP3 server capabilities.
]]
author = "Philip Pickering <pgpickering@gmail.com>"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default"}
require 'pop3'
require 'shortport'
portrule = shortport.port_or_service({110}, "pop3")
action = function(host, port)
local capa = pop3.capabilities(host, port)
if capa then
local capstr = ""
local cap, args
for cap, args in pairs(capa) do
capstr = capstr .. " " .. cap
if type(args) == "string" then capstr = capstr .. "(" .. args .. ")" end
if type(args) == "table" then
local arg
capstr = capstr .. "("
for i, arg in ipairs(args) do
capstr = capstr .. arg .. " "
end
capstr = string.sub(capstr, 1, #capstr - 1) .. ")"
end
end
return capstr
else
return "server doesn't support CAPA"
end
end