mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-11-04 07:45:27 +01:00 
			
		
		
		
	add support for http basic auth
This commit is contained in:
		
							
								
								
									
										10
									
								
								testssl.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								testssl.sh
									
									
									
									
									
								
							@@ -17164,6 +17164,7 @@ tuning / connect options (most also can be preset via environment variables):
 | 
				
			|||||||
     --ids-friendly                skips a few vulnerability checks which may cause IDSs to block the scanning IP
 | 
					     --ids-friendly                skips a few vulnerability checks which may cause IDSs to block the scanning IP
 | 
				
			||||||
     --phone-out                   allow to contact external servers for CRL download and querying OCSP responder
 | 
					     --phone-out                   allow to contact external servers for CRL download and querying OCSP responder
 | 
				
			||||||
     --add-ca <cafile>             path to <cafile> or a comma separated list of CA files enables test against additional CAs.
 | 
					     --add-ca <cafile>             path to <cafile> or a comma separated list of CA files enables test against additional CAs.
 | 
				
			||||||
 | 
					     --basicauth <user:pass>       provide HTTP basic auth information.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
output options (can also be preset via environment variables):
 | 
					output options (can also be preset via environment variables):
 | 
				
			||||||
     --quiet                       don't output the banner. By doing this you acknowledge usage terms normally appearing in the banner
 | 
					     --quiet                       don't output the banner. By doing this you acknowledge usage terms normally appearing in the banner
 | 
				
			||||||
@@ -18412,10 +18413,14 @@ determine_service() {
 | 
				
			|||||||
          # no STARTTLS.
 | 
					          # no STARTTLS.
 | 
				
			||||||
          determine_optimal_sockets_params
 | 
					          determine_optimal_sockets_params
 | 
				
			||||||
          determine_optimal_proto
 | 
					          determine_optimal_proto
 | 
				
			||||||
 | 
					          BASIC_AUTH_HEADER=""
 | 
				
			||||||
          $SNEAKY && \
 | 
					          $SNEAKY && \
 | 
				
			||||||
               ua="$UA_SNEAKY" || \
 | 
					               ua="$UA_SNEAKY" || \
 | 
				
			||||||
               ua="$UA_STD"
 | 
					               ua="$UA_STD"
 | 
				
			||||||
          GET_REQ11="GET $URL_PATH HTTP/1.1\r\nHost: $NODE\r\nUser-Agent: $ua\r\nAccept-Encoding: identity\r\nAccept: text/*\r\nConnection: Close\r\n\r\n"
 | 
					          if [[ ! -z "$BASICAUTH" ]]; then
 | 
				
			||||||
 | 
					               BASIC_AUTH_HEADER="Authorization: Basic `echo $BASICAUTH | basenc --base64` \r\n"
 | 
				
			||||||
 | 
					          fi
 | 
				
			||||||
 | 
					          GET_REQ11="GET $URL_PATH HTTP/1.1\r\nHost: $NODE\r\nUser-Agent: $ua\r\n$BASIC_AUTH_HEADER Accept-Encoding: identity\r\nAccept: text/*\r\nConnection: Close\r\n\r\n"
 | 
				
			||||||
          # returns always 0:
 | 
					          # returns always 0:
 | 
				
			||||||
          service_detection $OPTIMAL_PROTO
 | 
					          service_detection $OPTIMAL_PROTO
 | 
				
			||||||
     else # STARTTLS
 | 
					     else # STARTTLS
 | 
				
			||||||
@@ -19783,6 +19788,9 @@ parse_cmd_line() {
 | 
				
			|||||||
               --ssl_native|--ssl-native)
 | 
					               --ssl_native|--ssl-native)
 | 
				
			||||||
                    SSL_NATIVE=true
 | 
					                    SSL_NATIVE=true
 | 
				
			||||||
                    ;;
 | 
					                    ;;
 | 
				
			||||||
 | 
					               --basicauth|--basicauth=*)
 | 
				
			||||||
 | 
					                   BASICAUTH="$(parse_opt_equal_sign "$1" "$2")"
 | 
				
			||||||
 | 
					                   ;;
 | 
				
			||||||
               (--) shift
 | 
					               (--) shift
 | 
				
			||||||
                    break
 | 
					                    break
 | 
				
			||||||
                    ;;
 | 
					                    ;;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user