Nmap whois-ip NSE Script


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

Script Description


The whois-ip.nse script queries the WHOIS services of Regional Internet Registries (RIR) and attempts to retrieve information about the IP Address Assignment which contains the Target IP Address.

The fields displayed contain information about the assignment and the organisation responsible for managing the address space. When output verbosity is requested on the Nmap command line (-v) extra information about the assignment will be displayed.

To determine which of the RIRs to query for a given Target IP Address this script utilises Assignments Data hosted by IANA. The data is cached locally and then parsed for use as a lookup table. The locally cached files are refreshed periodically to help ensure the data is current. If, for any reason, these files are not available to the script then a default sequence of Whois services are queried in turn until: the desired record is found; or a referral to another (defined) Whois service is found; or until the sequence is exhausted without finding either a referral or the desired record.

The script will recognize a referral to another Whois service if that service is defined in the script and will continue by sending a query to the referred service. A record is assumed to be the desired one if it does not contain a referral.

To reduce the number unnecessary queries sent to Whois services a record cache is employed and the entries in the cache can be applied to any targets within the range of addresses represented in the record.

In certain circumstances, the ability to cache responses prevents the discovery of other, smaller IP address assignments applicable to the target because a cached response is accepted in preference to sending a Whois query. When it is important to ensure that the most accurate information about the IP address assignment is retrieved the script argument whodb should be used with a value of "nocache" (see script arguments). This reduces the range of addresses that may use a cached record to a size that helps ensure that smaller assignments will be discovered. This option should be used with caution due to the potential to send large numbers of whois queries and possibly be banned from using the services.

In using this script your IP address will be sent to iana.org. Additionally your address and the address of the target of the scan will be sent to one of the RIRs.

Whois-ip NSE Script Arguments


This is a full list of arguments supported by the whois-ip.nse script:

whodb

Takes any of the following values, which may be combined:

  • whodb=nofile Prevent the use of IANA assignments data and instead query the default services.
  • whodb=nofollow Ignore referrals and instead display the first record obtained.
  • whodb=nocache Prevent the acceptance of records in the cache when they apply to large ranges of addresses.
  • whodb=[service-ids] Redefine the default services to query. Implies nofile.

smbdomain

The domain to log in with. If you aren't in a domain environment, then anything will (should?) be accepted by the server.

smbhash

A password hash to use when logging in. This is given as a single hex string (32 characters) or a pair of hex strings (both 32 characters, optionally separated by a single character). These hashes are the LanMan or NTLM hash of the user's password, and are stored on disk or in memory. They can be retrieved from memory using the fgdump or pwdump tools.

smbnoguest

Use to disable usage of the 'guest' account.

smbpassword

The password to connect with. Be cautious with this, since some servers will lock accounts if the incorrect password is given. Although it's rare that the Administrator account can be locked out, in the off chance that it can, you could get yourself in trouble. To use a blank password, leave this parameter off altogether.

smbtype

The type of SMB authentication to use. These are the possible options:

  • v1: Sends LMv1 and NTLMv1.
  • LMv1: Sends LMv1 only.
  • NTLMv1: Sends NTLMv1 only (default).
  • v2: Sends LMv2 and NTLMv2.
  • LMv2: Sends LMv2 only.
  • NTLMv2: Doesn't exist; the protocol doesn't support NTLMv2 alone. The default, NTLMv1, is a pretty decent compromise between security and compatibility. If you are paranoid, you might want to use v2 or lmv2 for this. (Actually, if you're paranoid, you should be avoiding this protocol altogether!). If you're using an extremely old system, you might need to set this to v1 or lm, which are less secure but more compatible. For information, see smbauth.lua.

smbusername

The SMB username to log in with. The forms "DOMAIN\username" and "username@DOMAIN" are not understood. To set a domain, use the smbdomain argument.

slaxml.debug

Debug level at which default callbacks will print detailed parsing info. Default: 3

http.host

The value to use in the Host header of all requests unless otherwise set. By default, the Host header uses the output of stdnse.get_hostname().

http.max-body-size

Limit the received body to specific number of bytes. An oversized body results in an error unless script argument http.truncated-ok or request option truncated_ok is set to true. The default is 2097152 (2MB). Use value -1 to disable the limit altogether. This argument can be overridden case-by-case with request option max_body_size.

http.max-cache-size

The maximum memory size (in bytes) of the cache.

http.max-pipeline

If set, it represents the number of outstanding HTTP requests that should be sent together in a single burst. Defaults to http.pipeline (if set), or to what function get_pipeline_limit returns.

http.pipeline

If set, it represents the number of HTTP requests that'll be sent on one connection. This can be set low to make debugging easier, or it can be set high to test how a server reacts (its chosen max is ignored).

http.truncated-ok

Do not treat oversized body as error. (Use response object flag truncated to check if the returned body has been truncated.) This argument can be overridden case-by-case with request option truncated_ok.

http.useragent

The value of the User-Agent header field sent with requests. By default it is "Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)". A value of the empty string disables sending the User-Agent header field.

- - -
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=whois-ip --script-args whodb=value,smbdomain=value <target>

Whois-ip NSE Script Example Usage


Here's an example of how to use the whois-ip.nse script:

# Basic usage:

nmap target --script whois-ip

# To prevent the use of IANA assignments data supply the nofile value
# to the whodb argument:

nmap target --script whois-ip --script-args whodb=nofile

nmap target --script whois-ip --script-args whois.whodb=nofile

# Supplying a sequence of whois services will also prevent the use of
# IANA assignments data and override the default sequence:

nmap target --script whois-ip --script-args whodb=arin+ripe+afrinic

nmap target --script whois-ip --script-args whois.whodb=apnic*lacnic

# The order in which the services are supplied is the order in which
# they will be queried. (N.B. commas or semi-colons should not be
# used to delimit argument values.)

# To return the first record obtained even if it contains a referral
# to another service, supply the nofollow value to whodb:

nmap target --script whois-ip --script-args whodb=nofollow

nmap target --script whois-ip --script-args whois.whodb=nofollow+ripe

# Note that only one service (the first one supplied) will be used in
# conjunction with nofollow.

# To ensure discovery of smaller assignments even if larger ones
# exist in the cache, supply the nocache value to whodb:

nmap target --script whois-ip --script-args whodb=nocache

nmap target --script whois-ip --script-args whois.whodb=nocache

Whois-ip NSE Script Example Output


Here's a sample output from the whois-ip.nse script:

Host script results:
|  whois-ip: Record found at whois.arin.net
|  netrange: 64.13.134.0 - 64.13.134.63
|  netname: NET-64-13-143-0-26
|  orgname: Titan Networks
|  orgid: INSEC
|_ country: US stateprov: CA

Whois-ip 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


  • jah

References


See Also


Related NSE scripts to the whois-ip.nse script:

Visit Nmap NSE Library for more scripts.

The whois-ip.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.

Error in Hostrule: %s.


Here is a relevant code snippet related to the "Error in Hostrule: %s." error message:

101:	
102:	hostrule = function( host )
103:	
104:	  local is_private, err = ipOps.isPrivate( host.ip )
105:	  if is_private == nil then
106:	    stdnse.debug1("Error in Hostrule: %s.", err)
107:	    return false
108:	  end
109:	
110:	  return not is_private
111:	

Error in check_response_cache: Empty Cache Entry was found.


Here is a relevant code snippet related to the "Error in check_response_cache: Empty Cache Entry was found." error message:

351:	    return true, cache_data.redirect
352:	  elseif cache_data.data then
353:	    -- record found in cache
354:	    return true, nil
355:	  else
356:	    stdnse.debug1("Error in check_response_cache: Empty Cache Entry was found.")
357:	  end
358:	
359:	  return false, nil
360:	
361:	end

Error in get_db_from_assignments: Missing assignments data in registry.


Here is a relevant code snippet related to the "Error in get_db_from_assignments: Missing assignments data in registry." error message:

467:	  else
468:	    af = "ipv4"
469:	  end
470:	
471:	  if not nmap.registry.whois.local_assignments_data or not nmap.registry.whois.local_assignments_data[af] then
472:	    stdnse.debug1("Error in get_db_from_assignments: Missing assignments data in registry.")
473:	    return nil
474:	  end
475:	
476:	  if next( nmap.registry.whois.local_assignments_data[af] ) then
477:	    for _, assignment in ipairs( nmap.registry.whois.local_assignments_data[af] ) do

Error in do_query: %s is not a defined Whois service.


Here is a relevant code snippet related to the "Error in do_query: %s is not a defined Whois service." error message:

494:	-- @return    String response to query or nil.
495:	
496:	function do_query(db, ip)
497:	
498:	  if type( db ) ~= "string" or not nmap.registry.whois.whoisdb[db] then
499:	    stdnse.debug1("Error in do_query: %s is not a defined Whois service.", db)
500:	    return nil
501:	  end
502:	
503:	  local service = nmap.registry.whois.whoisdb[db]
504:	

Error in do_query: Invalid hostname for %s.


Here is a relevant code snippet related to the "Error in do_query: Invalid hostname for %s." error message:

501:	  end
502:	
503:	  local service = nmap.registry.whois.whoisdb[db]
504:	
505:	  if type( service.hostname ) ~= "string" or service.hostname == "" then
506:	    stdnse.debug1("Error in do_query: Invalid hostname for %s.", db)
507:	    return nil
508:	  end
509:	
510:	  local query_data = ""
511:	  if type( service.preflag ) == "string" and service.preflag ~= "" then

Connection to %s failed or was aborted! No Output for this Target.


Here is a relevant code snippet related to the "Connection to %s failed or was aborted! No Output for this Target." error message:

517:	  end
518:	  query_data = query_data .. "\n"
519:	
520:	  local socket = nmap.new_socket()
521:	  local catch = function()
522:	    stdnse.debug1("Connection to %s failed or was aborted! No Output for this Target.", db)
523:	    nmap.registry.whois.mutex[db] "done"
524:	    socket:close()
525:	  end
526:	
527:	  local result, status, line = {}

Could not check for objects, problem with meta data.


Here is a relevant code snippet related to the "Could not check for objects, problem with meta data." error message:

593:	  -- do we recognize objects in the response?.
594:	  local have_objects
595:	  if type( meta ) == "table" and type( meta.fieldreq ) == "table" and type( meta.fieldreq.ob_exist ) == "string" then
596:	    have_objects = response:match( meta.fieldreq.ob_exist )
597:	  else
598:	    stdnse.debug2("Could not check for objects, problem with meta data.")
599:	    have_objects = false
600:	  end
601:	
602:	  -- if we do not recognize objects check for an known error/non-object message
603:	  if not have_objects then

%s responded with an ERROR message.


Here is a relevant code snippet related to the "%s responded with an ERROR message." error message:

616:	    -- may have an error
617:	    if not msg then
618:	      for _, pattern in ipairs( nmap.registry.whois.m_err ) do
619:	        msg = response:match( pattern )
620:	        if msg then
621:	          stdnse.debug4("%s responded with an ERROR message.", this_db)
622:	          break
623:	        end
624:	      end
625:	    end
626:	    -- if we've recognized a non-object message,

Error in not_short_prefix: s%.


Here is a relevant code snippet related to the "Error in not_short_prefix: s%." error message:

1072:	  end
1073:	
1074:	  first, last, err[#err+1] = ipOps.get_ips_from_range( range )
1075:	
1076:	  if #err > 0 then
1077:	    stdnse.debug1("Error in not_short_prefix: s%.", table.concat( err, " " ))
1078:	    return nil
1079:	  end
1080:	
1081:	  if ipOps.compare_ip( first, "eq", zero_first ) and ipOps.compare_ip( last, "eq", zero_last ) then
1082:	    return ( get_assignment ( ip, short_prefix ) )

Error in get_assignment: Invalid prefix length.


Here is a relevant code snippet related to the "Error in get_assignment: Invalid prefix length." error message:

1172:	  local some_ip, err = ipOps.ip_to_bin( ip )
1173:	  if err then return nil, err end
1174:	
1175:	  prefix = tonumber( prefix )
1176:	  if not prefix or ( prefix < 0 ) or ( prefix > string.len( some_ip ) ) then
1177:	    return nil, "Error in get_assignment: Invalid prefix length."
1178:	  end
1179:	
1180:	  local hostbits = string.sub( some_ip, prefix + 1 )
1181:	  hostbits = string.gsub( hostbits, "1", "0" )
1182:	  local first = string.sub( some_ip, 1, prefix ) .. hostbits

Error in output(): No data found.


Here is a relevant code snippet related to the "Error in output(): No data found." error message:

1209:	  elseif type( data ) == "table" then
1210:	    return format_data_for_output( data )
1211:	  end
1212:	
1213:	  if type( services_queried ) ~= "table" then
1214:	    stdnse.debug1("Error in output(): No data found.")
1215:	    return nil
1216:	  elseif #services_queried == 0 then
1217:	    stdnse.debug1("Error in output(): No data found, no queries were completed.")
1218:	    return nil
1219:	  elseif #services_queried > 0 then

Error in output(): No data found, no queries were completed.


Here is a relevant code snippet related to the "Error in output(): No data found, no queries were completed." error message:

1212:	
1213:	  if type( services_queried ) ~= "table" then
1214:	    stdnse.debug1("Error in output(): No data found.")
1215:	    return nil
1216:	  elseif #services_queried == 0 then
1217:	    stdnse.debug1("Error in output(): No data found, no queries were completed.")
1218:	    return nil
1219:	  elseif #services_queried > 0 then
1220:	    stdnse.debug1("Error in output(): No data found - could not understand query responses.")
1221:	    return nil
1222:	  end

Error in output(): No data found - could not understand query responses.


Here is a relevant code snippet related to the "Error in output(): No data found - could not understand query responses." error message:

1215:	    return nil
1216:	  elseif #services_queried == 0 then
1217:	    stdnse.debug1("Error in output(): No data found, no queries were completed.")
1218:	    return nil
1219:	  elseif #services_queried > 0 then
1220:	    stdnse.debug1("Error in output(): No data found - could not understand query responses.")
1221:	    return nil
1222:	  end
1223:	
1224:	  return nil -- just to be safe
1225:	

Error in get_output_from_cache().


Here is a relevant code snippet related to the "Error in get_output_from_cache()." error message:

1236:	
1237:	function get_output_from_cache( ip )
1238:	
1239:	  local ip_key = get_cache_key( ip )
1240:	  if not ip_key then
1241:	    stdnse.debug1("Error in get_output_from_cache().")
1242:	    return nil
1243:	  end
1244:	
1245:	  local cache_data = nmap.registry.whois.cache[ip_key]
1246:	

Could not format results for display.


Here is a relevant code snippet related to the "Could not format results for display." error message:

1275:	  if nmap.verbosity() > 0 then
1276:	    display_rules = display_owner.output_long or display_owner.output_short
1277:	  else
1278:	    display_rules = display_owner.output_short or display_owner.output_long
1279:	  end
1280:	  if not display_rules then return "Could not format results for display." end
1281:	
1282:	  output[#output+1] = "Record found at "
1283:	  output[#output+1] = nmap.registry.whois.whoisdb[data.id].hostname
1284:	
1285:	  for _, objects in ipairs( display_rules ) do

(Invalid IP or CIDR block:%s*$addr)


Here is a relevant code snippet related to the "(Invalid IP or CIDR block:%s*$addr)" error message:

1626:	    "\n%s*([Nn]o match found for[%s+]*$addr)",
1627:	    "\n%s*([Uu]nallocated resource:%s*$addr)",
1628:	    "\n%s*([Rr]eserved:%s*$addr)",
1629:	    "\n[^\n]*([Nn]ot%s[Aa]ssigned[^\n]*$addr)",
1630:	    "\n%s*(No match!!)%s*\n",
1631:	    "(Invalid IP or CIDR block:%s*$addr)",
1632:	    "\n%s*%%%s*(Unallocated and unassigned in LACNIC block:%s*$addr)",
1633:	  }
1634:	  nmap.registry.whois.m_err = {
1635:	    "\n%s*([Aa]n [Ee]rror [Oo]ccured)%s*\n",
1636:	    "\n[^\n]*([Ee][Rr][Rr][Oo][Rr][^\n]*)\n"

Cannot use local assignments file for address family %s.


Here is a relevant code snippet related to the "Cannot use local assignments file for address family %s." error message:

1678:	  or nmap.registry.whois.using_local_assignments_file.ipv6 then
1679:	    nmap.registry.whois.local_assignments_data = get_local_assignments_data()
1680:	    for _, af in ipairs({"ipv4", "ipv6"}) do
1681:	      if not nmap.registry.whois.local_assignments_data[af] then
1682:	        nmap.registry.whois.using_local_assignments_file[af] = false
1683:	        stdnse.debug1("Cannot use local assignments file for address family %s.", af)
1684:	      end
1685:	    end
1686:	  end
1687:	
1688:	  nmap.registry.whois.init_done = true

Error in get_local_assignments_data: Remote resources not defined in remote_assignments_files registry key


Here is a relevant code snippet related to the "Error in get_local_assignments_data: Remote resources not defined in remote_assignments_files registry key" error message:

1756:	-- @return  Nil or error message in case of an error.
1757:	
1758:	function get_local_assignments_data()
1759:	
1760:	  if not next( nmap.registry.whois.remote_assignments_files ) then
1761:	    stdnse.debug1("Error in get_local_assignments_data: Remote resources not defined in remote_assignments_files registry key")
1762:	    return nil
1763:	  end
1764:	
1765:	  -- get the directory path where cached files will be stored.
1766:	  local fetchfile = "nmap-services"

Nmap.fetchfile() failed to get a path to %s: %s.


Here is a relevant code snippet related to the "Nmap.fetchfile() failed to get a path to %s: %s." error message:

1764:	
1765:	  -- get the directory path where cached files will be stored.
1766:	  local fetchfile = "nmap-services"
1767:	  local directory_path, err = get_parentpath( fetchfile )
1768:	  if err then
1769:	    stdnse.debug1("Nmap.fetchfile() failed to get a path to %s: %s.", fetchfile, err)
1770:	    return nil
1771:	  end
1772:	
1773:	  local ret = {}
1774:	

Failed whilst requesting %s.


Here is a relevant code snippet related to the "Failed whilst requesting %s." error message:

1802:	      -- cache or update and then read into file_content
1803:	      local http_response, write_success
1804:	      if update_required then
1805:	        http_response = ( conditional_download( assignment_data_spec.remote_resource, modified_date, entity_tag ) )
1806:	        if not http_response or type( http_response.status ) ~= "number" then
1807:	          stdnse.debug1("Failed whilst requesting %s.", assignment_data_spec.remote_resource)
1808:	        elseif http_response.status == 200 then
1809:	          -- prepend our file header
1810:	          stdnse.debug2("Retrieved %s.", assignment_data_spec.remote_resource)
1811:	          file_content = stringaux.strsplit( "\r?\n", http_response.body )
1812:	          table.insert( file_content, 1, "** Do Not Alter This Line or The Following Line **" )

Error writing %s to %s: %s.


Here is a relevant code snippet related to the "Error writing %s to %s: %s." error message:

1817:	            hline[#hline+1] = "<" .. http_response.header.etag .. ">"
1818:	          end
1819:	          table.insert( file_content, 2, table.concat( hline ) )
1820:	          write_success, err = write_to_file( file, file_content )
1821:	          if err then
1822:	            stdnse.debug1("Error writing %s to %s: %s.", assignment_data_spec.remote_resource, file, err)
1823:	          end
1824:	        elseif http_response.status == 304 then
1825:	          -- update our file header with a new timestamp
1826:	          stdnse.debug1("%s is up-to-date.", file)
1827:	          file_content = read_from_file( file )

Error writing to %s: %s.


Here is a relevant code snippet related to the "Error writing to %s: %s." error message:

1826:	          stdnse.debug1("%s is up-to-date.", file)
1827:	          file_content = read_from_file( file )
1828:	          file_content[2] = file_content[2]:gsub("^<[-+]?%d+>(.*)$", "<" .. os.time() .. ">%1")
1829:	          write_success, err = write_to_file( file, file_content )
1830:	          if err then
1831:	            stdnse.debug1("Error writing to %s: %s.", file, err)
1832:	          end
1833:	        else
1834:	          stdnse.debug1("HTTP %s whilst requesting %s.", http_response.status, assignment_data_spec.remote_resource)
1835:	        end
1836:	      end

Problem with the data in %s.


Here is a relevant code snippet related to the "Problem with the data in %s." error message:

1843:	        local t
1844:	        t, err = parse_assignments( assignment_data_spec, file_content )
1845:	        if #t == 0 or err then
1846:	          -- good header, but bad file?  Kill the file!
1847:	          write_to_file( file, "" )
1848:	          stdnse.debug1("Problem with the data in %s.", file)
1849:	        else
1850:	          for i, v in pairs( t ) do
1851:	            ret[address_family][#ret[address_family]+1] = v
1852:	          end
1853:	        end

Error in get_parentpath: Expected fname as a string.


Here is a relevant code snippet related to the "Error in get_parentpath: Expected fname as a string." error message:

1880:	-- @return       Nil or error message in case of an error.
1881:	
1882:	function get_parentpath( fname )
1883:	
1884:	  if type( fname ) ~= "string" or fname == "" then
1885:	    return nil, "Error in get_parentpath: Expected fname as a string."
1886:	  end
1887:	
1888:	  local path = nmap.fetchfile( fname )
1889:	  if not path then
1890:	    return nil, "Error in get_parentpath: Call to fetchfile() failed."

Error in get_parentpath: Call to fetchfile() failed.


Here is a relevant code snippet related to the "Error in get_parentpath: Call to fetchfile() failed." error message:

1885:	    return nil, "Error in get_parentpath: Expected fname as a string."
1886:	  end
1887:	
1888:	  local path = nmap.fetchfile( fname )
1889:	  if not path then
1890:	    return nil, "Error in get_parentpath: Call to fetchfile() failed."
1891:	  end
1892:	
1893:	  path = path:sub( 1, path:len() - fname:len() )
1894:	  return path
1895:	

Error in read_from_file: Expected file as a string.


Here is a relevant code snippet related to the "Error in read_from_file: Expected file as a string." error message:

2004:	-- @return      Nil or error message in case of an error.
2005:	
2006:	function read_from_file( file )
2007:	
2008:	  if type( file ) ~= "string" or file == "" then
2009:	    return nil, "Error in read_from_file: Expected file as a string."
2010:	  end
2011:	
2012:	  local f, err, _ = io.open( file, "r" )
2013:	  if not f then
2014:	    stdnse.debug1("Error opening %s for reading: %s", file, err)

Error opening %s for reading: %s


Here is a relevant code snippet related to the "Error opening %s for reading: %s" error message:

2009:	    return nil, "Error in read_from_file: Expected file as a string."
2010:	  end
2011:	
2012:	  local f, err, _ = io.open( file, "r" )
2013:	  if not f then
2014:	    stdnse.debug1("Error opening %s for reading: %s", file, err)
2015:	    return nil, err
2016:	  end
2017:	
2018:	  local line, ret = nil, {}
2019:	  while true do

Error in conditional_download: Expected url as a string.


Here is a relevant code snippet related to the "Error in conditional_download: Expected url as a string." error message:

2041:	-- @see             http.request
2042:	
2043:	function conditional_download( url, mod_date, e_tag )
2044:	
2045:	  if type( url ) ~= "string" or url == "" then
2046:	    return nil, "Error in conditional_download: Expected url as a string."
2047:	  end
2048:	
2049:	  -- mod_date and e_tag allowed to be nil or a non-empty string
2050:	  if mod_date and ( type( mod_date ) ~= "string" or mod_date == "" ) then
2051:	    return nil, "Error in conditional_download: Expected mod_date as nil or as a non-empty string."

Error in conditional_download: Expected mod_date as nil or as a non-empty string.


Here is a relevant code snippet related to the "Error in conditional_download: Expected mod_date as nil or as a non-empty string." error message:

2046:	    return nil, "Error in conditional_download: Expected url as a string."
2047:	  end
2048:	
2049:	  -- mod_date and e_tag allowed to be nil or a non-empty string
2050:	  if mod_date and ( type( mod_date ) ~= "string" or mod_date == "" ) then
2051:	    return nil, "Error in conditional_download: Expected mod_date as nil or as a non-empty string."
2052:	  end
2053:	  if e_tag and ( type( e_tag ) ~= "string" or e_tag == "" ) then
2054:	    return nil, "Error in conditional_download: Expected e_tag as nil or as a non-empty string."
2055:	  end
2056:	

Error in conditional_download: Expected e_tag as nil or as a non-empty string.


Here is a relevant code snippet related to the "Error in conditional_download: Expected e_tag as nil or as a non-empty string." error message:

2049:	  -- mod_date and e_tag allowed to be nil or a non-empty string
2050:	  if mod_date and ( type( mod_date ) ~= "string" or mod_date == "" ) then
2051:	    return nil, "Error in conditional_download: Expected mod_date as nil or as a non-empty string."
2052:	  end
2053:	  if e_tag and ( type( e_tag ) ~= "string" or e_tag == "" ) then
2054:	    return nil, "Error in conditional_download: Expected e_tag as nil or as a non-empty string."
2055:	  end
2056:	
2057:	  -- use e_tag in preference to mod_date
2058:	  local request_options = {}
2059:	  request_options.header = {}

Error in write_to_file: Expected file as a string.


Here is a relevant code snippet related to the "Error in write_to_file: Expected file as a string." error message:

2090:	-- @return         Nil or error message in case of an error.
2091:	
2092:	function write_to_file( file, content )
2093:	
2094:	  if type( file ) ~= "string" or file == "" then
2095:	    return nil, "Error in write_to_file: Expected file as a string."
2096:	  end
2097:	  if type( content ) ~= "string" and type( content ) ~= "table" then
2098:	    return nil, "Error in write_to_file: Expected content as a table or string."
2099:	  end
2100:	

Error in write_to_file: Expected content as a table or string.


Here is a relevant code snippet related to the "Error in write_to_file: Expected content as a table or string." error message:

2093:	
2094:	  if type( file ) ~= "string" or file == "" then
2095:	    return nil, "Error in write_to_file: Expected file as a string."
2096:	  end
2097:	  if type( content ) ~= "string" and type( content ) ~= "table" then
2098:	    return nil, "Error in write_to_file: Expected content as a table or string."
2099:	  end
2100:	
2101:	  local f, err, _ = io.open( file, "w" )
2102:	  if not f then
2103:	    stdnse.debug1("Error opening %s for writing: %s.", file, err)

Error opening %s for writing: %s.


Here is a relevant code snippet related to the "Error opening %s for writing: %s." error message:

2098:	    return nil, "Error in write_to_file: Expected content as a table or string."
2099:	  end
2100:	
2101:	  local f, err, _ = io.open( file, "w" )
2102:	  if not f then
2103:	    stdnse.debug1("Error opening %s for writing: %s.", file, err)
2104:	    return nil, err
2105:	  end
2106:	
2107:	  if ( type( content ) == "table" ) then
2108:	    content = table.concat( content, "\n" ) or ""

Error in parse_assignments: Expected table_of_lines as a non-empty table.


Here is a relevant code snippet related to the "Error in parse_assignments: Expected table_of_lines as a non-empty table." error message:

2125:	-- @return                     Nil or error message in case of an error.
2126:	
2127:	function parse_assignments( address_family_spec, table_of_lines )
2128:	
2129:	  if #table_of_lines < 1 then
2130:	    return nil, "Error in parse_assignments: Expected table_of_lines as a non-empty table."
2131:	  end
2132:	
2133:	  local mnetwork = address_family_spec.match_assignment
2134:	  local mservice = address_family_spec.match_service
2135:	

Version


This page has been created based on Nmap version 7.92.

Go back to menu.