Nmap redis-info NSE Script


This page contains detailed information about how to use the redis-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/redis-info.nse
Script categories: discovery, safe
Target service / protocol: redis
Target network port(s): 6379
List of CVEs: -

Script Description


The redis-info.nse script retrieves information (such as version number and architecture) from a Redis key-value store.

Redis-info NSE Script Arguments


This is a full list of arguments supported by the redis-info.nse script:

creds.global

Credentials to be returned by Credentials.getCredentials regardless of the service.

creds.[service]

Credentials to be returned by Credentials.getCredentials for [service]. E.g. creds.http=admin:password

- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..] syntax. For example:

nmap --script=redis-info --script-args creds.global=value,creds.\[service]=value <target>

Redis-info NSE Script Example Usage


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

nmap -p 6379 <ip> --script redis-info

Redis-info NSE Script Example Output


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

PORT     STATE SERVICE
6379/tcp open  unknown
| redis-info:
|   Version            2.2.11
|   Architecture       64 bits
|   Process ID         17821
|   Used CPU (sys)     2.37
|   Used CPU (user)    1.02
|   Connected clients  1
|   Connected slaves   0
|   Used memory        780.16K
|   Role               master
|   Bind addresses:
|     192.168.121.101
|   Active channels:
|     testChannel
|     bidChannel
|   Client connections:
|     192.168.171.101
|_    72.14.177.105

Redis-info NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Authors


  • Patrik Karlsson
  • Vasiliy Kulikov

References


See Also


Related NSE scripts to the redis-info.nse script:

Visit Nmap NSE Library for more scripts.

The redis-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 parse response from server


Here is a relevant code snippet related to the "Failed to parse response from server" error message:

93:	      if data[1] ~= "bind" or not data[2] then
94:	        return nil
95:	      end
96:	      local restab = stringaux.strsplit(" ", data[2])
97:	      if not restab or 0 == #restab then
98:	        stdnse.debug1("Failed to parse response from server")
99:	        return nil
100:	      end
101:	      for i, ip in ipairs(restab) do
102:	        if ip == '' then restab[i] = '0.0.0.0' end
103:	      end

Failed to parse response from server


Here is a relevant code snippet related to the "Failed to parse response from server" error message:

127:	  },
128:	  {
129:	    "Client connections", {"CLIENT", "LIST"}, function(data)
130:	      local restab = stringaux.strsplit("\n", data)
131:	      if not restab or 0 == #restab then
132:	        stdnse.debug1("Failed to parse response from server")
133:	        return nil
134:	      end
135:	
136:	      local client_ips = {}
137:	      for _, item in ipairs(restab) do

Failed to connect to server


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

181:	action = function(host, port)
182:	
183:	  local helper = redis.Helper:new(host, port)
184:	  local status = helper:connect()
185:	  if( not(status) ) then
186:	    return fail("Failed to connect to server")
187:	  end
188:	
189:	  -- do we have a service password
190:	  local c = creds.Credentials:new(creds.ALL_DATA, host, port)
191:	  local cred = c:getCredentials(creds.State.VALID + creds.State.PARAM)()

Authentication required


Here is a relevant code snippet related to the "Authentication required" error message:

205:	  end
206:	
207:	  if ( redis.Response.Type.ERROR == response.type ) then
208:	    if ( "-ERR operation not permitted" == response.data ) or
209:	        ( "-NOAUTH Authentication required." == response.data ) then
210:	      return fail("Authentication required")
211:	    end
212:	    return fail(response.data)
213:	  end
214:	
215:	  local restab = stringaux.strsplit("\r\n", response.data)

Failed to parse response from server


Here is a relevant code snippet related to the "Failed to parse response from server" error message:

212:	    return fail(response.data)
213:	  end
214:	
215:	  local restab = stringaux.strsplit("\r\n", response.data)
216:	  if ( not(restab) or 0 == #restab ) then
217:	    return fail("Failed to parse response from server")
218:	  end
219:	
220:	  local kvs = {}
221:	  for _, item in ipairs(restab) do
222:	    local k, v = item:match("^([^:]*):(.*)$")

Version


This page has been created based on Nmap version 7.92.

Go back to menu.