Nmap cics-user-enum NSE Script
This page contains detailed information about how to use the cics-user-enum NSE script. For list of all NSE scripts, visit the Nmap NSE Library.
Select: |
---|
Script Overview
Script source code: https://github.com/nmap/nmap/tree/master/scripts/cics-user-enum.nse
Script categories: intrusive, brute
Target service / protocol: tn3270
Target network port(s): 23, 992
List of CVEs: -
Script Description
CICS User ID enumeration script for the CESL/CESN Login screen.
Cics-user-enum NSE Script Arguments
This is a full list of arguments supported by the cics-user-enum.nse script:
cics-user-enum.commands
Commands in a semi-colon separated list needed to access CICS. Defaults to CICS
.
By default this script uses the CESL
transaction. on some systems the transactio ID CESN
is needed. Use this argument to change the logon transaction ID.
Path to list of transaction IDs. Defaults to the list of CICS transactions from IBM.
creds.globalCredentials 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
passdbThe filename of an alternate password database. Default: nselib/data/passwords.lst
unpwdb.passlimit
The maximum number of passwords passwords
will return (default unlimited).
The maximum amount of time that any iterator will run before stopping. The value is in seconds by default and you can follow it with ms
, s
, m
, or h
for milliseconds, seconds, minutes, or hours. For example, unpwdb.timelimit=30m
or unpwdb.timelimit=.5h
for 30 minutes. The default depends on the timing template level (see the module description). Use the value 0
to disable the time limit.
The maximum number of usernames usernames
will return (default unlimited).
The filename of an alternate username database. Default: nselib/data/usernames.lst
brute.credfileA file containing username and password pairs delimited by '/'
brute.delayThe number of seconds to wait between guesses (default: 0)
brute.emptypassGuess an empty password for each user (default: false)
brute.firstonlyStop guessing after first password is found (default: false)
brute.guessesThe number of guesses to perform against each account. (default: 0 (unlimited)). The argument can be used to prevent account lockouts.
brute.modeCan be user, pass or creds and determines what mode to run the engine in.
- user - the unpwdb library is used to guess passwords, every password Password is tried for each user. (The user iterator is in the outer loop)
- pass - the unpwdb library is used to guess passwords, each password Is tried for every user. (The password iterator is in the outer loop)
- creds - a set of credentials (username and password pairs) are Guessed against the service. This allows for lists of known or common username and password combinations to be tested. If no mode is specified and the script has not added any custom iterator the pass mode will be enabled.
Iterate over passwords only for services that provide only a password for authentication. (default: false)
brute.retriesThe number of times to retry if recoverable failures occur. (default: 2)
brute.startThe number of threads the engine will start with. (default: 5).
brute.threadsThe number of initial worker threads, the number of active threads will be automatically adjusted.
brute.uniqueMake sure that each password is only guessed once (default: true)
brute.useraspassGuess the username as password for each user (default: true)
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=cics-user-enum --script-args cics-user-enum.commands=value,cics-user-enum.transaction=value <target>
Cics-user-enum NSE Script Example Usage
Here's an example of how to use the cics-user-enum.nse script:
nmap --script=cics-user-enum -p 23 <targets>
nmap --script=cics-user-enum --script-args userdb=users.txt,
cics-user-enum.commands="exit;logon applid(cics42)" -p 23 <targets>
Cics-user-enum NSE Script Example Output
Here's a sample output from the cics-user-enum.nse script:
PORT STATE SERVICE
23/tcp open tn3270
| cics-user-enum:
| Accounts:
| PLAGUE: Valid - CICS User ID
|_ Statistics: Performed 31 guesses in 114 seconds, average tps: 0
Cics-user-enum 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
- https://nmap.org/nsedoc/scripts/cics-user-enum.html
- https://github.com/nmap/nmap/tree/master/scripts/cics-user-enum.nse
See Also
Related NSE scripts to the cics-user-enum.nse script:
Visit Nmap NSE Library for more scripts.
The cics-user-enum.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.
Could not initiate TN3270: %s
Here is a relevant code snippet related to the "Could not initiate TN3270: %s" error message:
62: end,
63: connect = function( self )
64: local status, err = self.tn3270:initiate(self.host,self.port)
65: self.tn3270:get_screen_debug(2)
66: if not status then
67: stdnse.debug("Could not initiate TN3270: %s", err )
68: return false
69: end
70: return true
71: end,
72: disconnect = function( self )
Can't get to Transaction CESN
Here is a relevant code snippet related to the "Can't get to Transaction CESN" error message:
109: self.tn3270:get_screen_debug(2)
110: end
111: -- At this point we MUST be at CESL/CESN to try accounts.
112: -- If we're not then we quit with an error
113: if not (self.tn3270:find('Type your userid and password')) then
114: local err = brute.Error:new( "Can't get to Transaction CESN")
115: err:setRetry( true )
116: return false, err
117: end
118:
119: -- Ok we're good we're at CESL/CESN. Enter the USERID.
Invalid CICS User ID: %s
Here is a relevant code snippet related to the "Invalid CICS User ID: %s" error message:
127: self.tn3270:find('DFHCE3530') then
128: -- known invalid userid messages
129: -- TopSecret: TSS7145E
130: -- ACF2: ACF01004
131: -- RACF: DFHCE3530
132: stdnse.debug("Invalid CICS User ID: %s", string.upper(pass))
133: return false, brute.Error:new( "Incorrect CICS User ID" )
134: elseif self.tn3270:find('TSS7102E') or
135: self.tn3270:find('ACF01012') or
136: self.tn3270:find('DFHCE3523') then
137: -- TopSecret: TSS7102E Password Missing
Incorrect CICS User ID
Here is a relevant code snippet related to the "Incorrect CICS User ID" error message:
128: -- known invalid userid messages
129: -- TopSecret: TSS7145E
130: -- ACF2: ACF01004
131: -- RACF: DFHCE3530
132: stdnse.debug("Invalid CICS User ID: %s", string.upper(pass))
133: return false, brute.Error:new( "Incorrect CICS User ID" )
134: elseif self.tn3270:find('TSS7102E') or
135: self.tn3270:find('ACF01012') or
136: self.tn3270:find('DFHCE3523') then
137: -- TopSecret: TSS7102E Password Missing
138: -- ACF2: ACF01012 PASSWORD NOT MATCHED
Something went wrong, we didn't get a proper response
Here is a relevant code snippet related to the "Something went wrong, we didn't get a proper response" error message:
144: -- The user may be valid for another reason, lets store that reason.
145: stdnse.verbose(2,"User: " .. user .. " MSG:" .. self.tn3270:get_screen():sub(2,80))
146: return true, creds.Account:new("CICS User: ".. string.upper(pass),'Reason: ' .. self.tn3270:get_screen():sub(2,80), creds.State.VALID)
147: end
148:
149: return false, brute.Error:new("Something went wrong, we didn't get a proper response")
150: end
151: }
152:
153: --- Tests the target to see if we can even get to CICS
154: --
Could not initiate TN3270: %s
Here is a relevant code snippet related to the "Could not initiate TN3270: %s" error message:
162: local tn = tn3270.Telnet:new()
163: tn:disable_tn3270e()
164: local status, err = tn:initiate(host,port)
165: local cesl = false -- initially we're not at CICS
166: if not status then
167: stdnse.debug("Could not initiate TN3270: %s", err )
168: return false
169: end
170: tn:get_screen_debug(2) -- prints TN3270 screen to debug
171: stdnse.debug("Getting to CICS")
172: local run = stringaux.strsplit(";%s*", commands)
Could not get to CICS after 5 attempts. Is this even CICS?
Here is a relevant code snippet related to the "Could not get to CICS after 5 attempts. Is this even CICS?" error message:
205: tn:get_all_data()
206: tn:get_screen_debug(2)
207: count = count + 1
208: end
209: if count == 5 then
210: return false, 'Could not get to CICS after 5 attempts. Is this even CICS?'
211: end
212: stdnse.debug(2,"Sending %s", transaction)
213: tn:send_cursor(transaction)
214: tn:get_all_data()
215: if tn:isClear() then
Could not get to '.. transaction ..' (CICS Logon Screen)
Here is a relevant code snippet related to the "Could not get to '.. transaction ..' (CICS Logon Screen)" error message:
221: stdnse.verbose(2,"At CICS Login Transaction (%s)", transaction)
222: tn:disconnect()
223: return true
224: end
225: tn:disconnect()
226: return false, 'Could not get to '.. transaction ..' (CICS Logon Screen)'
227: end
228:
229: -- Filter iterator for unpwdb
230: -- IDs are limited to 8 alpha numeric and @, #, $ and can't start with a number
231: -- pattern:
Version
This page has been created based on Nmap version 7.92.
Go back to menu.