Nmap ssl-enum-ciphers NSE Script


This page contains detailed information about how to use the ssl-enum-ciphers 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/ssl-enum-ciphers.nse
Script categories: discovery, intrusive
Target service / protocol: ssl
Target network port(s): 261, 271, 324, 443, 465, 563, 585, 636, 853, 989, 990, 992, 993, 994, 995, 2221, 2252, 2376, 3269, 3389, 4911, 5061, 5986, 6679, 6697, 8443, 9001, 8883
List of CVEs: CVE-2014-3566

Script Description


The ssl-enum-ciphers.nse script repeatedly initiates SSLv3/TLS connections, each time trying a new cipher or compressor while recording whether a host accepts or rejects it. The end result is a list of all the ciphersuites and compressors that a server accepts.

Each ciphersuite is shown with a letter grade (A through F) indicating the strength of the connection. The grade is based on the cryptographic strength of the key exchange and of the stream cipher. The message integrity (hash) algorithm choice is not a factor. The output line beginning with Least strength shows the strength of the weakest cipher offered. The scoring is based on the Qualys SSL Labs SSL Server Rating Guide, but does not take protocol support (TLS version) into account, which makes up 30% of the SSL Labs rating.

SSLv3/TLSv1 requires more effort to determine which ciphers and compression methods a server supports than SSLv2. A client lists the ciphers and compressors that it is capable of supporting, and the server will respond with a single cipher and compressor chosen, or a rejection notice.

Some servers use the client's ciphersuite ordering: they choose the first of the client's offered suites that they also support. Other servers prefer their own ordering: they choose their most preferred suite from among those the client offers. In the case of server ordering, the script makes extra probes to discover the server's sorted preference list. Otherwise, the list is sorted alphabetically.

The script will warn about certain SSL misconfigurations such as MD5-signed certificates, low-quality ephemeral DH parameters, and the POODLE vulnerability.

This script is intrusive since it must initiate many connections to a server, and therefore is quite noisy.

It is recommended to use this script in conjunction with version detection (-sV) in order to discover SSL/TLS services running on unexpected ports. For the most common SSL ports like 443, 25 (with STARTTLS), 3389, etc. the script is smart enough to run on its own.

References:

Ssl-enum-ciphers NSE Script Arguments


This is a full list of arguments supported by the ssl-enum-ciphers.nse script:

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.

randomseed

Set to a value to change the filenames/service names that are randomly generated.

smbbasic

Forces the authentication to use basic security, as opposed to "extended security". Against most modern systems, extended security should work, but there may be cases where you want to force basic. There's a chance that you'll get better results for enumerating users if you turn on basic authentication.

smbport

Override the default port choice. If smbport is open, it's used. It's assumed to be the same protocol as port 445, not port 139. Since it probably isn't possible to change Windows' ports normally, this is mostly useful if you're bouncing through a relay or something.

smbsign

Controls whether or not server signatures are checked in SMB packets. By default, on Windows, server signatures aren't enabled or required. By default, this library will always sign packets if it knows how, and will check signatures if the server says to. Possible values are:

  • force: Always check server signatures, even if server says it doesn't support them (will Probably fail, but is technically more secure).
  • negotiate: [default] Use signatures if server supports them.
  • ignore: Never check server signatures. Not recommended.
  • disable: Don't send signatures, at all, and don't check the server's. not recommended. More information on signatures can be found in smbauth.lua.

mssql.domain

The domain against which to perform integrated authentication. When set, the scripts assume integrated authentication should be performed, rather than the default sql login.

mssql.instance-all

Targets all SQL server instances discovered through the browser service.

mssql.instance-name

The name of the instance to connect to.

mssql.instance-port

The port of the instance to connect to.

mssql.password

The password for mssql.username. If this argument is not given but mssql.username, a blank password is used.

mssql.protocol

The protocol to use to connect to the instance. The protocol may be either NP,Named Pipes or TCP.

mssql.scanned-ports-only

If set, the script will only connect to ports that were included in the Nmap scan. This may result in instances not being discovered, particularly if UDP port 1434 is not included. Additionally, instances that are found to be running on ports that were not scanned (e.g. if 1434/udp is in the scan and the SQL Server Browser service on that port reports an instance listening on 43210/tcp, which was not scanned) will be reported but will not be stored for use by other ms-sql-* scripts.

mssql.timeout

How long to wait for SQL responses. This is a number followed by ms for milliseconds, s for seconds, m for minutes, or h for hours. Default: 30s.

mssql.username

The username to use to connect to SQL Server instances. This username is used by scripts taking actions that require authentication (e.g. ms-sql-query) This username (and its associated password) takes precedence over any credentials discovered by the ms-sql-brute and ms-sql-empty-password scripts.

smtp.domain

The domain to be returned by get_domain, overriding the target's own domain name.

tls.servername

Hostname to use in the Server Name Indication (SNI) extension. Overrides the target name given on the command line and affects all targets.

- - -
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=ssl-enum-ciphers --script-args smbdomain=value,smbhash=value <target>

Ssl-enum-ciphers NSE Script Example Usage


Here's an example of how to use the ssl-enum-ciphers.nse script:

nmap -sV --script ssl-enum-ciphers -p 443 <host>

Ssl-enum-ciphers NSE Script Example Output


Here's a sample output from the ssl-enum-ciphers.nse script:

PORT    STATE SERVICE REASON
443/tcp open  https   syn-ack
| ssl-enum-ciphers:
|   TLSv1.0:
|     ciphers:
|       TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|       TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (secp256r1) - C
|       TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (secp256r1) - C
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
|       TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (secp256r1) - C
|       TLS_ECDHE_RSA_WITH_RC4_128_SHA (secp256r1) - C
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       64-bit block cipher 3DES vulnerable to SWEET32 attack
|       Broken cipher RC4 is deprecated by RFC 7465
|       Ciphersuite uses MD5 for message integrity
|       Weak certificate signature: SHA1
|   TLSv1.2:
|     ciphers:
|       TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (secp256r1) - A
|       TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (secp256r1) - A
|       TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|       TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (secp256r1) - C
|       TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (secp256r1) - C
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
|       TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (secp256r1) - C
|       TLS_ECDHE_RSA_WITH_RC4_128_SHA (secp256r1) - C
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       64-bit block cipher 3DES vulnerable to SWEET32 attack
|       Broken cipher RC4 is deprecated by RFC 7465
|       Ciphersuite uses MD5 for message integrity
|_  least strength: C

Ssl-enum-ciphers NSE Script Example XML Output


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

 <table key="TLSv1.0">
   <table key="ciphers">
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_RC4_128_MD5</elem>
       <elem key="strength">C</elem>
     </table>
   </table>
   <table key="compressors">
     <elem>NULL</elem>
   </table>
   <elem key="cipher preference">server</elem>
   <table key="warnings">
     <elem>64-bit block cipher 3DES vulnerable to SWEET32 attack</elem>
     <elem>Broken cipher RC4 is deprecated by RFC 7465</elem>
     <elem>Ciphersuite uses MD5 for message integrity</elem>
     <elem>Weak certificate signature: SHA1</elem>
   </table>
 </table>
 <table key="TLSv1.2">
   <table key="ciphers">
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">
       TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">
       TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_128_GCM_SHA256</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_256_GCM_SHA384</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_128_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_AES_256_CBC_SHA</elem>
       <elem key="strength">A</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_3DES_EDE_CBC_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_ECDSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">secp256r1</elem>
       <elem key="name">TLS_ECDHE_RSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_RC4_128_SHA</elem>
       <elem key="strength">C</elem>
     </table>
     <table>
       <elem key="kex_info">rsa 2048</elem>
       <elem key="name">TLS_RSA_WITH_RC4_128_MD5</elem>
       <elem key="strength">C</elem>
     </table>
   </table>
   <table key="compressors">
     <elem>NULL</elem>
   </table>
   <elem key="cipher preference">server</elem>
   <table key="warnings">
     <elem>64-bit block cipher 3DES vulnerable to SWEET32 attack</elem>
     <elem>Broken cipher RC4 is deprecated by RFC 7465</elem>
     <elem>Ciphersuite uses MD5 for message integrity</elem>
   </table>
 </table>
 <elem key="least strength">C</elem>

Authors


References


See Also


Related NSE scripts to the ssl-enum-ciphers.nse script:

Visit Nmap NSE Library for more scripts.

The ssl-enum-ciphers.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.

Ciphersuite uses MD5 for message integrity


Here is a relevant code snippet related to the "Ciphersuite uses MD5 for message integrity" error message:

685:	          table.insert(results, name)
686:	          if scores then
687:	            local info = tls.cipher_info(name)
688:	            -- Some warnings:
689:	            if info.hash and info.hash == "MD5" then
690:	              scores.warnings["Ciphersuite uses MD5 for message integrity"] = true
691:	            end
692:	            if info.mode and info.mode == "CBC" and info.block_size <= 64 then
693:	              scores.warnings[("64-bit block cipher %s vulnerable to SWEET32 attack"):format(info.cipher)] = true
694:	            end
695:	            if protocol == "SSLv3" and  info.mode and info.mode == "CBC" then

64-bit block cipher %s vulnerable to SWEET32 attack


Here is a relevant code snippet related to the "64-bit block cipher %s vulnerable to SWEET32 attack" error message:

688:	            -- Some warnings:
689:	            if info.hash and info.hash == "MD5" then
690:	              scores.warnings["Ciphersuite uses MD5 for message integrity"] = true
691:	            end
692:	            if info.mode and info.mode == "CBC" and info.block_size <= 64 then
693:	              scores.warnings[("64-bit block cipher %s vulnerable to SWEET32 attack"):format(info.cipher)] = true
694:	            end
695:	            if protocol == "SSLv3" and  info.mode and info.mode == "CBC" then
696:	              scores.warnings["CBC-mode cipher in SSLv3 (CVE-2014-3566)"] = true
697:	            elseif info.cipher == "RC4" then
698:	              scores.warnings["Broken cipher RC4 is deprecated by RFC 7465"] = true

CBC-mode cipher in SSLv3 (CVE-2014-3566)


Here is a relevant code snippet related to the "CBC-mode cipher in SSLv3 (CVE-2014-3566)" error message:

691:	            end
692:	            if info.mode and info.mode == "CBC" and info.block_size <= 64 then
693:	              scores.warnings[("64-bit block cipher %s vulnerable to SWEET32 attack"):format(info.cipher)] = true
694:	            end
695:	            if protocol == "SSLv3" and  info.mode and info.mode == "CBC" then
696:	              scores.warnings["CBC-mode cipher in SSLv3 (CVE-2014-3566)"] = true
697:	            elseif info.cipher == "RC4" then
698:	              scores.warnings["Broken cipher RC4 is deprecated by RFC 7465"] = true
699:	            end
700:	            if protocol == "TLSv1.3" and not info.tls13ok then
701:	              scores.warnings["Non-TLSv1.3 ciphersuite chosen for TLSv1.3"] = true

Broken cipher RC4 is deprecated by RFC 7465


Here is a relevant code snippet related to the "Broken cipher RC4 is deprecated by RFC 7465" error message:

693:	              scores.warnings[("64-bit block cipher %s vulnerable to SWEET32 attack"):format(info.cipher)] = true
694:	            end
695:	            if protocol == "SSLv3" and  info.mode and info.mode == "CBC" then
696:	              scores.warnings["CBC-mode cipher in SSLv3 (CVE-2014-3566)"] = true
697:	            elseif info.cipher == "RC4" then
698:	              scores.warnings["Broken cipher RC4 is deprecated by RFC 7465"] = true
699:	            end
700:	            if protocol == "TLSv1.3" and not info.tls13ok then
701:	              scores.warnings["Non-TLSv1.3 ciphersuite chosen for TLSv1.3"] = true
702:	            end
703:	            local kex = tls.KEX_ALGORITHMS[info.kex]

Non-TLSv1.3 ciphersuite chosen for TLSv1.3


Here is a relevant code snippet related to the "Non-TLSv1.3 ciphersuite chosen for TLSv1.3" error message:

696:	              scores.warnings["CBC-mode cipher in SSLv3 (CVE-2014-3566)"] = true
697:	            elseif info.cipher == "RC4" then
698:	              scores.warnings["Broken cipher RC4 is deprecated by RFC 7465"] = true
699:	            end
700:	            if protocol == "TLSv1.3" and not info.tls13ok then
701:	              scores.warnings["Non-TLSv1.3 ciphersuite chosen for TLSv1.3"] = true
702:	            end
703:	            local kex = tls.KEX_ALGORITHMS[info.kex]
704:	            scores.any_pfs_ciphers = kex.pfs or scores.any_pfs_ciphers
705:	            local extra, kex_strength
706:	            if kex.export then

Export key exchange


Here is a relevant code snippet related to the "Export key exchange" error message:

702:	            end
703:	            local kex = tls.KEX_ALGORITHMS[info.kex]
704:	            scores.any_pfs_ciphers = kex.pfs or scores.any_pfs_ciphers
705:	            local extra, kex_strength
706:	            if kex.export then
707:	              scores.warnings["Export key exchange"] = true
708:	              if info.kex:find("1024$") then
709:	                kex_strength = 1024
710:	              else
711:	                kex_strength = 512
712:	              end

Anonymous key exchange, score capped at F


Here is a relevant code snippet related to the "Anonymous key exchange, score capped at F" error message:

710:	              else
711:	                kex_strength = 512
712:	              end
713:	            end
714:	            if kex.anon then
715:	              scores.warnings["Anonymous key exchange, score capped at F"] = true
716:	              kex_strength = 0
717:	            elseif have_ssl and kex.pubkey then
718:	              local certs = get_body(handshake, "type", "certificate")
719:	              -- Assume RFC compliance:
720:	              -- "The sender's certificate MUST come first in the list."

Failed to parse certificate: %s


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

726:	                err = "no certificate message"
727:	              else
728:	                c, err = sslcert.parse_ssl_certificate(certs.certificates[1])
729:	              end
730:	              if not c then
731:	                ctx_log(1, protocol, "Failed to parse certificate: %s", err)
732:	              elseif c.pubkey.type == kex.pubkey then
733:	                local sigalg = c.sig_algorithm:match("([mM][dD][245])") or c.sig_algorithm:match("([sS][hH][aA]1)")
734:	                if sigalg then
735:	                  kex_strength = 0
736:	                  scores.warnings[("Insecure certificate signature (%s), score capped at F"):format(string.upper(sigalg))] = true

Insecure certificate signature (%s), score capped at F


Here is a relevant code snippet related to the "Insecure certificate signature (%s), score capped at F" error message:

731:	                ctx_log(1, protocol, "Failed to parse certificate: %s", err)
732:	              elseif c.pubkey.type == kex.pubkey then
733:	                local sigalg = c.sig_algorithm:match("([mM][dD][245])") or c.sig_algorithm:match("([sS][hH][aA]1)")
734:	                if sigalg then
735:	                  kex_strength = 0
736:	                  scores.warnings[("Insecure certificate signature (%s), score capped at F"):format(string.upper(sigalg))] = true
737:	                end
738:	                local rsa_bits = tls.rsa_equiv(kex.pubkey, c.pubkey.bits)
739:	                kex_strength = math.min(kex_strength or rsa_bits, rsa_bits)
740:	                if c.pubkey.exponent then
741:	                  if openssl.bignum_bn2dec(c.pubkey.exponent) == "1" then

Certificate RSA exponent is 1, score capped at F


Here is a relevant code snippet related to the "Certificate RSA exponent is 1, score capped at F" error message:

738:	                local rsa_bits = tls.rsa_equiv(kex.pubkey, c.pubkey.bits)
739:	                kex_strength = math.min(kex_strength or rsa_bits, rsa_bits)
740:	                if c.pubkey.exponent then
741:	                  if openssl.bignum_bn2dec(c.pubkey.exponent) == "1" then
742:	                    kex_strength = 0
743:	                    scores.warnings["Certificate RSA exponent is 1, score capped at F"] = true
744:	                  end
745:	                end
746:	                if c.pubkey.ecdhparams then
747:	                  if c.pubkey.ecdhparams.curve_params.ec_curve_type == "namedcurve" then
748:	                    extra = c.pubkey.ecdhparams.curve_params.curve

Certificate RSA exponent is 1, score capped at F


Here is a relevant code snippet related to the "Certificate RSA exponent is 1, score capped at F" error message:

785:	                end
786:	                kex_strength = math.min(kex_strength or rsa_bits, rsa_bits)
787:	              end
788:	              if kex_info.rsa and kex_info.rsa.exponent == 1 then
789:	                kex_strength = 0
790:	                scores.warnings["Certificate RSA exponent is 1, score capped at F"] = true
791:	              end
792:	            end
793:	            scores[name] = {
794:	              cipher_strength=info.size,
795:	              kex_strength = kex_strength,

Forward Secrecy not supported by any cipher


Here is a relevant code snippet related to the "Forward Secrecy not supported by any cipher" error message:

843:	    for _, name in ipairs(chunk) do
844:	      table.insert(results, name)
845:	    end
846:	  end
847:	  if not next(results) then return nil end
848:	  scores.warnings["Forward Secrecy not supported by any cipher"] = (not scores.any_pfs_ciphers) or nil
849:	  scores.any_pfs_ciphers = nil
850:	
851:	  return results, scores
852:	end
853:	

compare %s %s -> error


Here is a relevant code snippet related to the "compare %s %s -> error" error message:

934:	  local server_hello = records.handshake and get_body(records.handshake, "type", "server_hello")
935:	  if server_hello then
936:	    ctx_log(2, protocol, "compare %s %s -> %s", cipher_a, cipher_b, server_hello.cipher)
937:	    return server_hello.cipher
938:	  else
939:	    ctx_log(2, protocol, "compare %s %s -> error", cipher_a, cipher_b)
940:	    return nil, string.format("Error when comparing %s and %s", cipher_a, cipher_b)
941:	  end
942:	end
943:	
944:	-- Try to find whether the server prefers its own ciphersuite order or that of

Error when comparing %s and %s


Here is a relevant code snippet related to the "Error when comparing %s and %s" error message:

935:	  if server_hello then
936:	    ctx_log(2, protocol, "compare %s %s -> %s", cipher_a, cipher_b, server_hello.cipher)
937:	    return server_hello.cipher
938:	  else
939:	    ctx_log(2, protocol, "compare %s %s -> error", cipher_a, cipher_b)
940:	    return nil, string.format("Error when comparing %s and %s", cipher_a, cipher_b)
941:	  end
942:	end
943:	
944:	-- Try to find whether the server prefers its own ciphersuite order or that of
945:	-- the client.

Network error


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

983:	  local chunks = {}
984:	  for _, group in ipairs(in_chunks(ciphers, get_chunk_size(host, protocol))) do
985:	    local size = #group
986:	    local chunk = find_ciphers_group(host, port, protocol, group)
987:	    if not chunk then
988:	      return nil, "Network error"
989:	    end
990:	    if #chunk ~= size then
991:	      ctx_log(1, protocol, "warning: %d ciphers offered but only %d accepted", size, #chunk)
992:	    end
993:	    table.insert(chunks, chunk)

warning: %d ciphers offered but only %d accepted


Here is a relevant code snippet related to the "warning: %d ciphers offered but only %d accepted" error message:

986:	    local chunk = find_ciphers_group(host, port, protocol, group)
987:	    if not chunk then
988:	      return nil, "Network error"
989:	    end
990:	    if #chunk ~= size then
991:	      ctx_log(1, protocol, "warning: %d ciphers offered but only %d accepted", size, #chunk)
992:	    end
993:	    table.insert(chunks, chunk)
994:	  end
995:	
996:	  -- The comparison operator for the merge is a 2-cipher ClientHello.

cipher preference error


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

1082:	    table.sort(compressors)
1083:	  end
1084:	  results["compressors"] = compressors
1085:	
1086:	  results["cipher preference"] = cipher_pref
1087:	  results["cipher preference error"] = cipher_pref_err
1088:	  if next(scores.warnings) then
1089:	    results["warnings"] = sorted_keys(scores.warnings)
1090:	  end
1091:	
1092:	  upresults[protocol] = results

Version


This page has been created based on Nmap version 7.92.

Go back to menu.