mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
o [NSE] Added the script dict-info, which retrieves information from a
DICT server, by issuing the SHOW SERVER command. [Patrik Karlsson]
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Added the script dict-info, which retrieves information from a
|
||||
DICT server, by issuing the SHOW SERVER command. [Patrik Karlsson]
|
||||
|
||||
o [NSE] Added the script gkrellm-info, which displays information retrieved
|
||||
from the GKRellm monitoring service. [Patrik Karlsson]
|
||||
|
||||
|
||||
74
scripts/dict-info.nse
Normal file
74
scripts/dict-info.nse
Normal file
@@ -0,0 +1,74 @@
|
||||
description = [[
|
||||
Connects to a dictionary server using the DICT protocol and runs the SHOW
|
||||
SERVER command and displays the result. The DICT protocol is defined in RFC
|
||||
2229 and is a protocol which allows a client to query a dictionary server for
|
||||
definitions from a set of natural language dictionary databases.
|
||||
|
||||
The SHOW server command must be implemented and depending on access will show
|
||||
server information and accessible databases. If authentication is required, the
|
||||
list of databases will not be shown.
|
||||
]]
|
||||
|
||||
---
|
||||
-- @usage
|
||||
-- nmap -p 2628 <ip> --script dict-info
|
||||
--
|
||||
-- @output
|
||||
-- PORT STATE SERVICE
|
||||
-- 2628/tcp open dict
|
||||
-- | dict-info:
|
||||
-- | dictd 1.12.0/rf on Linux 3.0.0-12-generic
|
||||
-- | On ubu1110: up 15.000, 4 forks (960.0/hour)
|
||||
-- |
|
||||
-- | Database Headwords Index Data Uncompressed
|
||||
-- | bouvier 6797 128 kB 2338 kB 6185 kB
|
||||
-- |_ fd-eng-swe 5489 76 kB 77 kB 204 kB
|
||||
--
|
||||
|
||||
author = "Patrik Karlsson"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"discovery", "safe"}
|
||||
|
||||
local shortport = require('shortport')
|
||||
|
||||
portrule = shortport.port_or_service(2628, "dict", "tcp")
|
||||
|
||||
local function fail(err) return ("\n ERROR: %s"):format(err or "") end
|
||||
|
||||
action = function(host, port)
|
||||
local socket = nmap.new_socket()
|
||||
if ( not(socket:connect(host, port)) ) then
|
||||
return fail("Failed to connect to dictd server")
|
||||
end
|
||||
|
||||
local probes = {
|
||||
'client "dict 1.12.0/rf on Linux 3.0.0-12-generic"',
|
||||
'show server',
|
||||
'quit',
|
||||
}
|
||||
|
||||
if ( not(socket:send(stdnse.strjoin("\r\n", probes) .. "\r\n")) ) then
|
||||
return fail("Failed to send request to server")
|
||||
end
|
||||
|
||||
local srvinfo
|
||||
|
||||
repeat
|
||||
local status, data = socket:receive_buf("\r\n")
|
||||
if ( not(status) ) then
|
||||
return fail("Failed to read response from server")
|
||||
elseif ( data:match("^5") ) then
|
||||
return fail(data)
|
||||
elseif ( data:match("^114") ) then
|
||||
srvinfo = {}
|
||||
elseif ( srvinfo and not(data:match("^%.$")) ) then
|
||||
table.insert(srvinfo, data)
|
||||
end
|
||||
until(not(status) or data:match("^221") or data:match("^%.$"))
|
||||
socket:close()
|
||||
|
||||
-- if last item is an empty string remove it, to avoid trailing line feed
|
||||
srvinfo[#srvinfo] = ( srvinfo[#srvinfo] ~= "" and srvinfo[#srvinfo] or nil )
|
||||
|
||||
return stdnse.format_output(true, srvinfo)
|
||||
end
|
||||
@@ -65,6 +65,7 @@ Entry { filename = "daytime.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "db2-das-info.nse", categories = { "discovery", "safe", "version", } }
|
||||
Entry { filename = "db2-discover.nse", categories = { "default", "discovery", "safe", } }
|
||||
Entry { filename = "dhcp-discover.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "dict-info.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "dns-blacklist.nse", categories = { "external", "safe", } }
|
||||
Entry { filename = "dns-brute.nse", categories = { "discovery", "intrusive", } }
|
||||
Entry { filename = "dns-cache-snoop.nse", categories = { "discovery", "intrusive", } }
|
||||
|
||||
Reference in New Issue
Block a user