Nmap icap-info NSE Script


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

Script Description


The icap-info.nse script tests a list of known ICAP service names and prints information about any it detects. The Internet Content Adaptation Protocol (ICAP) is used to extend transparent proxy servers and is generally used for content filtering and antivirus scanning.

Icap-info NSE Script Arguments


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

Icap-info NSE Script Example Usage


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

nmap -p 1344 <ip> --script icap-info

Icap-info NSE Script Example Output


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

PORT     STATE SERVICE
1344/tcp open  unknown
| icap-info:
|   /avscan
|     Service: C-ICAP/0.1.6 server - Clamav/Antivirus service
|     ISTag: CI0001-000-0973-6314940
|   /echo
|     Service: C-ICAP/0.1.6 server - Echo demo service
|     ISTag: CI0001-XXXXXXXXX
|   /srv_clamav
|     Service: C-ICAP/0.1.6 server - Clamav/Antivirus service
|     ISTag: CI0001-000-0973-6314940
|   /url_check
|     Service: C-ICAP/0.1.6 server - Url_Check demo service
|_    ISTag: CI0001-XXXXXXXXX

Icap-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


  • Patrik Karlsson

References


See Also


Visit Nmap NSE Library for more scripts.

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

Received an invalid response from server


Here is a relevant code snippet related to the "Received an invalid response from server" error message:

51:	
52:	  local resp_p = { header = {}, rawheader = {} }
53:	  local resp_tbl = stringaux.strsplit("\r?\n", resp)
54:	
55:	  if ( not(resp_tbl) or #resp_tbl == 0 ) then
56:	    stdnse.debug2("Received an invalid response from server")
57:	    return
58:	  end
59:	
60:	  resp_p.status = tonumber(resp_tbl[1]:match("^ICAP/1%.0 (%d*) .*$"))
61:	  resp_p['status-line'] = resp_tbl[1]

Failed to parse header: %s


Here is a relevant code snippet related to the "Failed to parse header: %s" error message:

61:	  resp_p['status-line'] = resp_tbl[1]
62:	
63:	  for i=2, #resp_tbl do
64:	    local key, val = resp_tbl[i]:match("^([^:]*):%s*(.*)$")
65:	    if ( not(key) or not(val) ) then
66:	      stdnse.debug2("Failed to parse header: %s", resp_tbl[i])
67:	    else
68:	      resp_p.header[key:lower()] = val
69:	    end
70:	    table.insert(resp_p.rawheader, resp_tbl[i])
71:	  end

Failed to connect to server


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

87:	
88:	  for _, service in ipairs(services) do
89:	    local socket = nmap.new_socket()
90:	    socket:set_timeout(5000)
91:	    if ( not(socket:connect(host, port)) ) then
92:	      return fail("Failed to connect to server")
93:	    end
94:	
95:	    local request = (table.concat(probe, "\r\n") .. "\r\n\r\n"):format(hostname, service, hostname)
96:	
97:	    if ( not(socket:send(request)) ) then

Failed to send request to server


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

94:	
95:	    local request = (table.concat(probe, "\r\n") .. "\r\n\r\n"):format(hostname, service, hostname)
96:	
97:	    if ( not(socket:send(request)) ) then
98:	      socket:close()
99:	      return fail("Failed to send request to server")
100:	    end
101:	
102:	    local status, resp = socket:receive_buf(match.pattern_limit("\r\n\r\n", 2048), false)
103:	    if ( not(status) ) then
104:	      return fail("Failed to receive response from server")

Failed to receive response from server


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

99:	      return fail("Failed to send request to server")
100:	    end
101:	
102:	    local status, resp = socket:receive_buf(match.pattern_limit("\r\n\r\n", 2048), false)
103:	    if ( not(status) ) then
104:	      return fail("Failed to receive response from server")
105:	    end
106:	
107:	    local resp_p = parseResponse(resp)
108:	    if ( resp_p and resp_p.status == 200 ) then
109:	      local result_part = { name = service }

Version


This page has been created based on Nmap version 7.92.

Go back to menu.