mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-30 21:35:26 +01:00 
			
		
		
		
	Merge pull request #1245 from dcooper16/outfile_directory
The -outfile, -oa, -outFile, and -oA options should accept a directory
This commit is contained in:
		
							
								
								
									
										17
									
								
								testssl.sh
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								testssl.sh
									
									
									
									
									
								
							| @@ -16591,7 +16591,8 @@ file output options (can also be preset via environment variables) | |||||||
|      --csvfile|-oC <csvfile>       additional output as CSV to the specified file or directory, similar to --logfile |      --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 specified file or directory, similar to --logfile |      --htmlfile|-oH <htmlfile>     additional output as HTML to the specified file or directory, similar to --logfile | ||||||
|      --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}' |      --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}'. If fname if a dir uses 'dir/\${NODE}-p\${port}\${YYYYMMDD-HHMM}' | ||||||
|      --hints                       additional hints to findings |      --hints                       additional hints to findings | ||||||
|      --severity <severity>         severities with lower level will be filtered for CSV+JSON, possible values <LOW|MEDIUM|HIGH|CRITICAL> |      --severity <severity>         severities with lower level will be filtered for CSV+JSON, possible values <LOW|MEDIUM|HIGH|CRITICAL> | ||||||
|      --append                      if (non-empty) <logfile>, <csvfile>, <jsonfile> or <htmlfile> exists, append to file. Omits any header |      --append                      if (non-empty) <logfile>, <csvfile>, <jsonfile> or <htmlfile> exists, append to file. Omits any header | ||||||
| @@ -18933,11 +18934,18 @@ parse_cmd_line() { | |||||||
|                     ( "$do_html" || "$do_json" || "$do_pretty_json" || "$do_csv" || "$do_logging" ) && fatal "check your arguments four multiple file output options" $ERR_CMDLINE |                     ( "$do_html" || "$do_json" || "$do_pretty_json" || "$do_csv" || "$do_logging" ) && fatal "check your arguments four multiple file output options" $ERR_CMDLINE | ||||||
|                     outfile_arg="$(parse_opt_equal_sign "$1" "$2")" |                     outfile_arg="$(parse_opt_equal_sign "$1" "$2")" | ||||||
|                     if [[ "$outfile_arg" != "auto" ]]; then |                     if [[ "$outfile_arg" != "auto" ]]; then | ||||||
|  |                          if [[ -d "$outfile_arg" ]]; then | ||||||
|  |                               HTMLFILE="$outfile_arg" | ||||||
|  |                               CSVFILE="$outfile_arg" | ||||||
|  |                               JSONFILE="$outfile_arg" | ||||||
|  |                               LOGFILE="$outfile_arg" | ||||||
|  |                          else | ||||||
|                               HTMLFILE="$outfile_arg.html" |                               HTMLFILE="$outfile_arg.html" | ||||||
|                               CSVFILE="$outfile_arg.csv" |                               CSVFILE="$outfile_arg.csv" | ||||||
|                               JSONFILE="$outfile_arg.json" |                               JSONFILE="$outfile_arg.json" | ||||||
|                               LOGFILE="$outfile_arg.log" |                               LOGFILE="$outfile_arg.log" | ||||||
|                          fi |                          fi | ||||||
|  |                     fi | ||||||
|                     [[ $? -eq 0 ]] && shift |                     [[ $? -eq 0 ]] && shift | ||||||
|                     do_html=true |                     do_html=true | ||||||
|                     do_json=true |                     do_json=true | ||||||
| @@ -18948,11 +18956,18 @@ parse_cmd_line() { | |||||||
|                     ( "$do_html" || "$do_json" || "$do_pretty_json" || "$do_csv" || "$do_logging" ) && fatal "check your arguments four multiple file output options" $ERR_CMDLINE |                     ( "$do_html" || "$do_json" || "$do_pretty_json" || "$do_csv" || "$do_logging" ) && fatal "check your arguments four multiple file output options" $ERR_CMDLINE | ||||||
|                     outfile_arg="$(parse_opt_equal_sign "$1" "$2")" |                     outfile_arg="$(parse_opt_equal_sign "$1" "$2")" | ||||||
|                     if [[ "$outfile_arg" != "auto" ]]; then |                     if [[ "$outfile_arg" != "auto" ]]; then | ||||||
|  |                          if [[ -d "$outfile_arg" ]]; then | ||||||
|  |                               HTMLFILE="$outfile_arg" | ||||||
|  |                               CSVFILE="$outfile_arg" | ||||||
|  |                               JSONFILE="$outfile_arg" | ||||||
|  |                               LOGFILE="$outfile_arg" | ||||||
|  |                          else | ||||||
|                               HTMLFILE="$outfile_arg.html" |                               HTMLFILE="$outfile_arg.html" | ||||||
|                               CSVFILE="$outfile_arg.csv" |                               CSVFILE="$outfile_arg.csv" | ||||||
|                               JSONFILE="$outfile_arg.json" |                               JSONFILE="$outfile_arg.json" | ||||||
|                               LOGFILE="$outfile_arg.log" |                               LOGFILE="$outfile_arg.log" | ||||||
|                          fi |                          fi | ||||||
|  |                     fi | ||||||
|                     [[ $? -eq 0 ]] && shift |                     [[ $? -eq 0 ]] && shift | ||||||
|                     do_html=true |                     do_html=true | ||||||
|                     do_pretty_json=true |                     do_pretty_json=true | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dirk Wetter
					Dirk Wetter