Commit Graph

1410 Commits

Author SHA1 Message Date
Dirk
ba9c056dfc renamed browser --> client simulation 2017-04-28 20:35:07 +02:00
Ondřej Surý
c3fd0249f5 Revert "Downgrade BREACH attack to MEDIUM severity (as it depends on many things)"
This reverts commit 3d2666ab79.
2017-04-25 16:32:06 +02:00
Ondřej Surý
3d2666ab79 Downgrade BREACH attack to MEDIUM severity (as it depends on many things) 2017-04-25 16:17:43 +02:00
Ondřej Surý
3fe0975f27 Merge branch '2.9dev-return-code' into 2.9dev 2017-04-25 15:19:46 +02:00
Ondřej Surý
9c7076b579 $? has an exitcode of the previous if then fi statement, use exit $ret 2017-04-25 15:12:01 +02:00
Ondřej Surý
4579ed2398 Fix prln usage to outln 2017-04-25 15:06:41 +02:00
Dirk
8ea8513529 fixed in Testing server preferences --> Negotiated cipher the empty TMPfile which led to an ugly error
fixed in Session Resumption  for tickets if no extension=no resumption: there was 1x LF too much
2017-04-24 19:18:39 +02:00
David Cooper
eea91a5a61 Merge branch '2.9dev' into client_simulation_wide_option 2017-04-24 08:50:53 -04:00
Dirk
01489b9ca1 special treatment for empty serverhello for ticketbleed 2017-04-24 09:25:23 +02:00
Dirk
2db8e8e8b1 use HAS_NO_SSL2 2017-04-22 22:14:06 +02:00
Dirk
c8cd1318e9 FIX #719, still work to do for ticketbleed (#655) 2017-04-22 15:39:18 +02:00
David Cooper
deab58fe26 Add wide option for client simulations
There is a comment in the `run_client_simulation()` function that says "FIXME: printf formatting would look better, especially if we want a wide option here."

This PR is an attempt at addressing that FIXME and adding a wide option. The proposed wide option prints the same information as the non-wide option, just with the columns aligned. I didn't add any of the additional information that is displayed by other functions in wide mode, since I thought that made the output too wide.
2017-04-21 16:27:02 -04:00
Dirk
584c933493 updated user agent for sneaky 2017-04-21 11:31:42 +02:00
Dirk
28660f7a77 corrected pr_warningln 2017-04-20 17:29:07 +02:00
Dirk
1d992f3620 preview from clientsim branch, important to add now 2017-04-20 17:24:07 +02:00
Dirk
7c676dfc63 FIX #717 -- doubel meaning fo '-h' 2017-04-19 19:46:54 +02:00
Dirk Wetter
869ec9b9c3 Merge pull request #685 from dcooper16/openssl_location
Populate OPENSSL_LOCATION in find_openssl_binary
2017-04-19 18:23:14 +02:00
Todd Swatling
ee4975ac8a modified find_openssl_binary() to use TESTSSL_INSTALL_DIR since get_install_dir() works very hard to determine the where testssl actually is 2017-04-19 09:40:56 -04:00
David Cooper
f7540cae57 Merge branch '2.9dev' into openssl_location 2017-04-19 09:13:33 -04:00
Dirk
c4a2ba8b49 vuln count adjusted 2017-04-19 01:21:13 +02:00
Dirk
2469603a7f save also 1x connect for heartbleed() by reusing a previoulsy identified protocol 2017-04-19 00:30:09 +02:00
Dirk
de79bd6b0e implemented ticketbleed (experimental). Renamed other vulnerabilty checks to easier memorize each check:
-H is now --heartbleed instead of --headers,
-B is now --breach instead of --heartbleed,
-T is now --ticketbleed (was previously --breach)

bugs fix for run_ccs_injection() where the tls protocols wa not properly passed to the ClientHello

Made use of already determined protocol ( this time only from determine_optimal_proto() ) ==> we shpould use this in run_protocols() too!)
for run_ccs_injection + run_ticketbleed(). For achieving this determine_optimal_proto() needed to be modified so that it adds a protocol
to PROTOS_OFFERED (all_failed is now boolean there)

added two easy functions for converting dec to hex

sockread_fast() is for testing which should make socket erads faster -- albeit it could potentially block the whole thing
2017-04-18 23:15:32 +02:00
David Cooper
7747d965d4 Merge branch '2.9dev' into openssl_location 2017-04-14 09:12:20 -04:00
Dirk
4b833b7b6e code readability improvements 2017-04-14 11:26:01 +02:00
Dirk Wetter
3d8c8769a9 Merge pull request #709 from dcooper16/fix_616
Fix #616
2017-04-14 11:04:54 +02:00
David Cooper
27124a404b Merge branch '2.9dev' into debug_output_in_html 2017-04-13 16:34:44 -04:00
David Cooper
2bfc0dc1d7 Merge branch '2.9dev' into fix_616 2017-04-13 16:33:57 -04:00
David Cooper
756e28d2dc Merge branch '2.9dev' into openssl_location 2017-04-13 16:31:30 -04:00
David Cooper
dcfee43b0d Use of color in emphasize_stuff_in_headers()
`emphasize_stuff_in_headers()` only adds color to the text being printed to the terminal if `$COLOR` is 2. So, the same should be the case for the HTML output.
2017-04-13 16:06:06 -04:00
David Cooper
5afee01797 No debugging text in HTML output
This PR fixes two places in which output is being included in the HTML output, but shouldn't be.
2017-04-13 14:28:39 -04:00
David Cooper
712c4ad30b Fix #616
This PR addresses issue #616, changing `run_cipher_match()` so that only those ciphers that are available are shown, unless the `--show-each` flag has been provided.

It also fixes a problem where the signature algorithm isn't being shown, even if `$SHOW_SIGALGO` is true.
2017-04-13 14:03:51 -04:00
David Cooper
c77cbc3043 Merge branch '2.9dev' into openssl_location 2017-04-13 11:05:28 -04:00
David Cooper
e3e25ce1c3 Use get_cipher helper function
The new `get_cipher()` helper function was not being used in every place where it could be used.
2017-04-13 10:32:19 -04:00
David Cooper
ae1bd5c6bd Merge branch '2.9dev' into openssl_location
Conflicts:
	testssl.sh
2017-04-12 16:07:42 -04:00
Dirk
5168fab693 minor polishing 2017-04-12 21:50:55 +02:00
David Cooper
59683927f8 Prevent word splitting 2017-04-12 15:39:37 -04:00
David Cooper
4d0bd4acb5 Merge branch '2.9dev' into openssl_location 2017-04-12 15:36:58 -04:00
Dirk Wetter
d2b70f7289 Merge pull request #706 from dcooper16/fix_702
Fix #702
2017-04-12 21:33:36 +02:00
Dirk Wetter
9f7ab1cef6 Merge pull request #707 from dcooper16/more_702_fixes
More fixes for #702
2017-04-12 21:19:17 +02:00
Dirk
036bf2e53c revamped run_std_cipherlists(). There are now less catagories, less overlap and it's more modern:
NULL ciphers (no encryption)
 Anonymous NULL Ciphers (no authentication)
 Export ciphers (w/o ADH+NULL)
 LOW: 64 Bit + DES encryption (w/o export)
 Weak 128 Bit ciphers
 Triple DES Ciphers (Medium)
 High grade encryption
 Strong grade encryption (AEAD ciphers)
2017-04-12 21:00:08 +02:00
David Cooper
2ac14e879d More fixes for #702
This PR just addresses some places where quotes need to be used to avoid word splitting in case the referenced file, or path to the file, contains space characters.
2017-04-12 14:34:26 -04:00
David Cooper
fa736cf6d9 Fix typo in run_mass_testing_parallel() 2017-04-12 12:24:33 -04:00
David Cooper
513ba8ff2d Another fix to calling child process
The previous fix did not work if testssl.sh was found via `$PATH`. This seems to work in all cases. If testssl.sh is found via `$PATH` or if the command line includes a path, then `which` returns a non-empty response; otherwise, `$0` does not include any path, but one needs to be provided, so `$RUN_DIR/$PROG_NAME` is used.
2017-04-12 12:15:27 -04:00
David Cooper
f094013aeb Fix creation of child process
Using "$0" as the name of the executable seems to work as long as "$0" contains a directory name (e.g, "workingfiles/testssl.sh"), but not if it is just the name of the executable (e.g., "testssl.sh"). Specifying "$RUN_DIR/$PROG_NAME" seems to work in both cases, since if "$0" doesn't contain any path information, `$RUN_DIR` is `.`
2017-04-12 11:39:24 -04:00
David Cooper
6633d0e549 Improve pretty-printing of command line string
Use the suggestion "If you want to print the argument list as close as possible to what the user probably entered" from http://stackoverflow.com/questions/10835933/preserve-quotes-in-bash-arguments to create `$CMDLINE` and to print the command lines in `run_mass_testing()` and `run_mass_testing_parallel()`.
2017-04-12 10:00:40 -04:00
David Cooper
7cbce9cb55 Fix #702
This PR addresses issue #702. Rather than create the command line for each child process in `run_mass_testing()` as a string, it creates it as an array, with each argument being a separate element in the array. This was done based on http://mywiki.wooledge.org/BashFAQ/050.

The printing of each child's command line done based on http://stackoverflow.com/questions/10835933/preserve-quotes-in-bash-arguments.

The `$CMDLINE` string remains unchanged, even though it isn't entirely "correct," since http://jsonlint.com/ complains if the "Invocation:" string contains backslashes.
2017-04-11 17:05:27 -04:00
David Cooper
91695fe07e Merge branch '2.9dev' into openssl_location 2017-04-11 13:17:22 -04:00
Dirk
ed2aa6698d comments added for #705 2017-04-11 18:48:23 +02:00
David Cooper
a1d4eac64d Don't read tls_data.txt inside function
I was doing some testing on my extended_tls_sockets branch and discovered that it was not fully working since the `TLS13_KEY_SHARES` array was empty. According to https://lists.gnu.org/archive/html/bug-bash/2012-06/msg00068.html, there is an issue when trying to initialize a global array inside a function. (The current code initializes `TLS12_CIPHER`, `TLS_CIPHER`, and `TLS13_KEY_SHARES` within `get_install_dir()`, since tls_data.txt is read in that function.) In fact, according to http://stackoverflow.com/questions/10806357/associative-arrays-are-local-by-default, in order to initialize a global variable in a function, one needs to provide the `-g` option, which was only added in Bash 4.2.

This PR seems to fix the problem by moving the reading of tls_data.txt to the main body of the code rather than reading it within the `get_install_dir()` function.
2017-04-10 17:07:46 -04:00
David Cooper
43a4358442 Merge branch '2.9dev' into openssl_location 2017-04-10 09:00:06 -04:00
Dirk
5054cc33f3 rename *test_just_one as @AlGreed suggestted in #703 2017-04-10 14:45:39 +02:00
Dirk
0bbbd5217a swapped -f and -s
-f is now forward secrecy
    -s is standard cipher lists
2017-04-08 09:14:56 +02:00
David Cooper
25977d5537 Merge branch '2.9dev' into openssl_location 2017-04-07 09:41:40 -04:00
Dirk
55713e4929 use per default a lf before the first fatal message 2017-04-07 10:26:41 +02:00
Dirk
c75a2cd838 In addition to #701 add quotes for correcting cmdline parsing -- especially for supplied filenames/arguments
(HTML,CSV,JOSN,PROXY).

Also strip off leading http:// | https://  for --proxy
2017-04-07 09:49:44 +02:00
Dirk Wetter
dc629202bb Merge pull request #701 from dcooper16/wordsplitting_filenames
Handle word splitting of log file names.
2017-04-07 08:54:07 +02:00
Dirk Wetter
9c13d2a3a2 Merge pull request #700 from dcooper16/fix_696
Fix #696
2017-04-07 08:52:38 +02:00
David Cooper
381ad3de32 Handle word splitting of log file names.
This PR fixes a problem that occurs if log file names include spaces.
2017-04-06 11:26:03 -04:00
David Cooper
3a9c49c989 Fix #696
If I understand correctly how `run_hpkp()` should be displaying the list of Backups, the problem shown in the photo attached to #696 occurred because the dangling SPKIs should have been printed on the next line. This PR fixes this by changing the code that prints out the "good" backups to include a newline after printing the CA's name.

Another problem this PR fixes is that `tm_italic()` is being called instead of `pr_italic()`, meaning that the italicized text is being printed to the terminal, but is not being included in the HTML output.

Finally, this PR fixes errors in the definitions of `tmln_italic()` and `prln_italic()`. `tmln_italic()` calls `outln()` and `prln_italic()` calls `tmln_out()` instead of the reverse.
2017-04-06 10:54:20 -04:00
David Cooper
ce620ac7d0 Fix #695
This PR fixes issue #695 by changing the call to `out_row_aligned_max_width()` so that the length of the flag is considered in determining the length of the first line of the output.
2017-04-06 10:37:45 -04:00
David Cooper
69530d77cf Merge branch '2.9dev' into openssl_location 2017-04-06 09:12:43 -04:00
Dirk
e2f5d5c3cf updated comments 2017-04-06 11:33:54 +02:00
Dirk
3351f8832c mute the error message using bash3, see #697 (2.9dev) 2017-04-06 11:23:57 +02:00
Dirk Wetter
c188408f8e Merge pull request #698 from dcooper16/mass_testing_parallel
Mass testing in parallel
2017-04-06 10:25:38 +02:00
Dirk
8a2967c62e make use of swapped out tls data file
(main() sill needs a bit of work)
2017-04-06 09:47:09 +02:00
David Cooper
c04d254a43 Mass testing in parallel
This PR modifies `run_mass_testing_parallel()` so that it may be used in place of  `run_mass_testing()`.
2017-04-05 16:58:57 -04:00
David Cooper
b98ef7cd8e Merge branch '2.9dev' into openssl_location 2017-04-05 15:01:06 -04:00
Dirk
61d42b022c fix missing space in banner and suppress empty version string 2017-04-05 20:39:35 +02:00
Dirk
ec55cdea14 "post-fix" for #697 (2.9dev) 2017-04-05 20:20:00 +02:00
David Cooper
dabe72542f Merge branch '2.9dev' into openssl_location 2017-04-05 12:41:50 -04:00
Dirk
bfb0f4bc7d FIX #697 in 2.9dev (bash hiccup @ tolower) 2017-04-05 17:28:06 +02:00
Dirk
b1ce11d76e in addition to #694: using the predefined variable 2017-04-05 14:48:35 +02:00
Dirk
6b0f389225 fix #694 (CSP and HTTP header friends were cut off @ last colon)
introduced strip_leading_space() / strip_trailing_space()
2017-04-05 14:42:55 +02:00
David Cooper
2d73d06474 Merge branch '2.9dev' into openssl_location 2017-04-04 15:49:40 -04:00
Dirk
7549f10c79 added explanation for #692 2017-04-04 20:23:28 +02:00
David Cooper
1b4c1cc40c Update testssl.sh
This PR fixes two issues with HTML generation that were introduced by a commit on March 31, 2016, "[count_ciphers is now un-sed'ed, minor improvements](a480e5f699)."

The first is that in `std_cipherlists()`, `[[ $DEBUG -ge 1 ]] && outln " -- $1" || outln` was changed to `[[ $DEBUG -ge 1 ]] && outln " -- $1" || outln`. The result being that in the HTML output, all of the tests from `run_std_cipherlists()` appear on the same line. This PR changes the line to:
```
          [[ $DEBUG -ge 1 ]] && tm_out " -- $1"
          outln
``
so that the line break is added to the HTML output, but the debugging information is not.

The second problem is that the commit on March 31 moved the call in main to `html_header()` until after the calls to `get_install_dir()`, `find_openssl_binary()`, `mybanner()`, `check4openssl_oldfarts()`, and `check_bsd_mount()`. The problem is that each of these functions may call an output function that will call `html_out()`.

If `html_out()` is called before `html_header()` and the command line contains `--htmlfile <htmlfile>`, then "htmlfile" will be written to before `html_header()` is called and then `html_header()` will warn that "htmlfile" already exists and then exit the program.

If `html_out()` is called before `html_header()` and the command line contains `--html`, then anything send to `html_out()` before `html_header()` is called (such as the banner) will not appear in the HTML file.
2017-04-04 13:25:31 -04:00
David Cooper
1ca898190d Merge branch '2.9dev' into openssl_location 2017-04-04 08:54:18 -04:00
Dirk
8213e2436c addressed #691 for 2.9dev 2017-04-04 09:54:47 +02:00
David Cooper
a26a53ccef Merge branch '2.9dev' into openssl_location 2017-04-03 09:00:47 -04:00
Dirk
498dda94ce using get_san_dns_from_cert() 2017-04-01 10:38:04 +02:00
David Cooper
32418e39db Merge branch '2.9dev' into openssl_location 2017-03-31 12:02:22 -04:00
Dirk
6b601e22c7 adding Referrer-Policy header (FIX #604)
introduced get_san_dns_from_cert()

added two stub function get_session_ticket_lifetime_from_serverhello
2017-03-31 17:04:04 +02:00
David Cooper
e03d89107b Merge branch '2.9dev' into openssl_location 2017-03-31 09:36:26 -04:00
Dirk Wetter
75c794546d Merge pull request #689 from dcooper16/run_server_defaults_cleanup
Cleanup variable definitions in run_server_defaults()
2017-03-31 12:53:46 +02:00
Dirk
a480e5f699 count_ciphers is now un-sed'ed, minor improvements 2017-03-31 12:24:25 +02:00
David Cooper
9f93d9d578 Move insertion of commas to a separate file
Create a separate function to insert the comma separators between findings for different tests within mass testing.
2017-03-30 12:48:25 -04:00
David Cooper
d8a7037000 Add missing comma
I did some testing with http://jsonlint.com/ and discovered a missing comma when massing testing is being performed and a single JSON file is being created.
2017-03-30 12:37:41 -04:00
David Cooper
73a24cba27 Correct indentation in run_server_defaults()
This second commit doesn't make any changes to the code, it just corrects the indentation.
2017-03-30 10:27:08 -04:00
David Cooper
ba2a75b093 Cleanup variable definitions in run_server_defaults()
In `run_server_defaults()` the variable `success` is defined twice, once an an ordinary variable and once as an array. The PR removes the incorrect definition. It also removes the definitions of some variables that are no longer used and reorganizes the definitions so that each line has only one variable type.

I also noticed a typo later in `run_server_defaults()` and corrected it.
2017-03-30 10:08:26 -04:00
David Cooper
04f86f9469 Fix indentation of JSON pretty banner 2017-03-29 11:22:29 -04:00
David Cooper
86c81f2276 Use CHILD_MASS_TESTING environment variable
This PR introduces the environment variable `CHILD_MASS_TESTING`, and uses it as an indicator that testssl.sh is running as a child within mass testing rather than using the `$APPEND` flag. It also makes a number of other changes to make the handling, of HTML, CSV, JSON, and log files consistent, and it fixes a number of bugs related to the generation of these files when mass testing is being performed.

Please let me know if you disagree with any of the changes in this PR, or if you would prefer that it be broken up into multiple smaller PRs.

Some of the changes are as follows:
- When the `$APPEND` flag is true, all of these files are appended to and headers and footers are omitted. (Perhaps this should be changed. Appending to a log file isn't an issue, but appending to a JSON or HTML file without including headers or footers seems to just create an improperly formatted file).
- Following the code in `prepare_logging()`, an error is printed and the program stops if the `$APPEND` flag is false and one of the files to be written to already exists.

Some of the bugs fixed:

Creating log files did not work with mass testing:
- If `--logfile <logfile>` is used, then the parent and each child try to write to "logfile".
- If `--logging` is used, then a log file is created for each child, but an oddly-named log file is also created for the parent. The one created by the parent contains the entire output.

Plain JSON files:
- When `--jsonfile <jsonfile>` is run, there is no comma separating the final finding for one child and the first finding for the next child.

Pretty JSON files:
- When `--jsonfile-pretty <jsonfile>` is called without mass testing, the "target host" line is empty, since `$NODE` has not yet been set.
- When `--jsonfile <jsonfile>` is run with mass testing, there is no comma separating the final finding for one child and the first finding for the next child. In addition, `fileout_pretty_json_banner()` is never called, and the entries for individual tests have insufficient information to determine what is being tested (it lists "service" and "ip", but not port number).

For the final issue, when mass testing is being performed and all output is being placed in a single file, I have the parent call `fileout_pretty_json_banner()`, but tell `fileout_pretty_json_banner()` to not include a "target host" or "port", but then have each child include a "target host" or "port" (when the "service" and "ip" are being printed).
2017-03-29 11:16:09 -04:00
David Cooper
312598837f Merge branch '2.9dev' into openssl_location 2017-03-29 09:01:38 -04:00
Dirk
7953bfda5e correct DEBUGTIME 2017-03-29 11:17:24 +02:00
Dirk
05ea5675b8 one line per variable type 2017-03-29 10:44:22 +02:00
David Cooper
227a31b788 out_row_aligned_max_width()
This PR improves `out_row_aligned_max_width()` in a few ways:

* It makes better use of bash's string manipulation capabilities in order to simplify the function.

* It improves the function's performance. One of the most costly parts of `out_row_aligned_max_width()` was the while loop to print each entry in the text. Since there is only one place in the code where the the entries are not all printed the same ways (the list of supported curves printed by `run_pfs()`), the PR changes `out_row_aligned_max_width()` to just return a plain text string, which the calling function prints in the appropriate way. For the curves printed by `run_pfs()`, a new function, `out_row_aligned_max_width_by_entry()` takes care of getting the output from `out_row_aligned_max_width()` and then printing each entry appropriately.

* The PR also introduces a trick so that when the TLS extensions are printed, the text for an extension won't get split across two rows. It does this by replacing the space charters within the text for an extension with "}", formatting the result with `out_row_aligned_max_width()`, and then converting the "}" back to space characters.
2017-03-28 13:54:54 -04:00
David Cooper
572d081882 Merge branch '2.9dev' into openssl_location 2017-03-28 08:54:52 -04:00
Dirk
53de1dc7c4 clarified help() 2017-03-28 12:07:45 +02:00
David Cooper
6ca55014ed Merge branch '2.9dev' into openssl_location 2017-03-27 15:58:43 -04:00
Dirk
e2d5dc7778 part 2/2: fix for #653 2017-03-27 21:31:54 +02:00
David Cooper
eca636f284 Merge branch '2.9dev' into openssl_location 2017-03-27 15:22:18 -04:00
David Cooper
3b7264ff1f Populate OPENSSL_LOCATION in find_openssl_binary
`$OPENSSL_LOCATION` is used in `fileout_pretty_json_banner()`, `html_banner()`, `mybanner()`, and `prepare_logging()`, but the value of `$OPENSSL_LOCATION` is populated in `mybanner()`. This is usually okay, since `mybanner()` is always called before the other three functions are called. However, if `$QUIET` is `true`, then `mybanner()` returns immediately, without populating `$OPENSSL_LOCATION`, even though the value of `$OPENSSL_LOCATION` may be needed by one or more of the other functions.

This PR addresses this problem by populating `$OPENSSL_LOCATION` in `find_openssl_binary()` rather than `mybanner()`.
2017-03-27 14:54:47 -04:00
David Cooper
684c231dcd Merge branch '2.9dev' into missing_html_banner 2017-03-27 12:36:14 -04:00
Dirk
38cf16854d FIX #682 2017-03-27 17:35:45 +02:00
David Cooper
d629cbcc28 Missing HTML banner
With the commit made on March 26, "partly (1/2) fixing #653," an HTML banner isn't added to the HTML files anymore.  A banner should be added to the top of the HTML file if mass testing is being performed and a separate HTML file is being created for each test.

The `$APPEND` flag being `true` is an indicator that mass testing is being performed and that this is one of the individual tests being run. Given that `$APPEND` is `true`, `$HTMLHEADER` being `true` indicates that testssl.sh is creating the file name for the HTML output. So, it is when both flags are `true` that the HTML banner should be created.
2017-03-27 10:52:24 -04:00
Dirk
bcc597dbab clarify help #680 2017-03-27 11:37:18 +02:00
Dirk
c0af8b113f FIX #680 2017-03-27 11:29:21 +02:00
Dirk
7543aa30fb make travis mute again / introduce DEBUG_ALLINONE to use script for debug output all in one file 2017-03-27 08:59:29 +02:00
Dirk
9f1877b192 save work (still double footer, see #653) 2017-03-27 00:54:38 +02:00
Dirk
a8b2dfec40 allow '=' after --htmlfile 2017-03-27 00:34:42 +02:00
Dirk
13ba1ce966 partly (1/2) fixing #653 2017-03-27 00:30:42 +02:00
Dirk
c281956f6e ifix xtrace 2017-03-26 19:34:02 +02:00
Dirk
e268a1564a * include runtime per default in "Done" banner
* enable better performance analysis
* minor polish
2017-03-25 19:37:30 +01:00
Dirk
10bbbd9334 minor cleanups 2017-03-25 13:23:21 +01:00
Dirk Wetter
039b293790 Merge pull request #679 from dcooper16/std_cipherlists_debug
Fix std_cipherlists with debug
2017-03-25 12:36:46 +01:00
Dirk
4ae1597b2b FIX #543 2017-03-25 12:26:08 +01:00
David Cooper
8d60e87040 Fix std_cipherlists with debug
`std_cipherlists()` does not include line breaks between tests in the output to the terminal when `$DEBUG` is 1, and it does not include line break between tests in the HTML output whenever `$DEBUG` is greater than 0.
2017-03-24 16:45:39 -04:00
David Cooper
9a86825ec2 Fix client simulation
In `create_client_simulation_tls_clienthello()` the variable `sni_extension_found` should be set if the ClientHello includes an SNI extension. Instead it was being set if and only if the ClientHello included some extension other than SNI.

This bug wasn't detected before for two reasons:

* It is rare to have a ClientHello that includes an SNI extension, but no other extensions.

* The code still works correctly if `sni_extension_found` is set even if there is no SNI in the ClientHello.

So, the bug only creates a problem if the browser's ClientHello include an SNI extension and no other extensions (see "BingPreview Jun 2014" in the client_simulation branch).
2017-03-24 11:37:06 -04:00
Dirk Wetter
3514c9d98d Merge pull request #672 from dcooper16/minor_bugs
Fix two minor bugs
2017-03-24 08:00:33 +01:00
David Cooper
3a2dd3e6d1 Fixing a third minor bug
When HTML output is not being created, the print functions last step is to call `html_out()`, which responds to `return` rather than `return 0`. This causes problems for lines of code that rely on receiving a return value of 0. For example:
```
[[ $VULN_COUNT -le $VULN_THRESHLD ]] && outln && pr_headlineln " Testing for LUCKY13 vulnerability " && outln
```
2017-03-23 16:43:04 -04:00
David Cooper
7f64170402 Fix two minor bugs
This PR fixes two minor bugs:

* In `run_hpkp()`, the call to `$OPENSSL s_client` includes the option `-showcerts` twice. This PR removes one of them.

* In `get_server_certificate()`, the first call to `$OPENSSL s_client` includes `$addcmd`, but `$addcmd` has not yet been initialized. Instead, `$SNI` should be used.
2017-03-23 16:19:21 -04:00
David Cooper
13f42774ae Use printf to print browser names 2017-03-23 14:13:47 -04:00
Dirk
d5bb4edd80 * FIX #654 (no logfile when -file is specified)
* filename has now instead of just the number p+#
* minor polishing
2017-03-23 16:36:29 +01:00
David Cooper
63d02688bc Fix typo 2017-03-22 15:21:22 -04:00
David Cooper
9ad1492236 Cleanup extraction of TLS extensions
Currently there is code to extract TLS extensions in three places, in `get_server_certificate()` and two places in `determine_tls_extensions()`. This PR replaces them with one new function, `extract_new_tls_extensions()`.

In order for the new function to work correctly whether OpenSSL or `tls_sockets()` is being used, this PR also changes `parse_tls_serverhello()` so that extensions are formatted in the file it creates in the same way as they are formatted by OpenSSL.
2017-03-22 15:18:38 -04:00
Dirk
43463da4fc improvements for performance measurements (small solution)
- in gerneral better performance measurements , starts from the real beginning (almost)
- allows results to put into file (MEASURE_TIME_FILE=google.txt testssl.sh google.com)
2017-03-22 16:02:48 +01:00
Dirk
27d0570fb5 - changed performance debugging options (small solution) so that the last delta is being shown
- PS4 improved: has now a performance debugging options (big solution)
- PS4 with proper alignment
- SCAN_TIME is now global so that it can be used not only by JSON-PRETTY (small performance debugging options uses it)
- prepare_debug() has now debugging stuff only, rest went to prepare_arrays()
2017-03-21 12:44:03 +01:00
Dirk
273361fbb9 raw time assements via env var MEASURE_TIME=true 2017-03-20 22:53:18 +01:00
Dirk
60a8e0a190 monor resorting and cosmetic improvements 2017-03-19 09:47:49 +01:00
Dirk
73a094fcc7 FIX #648 (retrieve cipher and protocol from ServerHello) --> saves ~1 second and makes code better to read
other readabilty improvements
2017-03-18 22:24:35 +01:00
Dirk
8be47e484b replace some "echo $x" by HERE statement "<<<" 2017-03-18 21:01:55 +01:00
Dirk
c618b9a954 fix CR for standard cipherlists with debug=1 2017-03-18 16:09:22 +01:00
Dirk
21a51b4ff0 Merge branch '2.9dev' of github.com:drwetter/testssl.sh into 2.9dev 2017-03-18 15:58:30 +01:00
Dirk
407c4383bf - externalized client simulation data
- fixed  *_fixme()
2017-03-18 15:57:16 +01:00
Dirk Wetter
30e68311fc Merge pull request #658 from AlGreed/2.9dev
Fixed #657: Severity flag for JSON-PRETTY produces malformad JSON object
2017-03-18 13:12:40 +01:00
Dirk
84a4fafe1e fixed merge conflicts 2017-03-18 12:54:01 +01:00
AlGreed
3437f36f48 Merge branch 'drwetter/2.9dev' into 2.9dev 2017-03-18 09:41:50 +01:00
Dirk Wetter
1c9670857b Merge pull request #661 from dcooper16/normalize_ciphercode
Speedup normalize_ciphercode()
2017-03-17 21:19:23 +01:00
David Cooper
c791e5cc0e Speedup normalize_ciphercode()
This PR is the same as #661, except that it applies to the 2.9dev_html branch. It also fixes a bug in `prettyprint_local()` when a pattern to match is provided as input.
2017-03-15 10:32:29 -04:00
David Cooper
875cd43087 Speedup normalize_ciphercode()
While doing some performance testing I discovered that `normalize_ciphercode()` is very slow. This PR simplifies the function and speeds it up significantly. This PR also addresses the TODO item in `normalize_ciphercode()` by eliminating the global variable HEXC.
2017-03-15 10:22:04 -04:00
AlGreed
3122b3b7b3 Removed mistakenly commited code. 2017-03-09 19:10:51 +01:00
AlGreed
6b8de02072 Fixed broken JSON-PRETTY format. Added test to check severity levels 2017-03-09 18:55:04 +01:00
AlGreed
6201348827 Merge branch 'drwetter/2.9dev' into 2.9dev 2017-03-07 11:18:13 +01:00
David Cooper
f02948e24a Add spaces in show_finding()
When I view testssl.sh in KDE's text editor (kate), the code after "INFO" line in `show_finding()` isn't highlighted correctly, and the highlighting doesn't correct again until `pr_liteblueln()`. This PR fixes the highlighting issue by adding spaces between "]]" and ")". To be "safe," I also added spaces between "(" and "[[", and similarly added spaces in `is_json_format()`.
2017-03-06 14:37:52 -05:00
David Cooper
a3794d1f74 Merge branch '2.9dev_html' into html_headers_and_footers 2017-03-01 08:47:25 -05:00
David Cooper
3c22511806 Fix HTML headers and footers
This PR ensures that each HTML file produced by testssl.sh only includes a single header, at the top, and a single footer, at the end. It also tries to ensure that the short-version banner is only placed at the top of the HTML file if (1) mass testing is being performed and (2) the results of each test is being placed in a separate file.

It also moves some of the logic out of main and into `html_header()`.
2017-02-28 13:31:06 -05:00
David Cooper
68cf590366 Merge branch '2.9dev_html' of https://github.com/drwetter/testssl.sh into 2.9dev_html 2017-02-28 12:47:45 -05:00
Dirk
ca6cb0bf81 updated from #632 from dcooper16/negotiated_cipher 2017-02-28 18:33:17 +01:00
David Cooper
b793e5f83d Merge branch '2.9dev_html' into html_reserved 2017-02-27 13:27:16 -05:00
David Cooper
3e42b2fde9 Merge branch '2.9dev' into negotiated_cipher 2017-02-27 13:26:15 -05:00
Dirk
79a8a02328 adding spring boot header detection 2017-02-27 19:16:29 +01:00