drwetter / testssl.sh

Testing TLS/SSL encryption anywhere on any port
https://testssl.sh
GNU General Public License v2.0
7.94k stars 1.02k forks source link

Command line in HTML / CSV / flat JSON file output... #1745

Open drwetter opened 4 years ago

drwetter commented 4 years ago

.. is missing.

Should be easy to add in the comment

keisentraut commented 3 years ago

Currently, the command line can already get included in the HTML output in two different ways. I think it is similar for CSV, too.

  1. Whenever you are using the --file option, it will output the command line for in the function run_mass_testing() anyway: outln "$(create_cmd_line_string "$0" "${MASS_TESTING_CMDLINE[@]}")". It looks like this: html_masstesting

  2. There is a function html_banner() which outputs command line, testssl.sh and openssl version and test date/time. Currently, it only outputs something when the condition if "$CHILD_MASS_TESTING" && "$HTMLHEADER"; then is met. This condition is only met when you use both the options --html and --file TESTSSL_CMD_LINES, i.e if you are mass testing and creating one html file per tested host. It looks like this: html_masstesting2

What exactly should be the intended behavior here?

drwetter commented 3 years ago

Intended behaviour (for which the issue is supposed to be about) is that testssl.sh should always contain the command line in the html output.

When running testssl.sh --html testssl.sh I get

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with testssl.sh. https://testssl.sh -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml
[..]

No cmd line.

It's just inconsistent to what one will get when using JSON. It should be independent of using mass testing or any other siwthc / ENV var.

PS: CSV and JSON flat don't do that either but at the time I opened this issue I worried only about HTML

drwetter commented 3 years ago

The info just needs to be added around This file was created with testssl.sh. in html_header().

The slightly tricky part is the logic regarding mass testing