Nmap memcached-info NSE Script


This page contains detailed information about how to use the memcached-info NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/memcached-info.nse
Script categories: discovery, safe
Target service / protocol: memcached, tcp, udp
Target network port(s): 11211
List of CVEs: -

Script Description


The memcached-info.nse script retrieves information (including system architecture, process ID, and server time) from distributed memory object caching system memcached.

Memcached-info NSE Script Arguments


The memcached-info.nse script does not have any arguments.

Memcached-info NSE Script Example Usage


Here's an example of how to use the memcached-info.nse script:

nmap -p 11211 --script memcached-info

Memcached-info NSE Script Example Output


Here's a sample output from the memcached-info.nse script:

11211/udp open  unknown
| memcached-info:
|   Process ID: 18568
|   Uptime: 6950 seconds
|   Server time: 2018-03-02T03:35:09
|   Architecture: 64 bit
|   Used CPU (user): 0.172010
|   Used CPU (system): 0.200012
|   Current connections: 10
|   Total connections: 78
|   Maximum connections: 1024
|   TCP Port: 11211
|   UDP Port: 11211
|_  Authentication: no

Memcached-info NSE Script Example XML Output


Here's a sample XML output from the memcached-info.nse script produced by providing the -oX <file> Nmap option:

 <elem key="Process ID">17307</elem>
 <elem key="Uptime">10662 seconds</elem>
 <elem key="Server time">2018-03-01T16:46:59</elem>
 <elem key="Architecture">64 bit</elem>
 <elem key="Used CPU (user)">0.212809</elem>
 <elem key="Used CPU (system)">0.157151</elem>
 <elem key="Current connections">5</elem>
 <elem key="Total connections">11</elem>
 <elem key="Maximum connections">1024</elem>
 <elem key="TCP Port">11211</elem>
 <elem key="UDP Port">11211</elem>
 <elem key="Authentication">no</elem>

Author


  • Patrik Karlsson

References


See Also


Visit Nmap NSE Library for more scripts.

The memcached-info.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Failed to send request to server


Here is a relevant code snippet related to the "Failed to send request to server" error message:

110:	        0 -- reserved, must be 0
111:	        ) .. data
112:	    end
113:	    local status = self.socket:send(data)
114:	    if not status then
115:	      return false, "Failed to send request to server"
116:	    end
117:	    if self.protocol == "udp" then
118:	      local msgs = {}
119:	      local dgrams = 0
120:	      repeat

Failed to receive entire response


Here is a relevant code snippet related to the "Failed to receive entire response" error message:

117:	    if self.protocol == "udp" then
118:	      local msgs = {}
119:	      local dgrams = 0
120:	      repeat
121:	        local status, response = self.socket:receive_bytes(8)
122:	        if not status then return false, "Failed to receive entire response" end
123:	        local resp_id, seq, ndgrams, pos = string.unpack(">I2 I2 I2 xx", response)
124:	        if resp_id == req_id then
125:	          dgrams = ndgrams
126:	          msgs[seq+1] = string.sub(response, pos)
127:	        end

Failed to connect to server


Here is a relevant code snippet related to the "Failed to connect to server" error message:

146:	action = function(host, port)
147:	
148:	  local client = Comm:new(host, port)
149:	  local status = client:connect()
150:	  if ( not(status) ) then
151:	    return fail("Failed to connect to server")
152:	  end
153:	
154:	  local request_time = os.time()
155:	  local status, response = client:exchange("stats\r\n")
156:	  if ( not(status) ) then

Failed to send request to server: %s


Here is a relevant code snippet related to the "Failed to send request to server: %s" error message:

152:	  end
153:	
154:	  local request_time = os.time()
155:	  local status, response = client:exchange("stats\r\n")
156:	  if ( not(status) ) then
157:	    return fail(("Failed to send request to server: %s"):format(response))
158:	  end
159:	
160:	  local kvs = parseResponse(response, "STAT")
161:	  if kvs.time then
162:	    datetime.record_skew(host, kvs.time, request_time)

Failed to send request to server: %s


Here is a relevant code snippet related to the "Failed to send request to server: %s" error message:

162:	    datetime.record_skew(host, kvs.time, request_time)
163:	  end
164:	
165:	  local status, response = client:exchange("stats settings\r\n")
166:	  if ( not(status) ) then
167:	    return fail(("Failed to send request to server: %s"):format(response))
168:	  end
169:	
170:	  local kvs2 = parseResponse(response, "STAT")
171:	
172:	  kvs = mergetab(kvs, kvs2)

Version


This page has been created based on Nmap version 7.92.

Go back to menu.