Nmap cics-info NSE Script


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

Script Description


Using the CICS transaction CEMT, this script attempts to gather information about the current CICS transaction server region. It gathers OS information, Datasets (files), transactions and user ids. Based on CICSpwn script by Ayoub ELAASSAL.

Cics-info NSE Script Arguments


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

cics-info.cemt

CICS Transaction ID to be used. Default is CEMT

cics-info.commands

Command used to access cics. Default is cics

cics-info.pass

Password to use if access to CEMT requires authentication

cics-info.trans

Instead of gathering all transaction IDs supplying a name here will make the script only look up one transaction ID

cics-info.user

Username to use if access to CEMT requires authentication

- - -
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=cics-info --script-args cics-info.cemt=value,cics-info.commands=value <target>

Cics-info NSE Script Example Usage


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

nmap --script=cics-info -p 23 <targets>

nmap --script=cics-info --script-args cics-info.commands='logon applid(coolcics)',
cics-info.user=test,cics-info.pass=test,cics-info.cemt='ZEMT',
cics-info.trans=CICA -p 23 <targets>

Cics-info NSE Script Example Output


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

PORT   STATE SERVICE VERSION
23/tcp open  tn3270  IBM Telnet TN3270 (TN3270E)
| cics-info:
|   Security: Disabled
|   System:
|     z/OS Version: 02.01.00
|     CICS Version: 05.02.00
|     System ID: CICS
|     Application ID: CICSFAKE
|     Default User: USERCICS
|   Datasets:
|     CICS.FILEA
|     HLQ123.CICS.DFHCSD
|     HLQ123.CICS.DFHLRQ
|   Libraries:
|     HLQ123.CICS.SDFHLOAD
|   Users:
|     USERCICS
|   Transaction / Program:
|     AADD / DFH$AALL
|     ABRW / DFH$ABRW
|     AINQ / DFH$AALL
|     AMNU / DFH$AMNU
|     AORD / DFH$AREN
|     AORQ / DFH$ACOM
|     AREP / DFH$AREP
|     AUPD / DFH$AALL
|     CADP / DFHDPLU
...
|     CEDX / DFHEDFP
|     CEGN / DFHCEGN
|     CEHP / DFHCHS
|     CEHS / DFHCHS
|     CEJR / DFHEJITL
|     CEMN / DFHCEMNA
|     CEMT / DFHEMTP
|     CEOT / DFHEOTP
|     CXRT / DFHCRT
|     DSNC / DFHD2CM1

Cics-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.

Author


  • Philip Young aka Soldier of Fortran

References


See Also


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

Visit Nmap NSE Library for more scripts.

The cics-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.

Unable to get to CICS


Here is a relevant code snippet related to the "Unable to get to CICS" error message:

92:	
93:	local function cics_info( host, port, commands, user, pass, cemt, trans )
94:	  stdnse.debug("Checking for CICS")
95:	  local tn = tn3270.Telnet:new()
96:	  local status, err = tn:initiate(host,port)
97:	  local msg = 'Unable to get to CICS'
98:	  local more = true
99:	  local count = 1
100:	  local results = stdnse.output_table()
101:	  if not status then
102:	    stdnse.debug("Could not initiate TN3270: %s", err )

Could not initiate TN3270: %s


Here is a relevant code snippet related to the "Could not initiate TN3270: %s" error message:

97:	  local msg = 'Unable to get to CICS'
98:	  local more = true
99:	  local count = 1
100:	  local results = stdnse.output_table()
101:	  if not status then
102:	    stdnse.debug("Could not initiate TN3270: %s", err )
103:	    return false, msg
104:	  end
105:	  tn:get_screen_debug(2) -- prints TN3270 screen to debug
106:	  stdnse.debug("Getting to CICS")
107:	  local run = stringaux.strsplit(";%s*", commands)

Unable to get to CICS. Try --script-args cics-info.commands="logon applid(<applid>)"


Here is a relevant code snippet related to the "Unable to get to CICS. Try --script-args cics-info.commands="logon applid(<applid>)"" error message:

148:	    tn:get_all_data(1000)
149:	  end
150:	  tn:get_screen_debug(2)
151:	
152:	  if not tn:find('off is complete.') then
153:	    return false, 'Unable to get to CICS. Try --script-args cics-info.commands="logon applid(<applid>)"'
154:	  end
155:	
156:	
157:	  if user and pass then -- We're doing authenticated CICS testing now baby!
158:	    stdnse.verbose(2,'Logging in with %s / %s for auth testing', user, pass)

Unable to access CICS with User: '..user..' / Pass:


Here is a relevant code snippet related to the "Unable to access CICS with User: '..user..' / Pass: " error message:

175:	        tn:get_all_data(1000) -- loop for 6 seconds
176:	        tn:get_screen_debug(2)
177:	        count = count + 1
178:	    end
179:	    if not tn:find('DFHCE3549') then
180:	        msg = 'Unable to access CICS with User: '..user..' / Pass: '..pass
181:	        return false, msg
182:	    end
183:	  end
184:	  -- By now it's time to start trying to gather information
185:	  tn:send_clear()

Error


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

200:	  stdnse.verbose(2,"Sending 'CEMT INQUIRE SYSTEM'")
201:	  tn:send_cursor('CEMT INQUIRE SYSTEM')
202:	  tn:get_all_data()
203:	  tn:get_screen_debug(2)
204:	  if tn:find('DFHAC2002') then
205:	    results["Error"] = 'CEMT Access Denied.'
206:	    return true, results
207:	  elseif tn:find('NOT AUTHORIZED') then
208:	    results["System"] = "CEMT 'INQUIRE SYSTEM' Access Denied."
209:	  else
210:	    local sysresults = stdnse.output_table()

Version


This page has been created based on Nmap version 7.92.

Go back to menu.