I'm trying to use the nmap script ssl-dh-params to identify what specific 1024-bit Diffie-Hellman group a TLS server is using. However, the script is not giving me any output at all and I can't figure out why:
C:\Users\user3553031>nmap -p 1234 --script=ssl-dh-params 10.0.0.1
Starting Nmap 7.70 ( https://nmap.org ) at 2018-07-09 17:55 Pacific Daylight Time
Nmap scan report for somehost.somedomain (10.0.0.1)
Host is up (0.022s latency).
PORT STATE SERVICE
1234/tcp open unknown
MAC Address: 01:01:01:01:01:01 (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 3.34 seconds
I know that there is a TLS listener on that port and that it supports DHE ciphersuites: the script ssl-enum-ciphers gives output including the following:
PORT STATE SERVICE REASON
1234/tcp open unknown syn-ack ttl 55
| ssl-enum-ciphers:
| TLSv1.2:
| ciphers:
| TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp256r1) - A
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (secp256r1) - A
| TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024) - A
| TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (dh 1024) - A
| TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048) - A
| TLS_RSA_WITH_AES_256_CBC_SHA256 (rsa 2048) - A
| TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp256r1) - A
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (secp256r1) - A
| TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024) - A
| TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (dh 1024) - A
| TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048) - A
| TLS_RSA_WITH_AES_128_CBC_SHA256 (rsa 2048) - A
| compressors:
| NULL
| cipher preference: server
| warnings:
| Key exchange (dh 1024) of lower strength than certificate key
|_ least strength: A
That also tells me that scripting is not completely broken in my nmap build. I know that the script is installed because when I try to run a script with a nonsense name, I get an error. So it seems that the preconditions to ssl-dh-params are satisfied. Yet I get no output from it, or from nmap to indicate that tried to run that script at all, even when I run nmap with -vvvvv -ddddd.
What's going on? Am I making some mistake? Is the script broken?