Commit Graph

669 Commits

Author SHA1 Message Date
Dirk Wetter
48f2dc20a6 Merge pull request #428 from dcooper16/determine_optimal_proto_ssl2_fix
SSLv2 fixes for determine_optimal_proto()
2016-07-26 18:29:49 +02:00
Dirk Wetter
3f550d14cf Merge pull request #429 from dcooper16/old_openssl_warning
Don't ignore response to old OpenSSL warning
2016-07-26 18:27:33 +02:00
David Cooper
746eab7f6b Fix two minor typos
Fixes for two minor typos that were previously included in PR #345.
2016-07-26 12:07:08 -04:00
David Cooper
72bbdbf49b Remove fixes for minor typos 2016-07-26 12:00:46 -04:00
David Cooper
4ed1f2fc11 Don't ignore response to old OpenSSL warning
In the check for old versions of OpenSSL, the results of the call to `ignore_no_or_lame()` are ignored, and so the program continues even if the user enters `no`.
2016-07-26 11:29:25 -04:00
David Cooper
bc6367d3ad Update testssl.sh 2016-07-26 11:21:23 -04:00
David Cooper
b43562aabf Update testssl.sh 2016-07-26 11:13:45 -04:00
David Cooper
23d311b1fc SSLv2 fixes for determine_optimal_proto()
This PR makes three changes to `determine_optimal_proto()`:
* It no longer tries an empty string for `$OPTIMAL_PROTO` twice.
* It does not include `-servername` for `-ssl2` or `-ssl3`, since some versions of OpenSSL that support SSLv2 will fail if `s_client` is provided both the `-ssl2` and `-servername` options.
* It displays a warning if `$OPTIMAL_PROTO` is `-ssl2`, since some tests in testssl.sh will not work correctly for SSLv2-only servers.
2016-07-26 11:10:20 -04:00
David Cooper
e9a2d27af3 Remove determine_optimal_proto() fix 2016-07-26 11:04:43 -04:00
David Cooper
d67fff3223 SSLv2 fixes for server preference
This PR addresses two issues related to SSLv2 for "--server-preference" checks.

First, some versions of OpenSSL that support SSLv2 will fail if `s_client` is provided both the `-ssl2` and `-servername` options.

Second, the line for extracting the chosen cipher,`cipher=$(awk '/Cipher.*:/ { print $3 }' $TMPFILE)`, fails for SSLv2. For SSLv2, the output from `$OPENSSL s_client` is as shown below, and the `cipher=` line extracts the word `between` from `Ciphers common between both SSL endpoints:` rather than `IDEA-CBC-MD5` from `   Cipher    : IDEA-CBC-MD5`.

```
...
Ciphers common between both SSL endpoints:                                                                                                                                                                   
RC4-MD5         RC2-CBC-MD5     IDEA-CBC-MD5                                                                                                                                                                 
DES-CBC-MD5     DES-CBC3-MD5                                                                                                                                                                                 
---                                                                                                                                                                                                          
SSL handshake has read 1191 bytes and written 373 bytes                                                                                                                                                      
---                                                                                                                                                                                                          
New, SSLv2, Cipher is IDEA-CBC-MD5                                                                                                                                                                           
Server public key is 2048 bit                                                                                                                                                                                
Secure Renegotiation IS NOT supported                                                                                                                                                                        
Compression: NONE                                                                                                                                                                                            
Expansion: NONE                                                                                                                                                                                              
No ALPN negotiated                                                                                                                                                                                           
SSL-Session:                                                                                                                                                                                                 
    Protocol  : SSLv2                                                                                                                                                                                        
    Cipher    : IDEA-CBC-MD5
...
```
2016-07-26 10:22:36 -04:00
David Cooper
93ba2e5d65 Remove some server preference fixes 2016-07-26 10:11:22 -04:00
David Cooper
6bd6b8959c Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-26 08:48:01 -04:00
Dirk Wetter
5a763ff8e1 Merge pull request #424 from dcooper16/run_rc4_ssl2_ciphers
SSLv2 fixes for run_rc4()
2016-07-26 12:08:17 +02:00
David Cooper
add75caf82 SSLv2 fixes for test_just_one()
This PR changes test_just_one() to correctly handle SSLv2 ciphers.

As with PR #424, this PR addresses the problem in which servers that do not implement SSLv2, but that implement RC4-MD5, EXP-RC2-CBC-MD5, EXP-RC4-MD5, or NULL-MD5 are shown as implementing both the SSLv2 and SSLv3 versions of the ciphers, and that any SSLv2 ciphers that a server does implement are not shown as being implemented.
2016-07-25 17:00:49 -04:00
David Cooper
db0a6db620 Remove fixes for test_just_one() 2016-07-25 16:54:19 -04:00
David Cooper
43d5ad5071 SSLv2 fixes for run_rc4()
This PR changes run_rc4() to correctly handle SSLv2 ciphers.

It addresses the problem in which servers that do not implement SSLv2, but that implement SSLv3 ciphers that share an OpenSSL name with an SSLv2 cipher (RC4-MD5 and EXP-RC4-MD5), are not incorrectly shown as having implemented the SSLv2 cipher.

It also addresses the problem that if a server does implement SSLv2 with an RC4 SSLv2-cipher suite, then that cipher suite it not shown as being implemented.
2016-07-25 16:42:04 -04:00
David Cooper
d2f1e15243 Remove fixes for run_rc4() 2016-07-25 16:30:30 -04:00
David Cooper
b142962063 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-25 16:24:35 -04:00
David Cooper
bb29e3c917 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-25 09:39:28 -04:00
David Cooper
36a3230b84 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-25 09:36:50 -04:00
Dirk
541690b46e - enabled+renamed tolerance test per default
- quoted some bool vars for faster execution
2016-07-23 15:12:13 +02:00
Dirk Wetter
38b61ed36f Merge pull request #346 from dcooper16/version_negotiation
Additional checks in run_protocols()
2016-07-23 14:54:50 +02:00
Dirk
3d588ddb20 change sequence of out output (trust checks together 2016-07-23 14:52:26 +02:00
Dirk Wetter
0c2acdd8fe Merge pull request #420 from dcooper16/signed-signed-check
Fix check for self-signed certificate
2016-07-23 14:47:14 +02:00
Dirk
1a099d35b7 - minor polishing #419 2016-07-23 11:17:49 +02:00
David Cooper
ae38670067 Fix check for self-signed certificate
The check for whether a certificate is self-signed was using the undefined variable $CN rather than $cn.
2016-07-22 12:06:52 -04:00
David Cooper
df64e47fb9 CN <--> hostname match
PR to address issue #94 (CN <--> hostname match)
2016-07-22 11:31:52 -04:00
David Cooper
603ed33f57 Merge branch 'master' into version_negotiation 2016-07-20 13:39:11 -04:00
David Cooper
6730ed8340 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-20 13:37:54 -04:00
David Cooper
e8d10a5e05 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-20 13:34:39 -04:00
David Cooper
bdea1a0971 Merge branch 'master' into issuer2
Conflicts:
	testssl.sh
2016-07-20 11:45:08 -04:00
Dirk Wetter
6e5c2a824e merged #416 2016-07-20 17:38:55 +02:00
David Cooper
346c52dc7c CA names with domain component attributes
`certificate_info()` does not correctly display the Issuer name for CAs that use domain component attributes.

There is a server on the NIST intra-net that I test against that has a certificate issued by a NIST CA, and the issuer name in the certificate is of the form: `/DC=net/DC=example/DC=internal/CN=CAname`

Since there is no organizational name, testssl.sh displays the name as:
```
 Issuer                       "CAname" ("")
```
In this PR, if the Issuer name has 'DC=' attributes, but does not have an 'O=' attribute, the "DC=" attributes are combined into a DNS name that is used as if it were the organizational name:
```
 Issuer                       "CAname" ("internal.example.net")
```
I should note, however, that I have not been able to find any other examples of TLS server certificates that have been issued by CAs that have domain components ("DC=") in their names. So, it may not be worthwhile to change the code to try to accommodate such CAs.
2016-07-20 11:37:51 -04:00
David Cooper
d9f8024d9a Fix JSON output of Issuer name
`certificate_info()` currently outputs `$issuer` to the JSON file, where is should be outputting `$issuer_CN` in order for the information in the JSON file to match the information that is displayed.

This PR also fixes the problem that if an Issuer name contains a domain component attribute (DC=) then it will be mistakenly treated as a country attribute (C=).
2016-07-20 10:50:38 -04:00
Dirk
5de3ef3e22 Merge branch 'run_pfs_curves' of https://github.com/dcooper16/testssl.sh into dcooper16-run_pfs_curves
Conflicts:
	testssl.sh
2016-07-16 21:21:18 +02:00
Dirk
0c22ea9a0e - output polising in curves
- fix for jail #258
2016-07-16 20:48:56 +02:00
David Cooper
a06ac81df3 Speed up finding supported curves
Rather than try each curve one at a time, follow model in `cipher_pref_check()`.  First include all curves in ClientHello, then successively remove from the ClientHello those curves that have been offered by the server until the connection fails. This makes the number of calls to `$OPENSSL s_client` one more than the number of supported curves rather than the number of curves in NamedCurve supported by $OPENSSL.

Note, however, that OpenSSL defines MAX_CURVELIST as 28 and fails if the `-curves` option includes more than 28 curves. Since OpenSSL 1.1.0 offers 29 curves from NamedCurve, this PR breaks the list of supported curves in 2. At the cost of one additional calls to `$OPENSSL s_client` it ensures that the number of curves provides to the `-curves` option is below the limit.
2016-07-14 13:23:50 -04:00
Dirk
bda62ec715 no glasses needed, just need to look at the right spot ;- 2016-07-11 19:41:32 +02:00
Dirk
5f47359291 polishing output for #413 2016-07-11 18:44:28 +02:00
Dirk Wetter
400e969585 Merge pull request #413 from dcooper16/test_curves
Determine support elliptic curves for ECDHE- ciphers
2016-07-11 18:11:09 +02:00
David Cooper
891c56f8bf Determine support elliptic curves for ECDHE- ciphers
This PR extends run_pfs() to display the set of elliptic curves supported by the server, if the server supports any ECDHE- ciphers.
2016-07-11 11:00:56 -04:00
David Cooper
fb94221ce0 Reorder supported curves
Reorder the supported curves sent by socksend_tls_clienthello() from strongest to weakest.
2016-07-11 10:52:48 -04:00
David Cooper
f968bd8346 Merge branch 'master' into version_negotiation 2016-07-11 10:45:59 -04:00
David Cooper
197bee8658 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-11 10:44:37 -04:00
David Cooper
08953416e8 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-11 10:42:28 -04:00
Dirk Wetter
16087f8252 Merge pull request #411 from welwood08/patch-2
Server cipher order NPN tests should use SNI
2016-07-11 16:24:45 +02:00
Dirk
3e8d5208dc further fix, see #410 2016-07-11 16:20:36 +02:00
Will Elwood
2573a9b8b8 More SNI for NPN tests
Found another NPN test (for the case where server doesn't specify cipher order?) that wasn't using SNI.
Also found a comment saying proxies don't support NPN => removed `$PROXY` from all modified lines.
2016-07-11 14:37:20 +01:00
Will Elwood
382d22648a Server cipher order NPN tests should use SNI
I noticed the NPN parts of this test were not returning any ECDSA ciphers where I expected them to match the results of the immediately preceding TLS 1.2 test. Found it wasn't using SNI so my test server was using the default domain (snakeoil RSA certificate) instead of the tested domain (dual ECDSA/RSA certificates).
2016-07-11 14:15:50 +01:00
Will Elwood
3c39396391 Unreadable SAN list on FreeBSD
On FreeBSD, sed does not support "\n" in the replacement string of a substitution. The SANs are currently output all together inside a single pair of quotes and each separated with an "n" character, needless to say this is very difficult to read.

After a little digging, it seems this is a somewhat recent regression of the fix in #173. I believe `tr` would be a more cross-platform way to do this, and several sources (including the author of that PR) would seem to agree - assuming the newline is now necessary.

It doesn't appear to matter what order the newline replacement happens amongst all the other replacements, so I have placed it first simply to avoid extending any already-long lines. Please correct me if this deduction is false.
2016-07-11 13:35:55 +01:00
David Cooper
f216cbe61f Merge branch 'master' into version_negotiation 2016-07-08 09:39:12 -04:00
David Cooper
02a39e4859 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-08 09:38:06 -04:00
David Cooper
788042ba37 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-08 09:35:52 -04:00
Dirk
af4117aa7a FIX #404 2016-07-08 11:25:41 +02:00
Dirk
8c11334030 FIX #405 2016-07-08 11:15:41 +02:00
Dirk Wetter
57bf01a360 Merge pull request #402 from dcooper16/poodle
Check for all CBC ciphers in Poodle test
2016-07-08 10:04:49 +02:00
Thomas Ward
de05711e5a Fix grammar issue in help output for --openssl
Missing a closing parentheses `)`.
2016-07-06 14:23:32 -04:00
David Cooper
ec6c0ce605 Check for all CBC ciphers in Poodle test
This PR should address issue #399.

I created the list of ciphers using the CIPHERS_BY_STRENGTH file from PR #373, making a list of all ciphers that had "CBC" in the RFC name and for which I had been able to find a corresponding OpenSSL name. Then, since that list contained more than 128 ciphers, I removed any ciphers from the list where the name ended in "-SHA256" or "-SHA384", as it is my understanding that those ciphers can only be used with TLS 1.2.
2016-07-06 10:52:54 -04:00
David Cooper
b6accbe737 Merge branch 'master' into version_negotiation 2016-07-05 10:24:53 -04:00
David Cooper
1102ef324c Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-05 10:23:13 -04:00
David Cooper
6ec00c33db Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-07-05 10:19:53 -04:00
Dirk
0217992553 fixed error where an URI in X509v3 Issuer Alternative Name was displayed and an URI in SAN 2016-07-05 00:08:51 +02:00
Dirk
d2f2dab7fb fix regression lf in CN 2016-07-05 00:02:34 +02:00
Dirk
2bba19360f see #401, part 2 2016-07-04 23:52:52 +02:00
Dirk Wetter
251e3f9a3b Merge pull request #371 from dcooper16/fix_issue_276
Fix issue #276
2016-07-04 23:25:13 +02:00
Dirk
0b5705fff4 FIX #258, FIX #398
partly addressed: #246
2016-07-04 23:05:12 +02:00
Dirk
f01bff973a renamed function, better banner for logging 2016-07-04 13:59:39 +02:00
Dirk
491a03233b updating neat_list() to be faster and more compatible to openssl 1.1.0 with new chacha/poly ciphers 2016-07-03 22:35:21 +02:00
Dirk
d5242c255e FIX #384 2016-07-03 21:45:49 +02:00
Dirk
32f249b0c2 enabling sockets for client testing per default #375 2016-07-01 18:26:05 +02:00
Dirk
2362cd8745 wording for GOST sig algos and keys 2016-07-01 12:03:46 +02:00
David Cooper
0af62efb4f Merge branch 'master' into version_negotiation 2016-06-29 11:03:45 -04:00
David Cooper
a534b8de5f Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-29 11:02:14 -04:00
David Cooper
df55d4af51 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-29 09:57:38 -04:00
David Cooper
53dec241f1 Merge branch 'master' into fix_issue_276 2016-06-29 09:56:08 -04:00
Dirk
36d300b74e add line when using sockets for client simulation 2016-06-28 12:21:50 +02:00
David Cooper
be85fbf2b7 Update IE client simulation data
Change client data for IE 8-10 and IE 11 to match ssllabs.
2016-06-24 16:14:41 -04:00
David Cooper
799c6a5fd0 Handle missing $MAPPING_FILE_RFC
Changed code for run_client_simulation() so that cipher is output when sockets are used even if $MAPPING_FILE_RFC is missing. Also, updated the client data.
2016-06-24 15:48:40 -04:00
David Cooper
b6ccdec614 Merge branch 'master' into version_negotiation 2016-06-24 13:27:35 -04:00
David Cooper
31c3a87a72 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-24 13:26:28 -04:00
David Cooper
0adac7a9a4 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-24 13:24:17 -04:00
David Cooper
f2077b7726 Merge branch 'master' into fix_issue_276 2016-06-24 13:23:07 -04:00
David Cooper
0e58e272f8 Merge branch 'master' into client_sim_sockets
Conflicts:
	testssl.sh
2016-06-24 13:18:25 -04:00
Dirk
5cb4b722b4 in client simulation it should be TLSv1.0 instead of TLSv1.0 2016-06-24 19:01:00 +02:00
Dirk
93204937c5 FIX #376 2016-06-23 19:42:26 +02:00
David Cooper
dd8788d670 Merge branch 'master' into fix_issue_276 2016-06-23 09:42:18 -04:00
David Cooper
8c14ba37d6 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-23 09:40:34 -04:00
David Cooper
df2904edbf Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-23 09:36:58 -04:00
David Cooper
df4edd4152 Merge branch 'master' into version_negotiation 2016-06-23 09:36:06 -04:00
David Cooper
bebdc3c70e Merge branch 'master' into client_sim_sockets 2016-06-23 09:24:54 -04:00
Dirk
68353db42b polishing #382 2016-06-23 14:33:26 +02:00
Dirk Wetter
31c8979d41 Merge pull request #382 from seccubus/mass_and_file_out
Allow the file output feature and mass_test feature to work together
2016-06-23 13:40:09 +02:00
Dirk Wetter
b5b9dd8712 Merge pull request #387 from bad/master
porting to NetBSD
2016-06-23 12:15:02 +02:00
Dirk
ef23703903 fix for #389 2016-06-23 12:04:45 +02:00
Florian Schuetz
18c5f273c3 HSTS: check if max-age is present and nonzero 2016-06-21 21:24:24 +02:00
Florian Schuetz
f8579ee2f7 Fix HSTS/HPKP includeSubDomains and preload being broken in file output. 2016-06-21 08:57:39 +02:00
Christoph Badura
0fd261eb6c Refactor date parsing. Makes testssl.sh work on NetBSD too.
Introduce a parse_date() function to handle all date parsing.
Check for the following date(1) variants:
GNU: accepts "-d date-to-parse".
FreeBSD/OS X: accepts "-j -f input-format"
everything else: accepts "-j date-to-parse"

usage: parse-date date output-format input-format

Tested on NetBSD, OS X 10.11 and Debian jessie.
2016-06-20 22:01:13 +02:00
Christoph Badura
48d5e5a7a1 Drop remaining '\c's in printf(1) arguments. 2016-06-20 22:01:13 +02:00
David Cooper
b8b779b419 Use sockets for client simulations
Modify run_client_simulation() to send the ClientHello from https://api.dev.ssllabs.com/api/v3/getClients (modified to use the correct value in the server name extension) if $EXPERIMENTAL is true, $STARTTLS is empty, and $SSL_NATIVE is false.
2016-06-17 16:33:00 -04:00
David Cooper
1275ce5ed2 Merge branch 'master' into version_negotiation 2016-06-17 16:18:09 -04:00