Nmap iscsi-info NSE Script


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

Script Description


The iscsi-info.nse script collects and displays information from remote iSCSI targets.

Iscsi-info NSE Script Arguments


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

Iscsi-info NSE Script Example Usage


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

nmap --script=iscsi-info <target>

Iscsi-info NSE Script Example Output


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

PORT     STATE SERVICE
3260/tcp open  iscsi
| iscsi-info:
|   iqn.2006-01.com.openfiler:tsn.c8c08cad469d
|     Address: 192.168.56.5:3260,1
|     Authentication: NOT required
|   iqn.2006-01.com.openfiler:tsn.6aea7e052952
|     Address: 192.168.56.5:3260,1
|     Authentication: required
|_    Auth reason: Authentication failure

Iscsi-info NSE Script Example XML Output


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

 <table key="iqn.2006-01.com.openfiler:tsn.c8c08cad469d">
   <elem key="Address">192.168.56.5:3260,1</elem>
   <elem key="Authentication">NOT required</elem>
 </table>
 <table key="iqn.2006-01.com.openfiler:tsn.6aea7e052952">
   <elem key="Address">192.168.56.5:3260,1</elem>
   <elem key="Authentication">required</elem>
   <elem key="Auth reason">Authentication failure</elem>
 </table>

Author


  • Patrik Karlsson

References


See Also


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

Visit Nmap NSE Library for more scripts.

The iscsi-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 connect


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

49:	local function requiresAuth( host, port, target )
50:	  local helper = iscsi.Helper:new( host, port )
51:	  local errors = iscsi.Packet.LoginResponse.Errors
52:	
53:	  local status, err = helper:connect()
54:	  if ( not(status) ) then return false, "Failed to connect" end
55:	
56:	  local response
57:	  status, response = helper:login( target )
58:	  if ( not(status) ) then return false, response:getErrorMessage() end
59:	

failed to connect to server


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

71:	
72:	  local helper = iscsi.Helper:new( host, port )
73:	
74:	  local status = helper:connect()
75:	  if ( not(status) ) then
76:	    stdnse.debug1("failed to connect to server" )
77:	    return
78:	  end
79:	
80:	  local records
81:	  status, records = helper:discoverTargets()

failed to discover targets


Here is a relevant code snippet related to the "failed to discover targets" error message:

78:	  end
79:	
80:	  local records
81:	  status, records = helper:discoverTargets()
82:	  if ( not(status) ) then
83:	    stdnse.debug1("failed to discover targets" )
84:	    return
85:	  end
86:	  status = helper:logout()
87:	  status = helper:close()
88:	

Version


This page has been created based on Nmap version 7.92.

Go back to menu.