mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-01 06:19:44 +01:00
Add "auto" keyword to -oA/-oa (FIX #887)
File names are now auto-generated by using "-oA auto" / -oa "auto" --similar to --csv and friends. Also the formerly hidden switches --outFile and --outfile were added in the help and in the manual.
This commit is contained in:
parent
9b7000e87e
commit
9daec2a515
@ -1,7 +1,7 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "TESTSSL" "1" "October 2017" "" ""
|
||||
.TH "TESTSSL" "1" "November 2017" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBtestssl\fR
|
||||
@ -393,7 +393,10 @@ whole 9 yards
|
||||
\fB\-\-htmlfile <htmlfile>\fR or \fB\-oH <htmlfile>\fR Similar to the aforementioned \fB\-\-jsonfile\fR or \fB\-\-logfile\fR it logs the output in HTML format (see \fB\-\-html\fR) additionally into a file or a directory\. For further explanation see \fB\-\-jsonfile\fR or \fB\-\-logfile\fR\. \fBHTMLFILE\fR is the variable you need to set if you prefer to work with environment variables instead\.
|
||||
.
|
||||
.P
|
||||
\fB\-oA <basename>\fR / \fB\-oa <basename>\fR Similar to nmap it does a file output to all available file formats: LOG,JSON,CSV,HTML\. \fB\-oA\fR does JSON pretty, \fB\-oa\fR flat JSON
|
||||
\fB\-oA <filename>\fR / \fB\-\-outFile <filename>\fR Similar to nmap it does a file output to all available file formats: LOG,JSON pretty,CSV,HTML\. If the filename supplied is equal \fBauto\fR the filename is automatically generated using \'\e${NODE}\-p${port}\e${YYYYMMDD\-HHMM}\.\e${EXT}\' with the according extension\.
|
||||
.
|
||||
.P
|
||||
\fB\-oa <filename>\fR / \fB\-\-outfile <filename>\fR Does the same as the previous option but uses flat JSON instead\.
|
||||
.
|
||||
.P
|
||||
\fB\-\-hints\fR This option is not in use yet\. This option is meant to give hints how to fix a finding or at least a help to improve something\. GIVE_HINTS is the environment variable for this\.
|
||||
|
@ -266,7 +266,9 @@ The same can be achieved by setting the environment variable `WARNINGS`.
|
||||
|
||||
`--htmlfile <htmlfile>` or `-oH <htmlfile>` Similar to the aforementioned `--jsonfile` or `--logfile` it logs the output in HTML format (see `--html`) additionally into a file or a directory. For further explanation see `--jsonfile` or `--logfile`. `HTMLFILE` is the variable you need to set if you prefer to work with environment variables instead.
|
||||
|
||||
`-oA <basename>` / `-oa <basename>` Similar to nmap it does a file output to all available file formats: LOG,JSON,CSV,HTML. `-oA` does JSON pretty, `-oa` flat JSON
|
||||
`-oA <filename>` / `--outFile <filename>` Similar to nmap it does a file output to all available file formats: LOG,JSON pretty,CSV,HTML. If the filename supplied is equal `auto` the filename is automatically generated using '\${NODE}-p${port}\${YYYYMMDD-HHMM}.\${EXT}' with the according extension.
|
||||
|
||||
`-oa <filename>` / `--outfile <filename>` Does the same as the previous option but uses flat JSON instead.
|
||||
|
||||
`--hints` This option is not in use yet. This option is meant to give hints how to fix a finding or at least a help to improve something. GIVE_HINTS is the environment variable for this.
|
||||
|
||||
|
37
testssl.sh
37
testssl.sh
@ -12697,11 +12697,11 @@ file output options (can also be preset via environment variables)
|
||||
--jsonfile|-oj <jsonfile> additional output to the specified flat JSON file or directory, similar to --logfile
|
||||
--json-pretty additional JSON structured output of findings to a file '\${NODE}-p\${port}\${YYYYMMDD-HHMM}.json' in cwd
|
||||
--jsonfile-pretty|-oJ <jsonfile> additional JSON structured output to the specified file or directory, similar to --logfile
|
||||
--csv additional output of findings to CSV file '\${NODE}-p${port}\${YYYYMMDD-HHMM}.csv' in cwd or directory
|
||||
--csv additional output of findings to CSV file '\${NODE}-p\${port}\${YYYYMMDD-HHMM}.csv' in cwd or directory
|
||||
--csvfile|-oC <csvfile> additional output as CSV to the specified file or directory, similar to --logfile
|
||||
--html additional output as HTML to file '\${NODE}-p${port}\${YYYYMMDD-HHMM}.html'
|
||||
--html additional output as HTML to file '\${NODE}-p\${port}\${YYYYMMDD-HHMM}.html'
|
||||
--htmlfile|-oH <htmlfile> additional output as HTML to the specifed file or directory, similar to --logfile
|
||||
-oa/-oA <basename> similar to nmap it outputs a LOG,JSON,CSV,HTML file. -oA: JSON pretty, -oa: flat JSON
|
||||
--out(f,F)ile|-oa/-oA <fname> log to a LOG,JSON,CSV,HTML file (see nmap). -oA/-oa: pretty/flat JSON. "auto" uses '\${NODE}-p\${port}\${YYYYMMDD-HHMM}'
|
||||
--hints additional hints to findings
|
||||
--severity <severity> severities with lower level will be filtered for CSV+JSON, possible values <LOW|MEDIUM|HIGH|CRITICAL>
|
||||
--append if <logfile>, <csvfile>, <jsonfile> or <htmlfile> exists rather append then overwrite. Omits any header
|
||||
@ -14291,6 +14291,10 @@ create_cmd_line_string() {
|
||||
}
|
||||
|
||||
parse_cmd_line() {
|
||||
local outfile_arg=""
|
||||
local cipher_mapping
|
||||
local -i retvat=0
|
||||
|
||||
CMDLINE="$(create_cmd_line_string "${CMDLINE_ARRAY[@]}")"
|
||||
|
||||
# Show usage if no options were specified
|
||||
@ -14620,22 +14624,28 @@ parse_cmd_line() {
|
||||
[[ $? -eq 0 ]] && shift
|
||||
do_html=true
|
||||
;;
|
||||
--outFile|--outFile|-oa|-oa=*)
|
||||
HTMLFILE="$(parse_opt_equal_sign "$1" "$2").html"
|
||||
CSVFILE="$(parse_opt_equal_sign "$1" "$2").csv"
|
||||
JSONFILE="$(parse_opt_equal_sign "$1" "$2").json"
|
||||
LOGFILE="$(parse_opt_equal_sign "$1" "$2").log"
|
||||
--outfile|--outfile|-oa|-oa=*)
|
||||
outfile_arg="$(parse_opt_equal_sign "$1" "$2")"
|
||||
if [[ "$outfile_arg" != "auto" ]]; then
|
||||
HTMLFILE="$outfile_arg.html"
|
||||
CSVFILE="$outfile_arg.csv"
|
||||
JSONFILE="$outfile_arg.json"
|
||||
LOGFILE="$outfile_arg.log"
|
||||
fi
|
||||
[[ $? -eq 0 ]] && shift
|
||||
do_html=true
|
||||
do_json=true
|
||||
do_csv=true
|
||||
do_logging=true
|
||||
;;
|
||||
--outfile|--outfile|-oA|-oA=*)
|
||||
HTMLFILE="$(parse_opt_equal_sign "$1" "$2").html"
|
||||
CSVFILE="$(parse_opt_equal_sign "$1" "$2").csv"
|
||||
JSONFILE="$(parse_opt_equal_sign "$1" "$2").json"
|
||||
LOGFILE="$(parse_opt_equal_sign "$1" "$2").log"
|
||||
--outFile|--outFile|foA|-oA=*)
|
||||
outfile_arg="$(parse_opt_equal_sign "$1" "$2")"
|
||||
if [[ "$outfile_arg" != "auto" ]]; then
|
||||
HTMLFILE="$outfile_arg.html"
|
||||
CSVFILE="$outfile_arg.csv"
|
||||
JSONFILE="$outfile_arg.json"
|
||||
LOGFILE="$outfile_arg.log"
|
||||
fi
|
||||
[[ $? -eq 0 ]] && shift
|
||||
do_html=true
|
||||
do_pretty_json=true
|
||||
@ -14654,7 +14664,6 @@ parse_cmd_line() {
|
||||
[[ $? -eq 0 ]] && shift
|
||||
;;
|
||||
--mapping|--mapping=*)
|
||||
local cipher_mapping
|
||||
cipher_mapping="$(parse_opt_equal_sign "$1" "$2")"
|
||||
[[ $? -eq 0 ]] && shift
|
||||
case "$cipher_mapping" in
|
||||
|
Loading…
Reference in New Issue
Block a user