@@ -197,7 +197,11 @@ TESTSSL_INSTALL_DIR="${TESTSSL_INSTALL_DIR:-""}" # If you run testssl.sh and it
197
197
CA_BUNDLES_PATH="${CA_BUNDLES_PATH:-""}" # You can have your CA stores some place else
198
198
EXPERIMENTAL=${EXPERIMENTAL:-false} # a development hook which allows us to disable code
199
199
PROXY_WAIT=${PROXY_WAIT:-20} # waiting at max 20 seconds for socket reply through proxy
200
+ <<<<<<< HEAD
200
201
DNS_VIA_PROXY=${DNS_VIA_PROXY:-false} # do DNS lookups via proxy. --ip=proxy reverses this
202
+ =======
203
+ DNS_VIA_PROXY=${DNS_VIA_PROXY:-true} # do DNS lookups via proxy. --ip=* reverses this
204
+ >>>>>>> 283c66f (fixed DNS via Proxy)
201
205
IGN_OCSP_PROXY=${IGN_OCSP_PROXY:-false} # Also when --proxy is supplied it is ignored when testing for revocation via OCSP via --phone-out
202
206
HEADER_MAXSLEEP=${HEADER_MAXSLEEP:-5} # we wait this long before killing the process to retrieve a service banner / http header
203
207
MAX_SOCKET_FAIL=${MAX_SOCKET_FAIL:-2} # If this many failures for TCP socket connects are reached we terminate
@@ -22085,11 +22089,16 @@ determine_ip_addresses() {
22085
22089
local ip4=""
22086
22090
local ip6=""
22087
22091
22092
+ if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
22093
+ IPADDRs="$NODE"
22094
+ return 0
22095
+ fi
22096
+
22088
22097
ip4="$(get_a_record "$NODE")"
22089
22098
ip6="$(get_aaaa_record "$NODE")"
22090
22099
IP46ADDRs=$(newline_to_spaces "$ip4 $ip6")
22091
22100
22092
- if [[ -n "$CMDLINE_IP" ]]; then
22101
+ if [[ -n "$CMDLINE_IP" ]] && [[ "$CMDLINE_IP" != "all" ]] ; then
22093
22102
# command line has supplied an IP address or "one"
22094
22103
if [[ "$CMDLINE_IP" == one ]]; then
22095
22104
# use first IPv6 or IPv4 address
@@ -22981,11 +22990,19 @@ display_rdns_etc() {
22981
22990
datebanner() {
22982
22991
local scan_time_f=""
22983
22992
local node_banner=""
22993
+ <<<<<<< HEAD
22984
22994
22985
22995
if [[ -n "$PROXY" ]] && "$DNS_VIA_PROXY"; then
22986
22996
node_banner="$NODE:$PORT"
22987
22997
else
22988
22998
node_banner="$NODEIP:$PORT ($NODE)"
22999
+ =======
23000
+
23001
+ if [[ -n "PROXY" ]] && $DNS_VIA_PROXY;then
23002
+ node_banner="$NODE:$PORT"
23003
+ else
23004
+ node_banner="$NODEIP:$PORT ($NODE)"
23005
+ >>>>>>> 283c66f (fixed DNS via Proxy)
22989
23006
fi
22990
23007
22991
23008
if [[ "$1" =~ Done ]] ; then
@@ -24061,10 +24078,8 @@ parse_cmd_line() {
24061
24078
--ip|--ip=*)
24062
24079
CMDLINE_IP="$(parse_opt_equal_sign "$1" "$2")"
24063
24080
[[ $? -eq 0 ]] && shift
24064
- if [[ "$CMDLINE_IP" == proxy ]]; then
24065
- DNS_VIA_PROXY=true
24066
- unset CMDLINE_IP
24067
- fi
24081
+ DNS_VIA_PROXY=false
24082
+
24068
24083
# normalize any IPv6 address
24069
24084
CMDLINE_IP="${CMDLINE_IP//[/}" # fix vim syntax highlighting "]
24070
24085
CMDLINE_IP="${CMDLINE_IP//]/}"
@@ -24950,6 +24965,7 @@ lets_roll() {
24950
24965
[[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs and IP46ADDR is set now
24951
24966
prepare_logging
24952
24967
24968
+ <<<<<<< HEAD
24953
24969
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
24954
24970
NODEIP="$NODE"
24955
24971
lets_roll "${STARTTLS_PROTOCOL}"
@@ -24974,6 +24990,26 @@ lets_roll() {
24974
24990
lets_roll "${STARTTLS_PROTOCOL}"
24975
24991
RET=$?
24976
24992
fi
24993
+ =======
24994
+ determine_ip_addresses
24995
+ if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check
24996
+ MULTIPLE_CHECKS=true
24997
+ pr_bold "Testing all IPv4 addresses (port $PORT): "; outln "$IPADDRs"
24998
+ for ip in $IPADDRs; do
24999
+ draw_line "-" $((TERM_WIDTH * 2 / 3))
25000
+ outln
25001
+ NODEIP="$ip"
25002
+ lets_roll "${STARTTLS_PROTOCOL}"
25003
+ RET=$((RET + $?)) # RET value per IP address
25004
+ done
25005
+ draw_line "-" $((TERM_WIDTH * 2 / 3))
25006
+ outln
25007
+ pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs"
25008
+ else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied
25009
+ NODEIP="$IPADDRs"
25010
+ lets_roll "${STARTTLS_PROTOCOL}"
25011
+ RET=$?
25012
+ >>>>>>> 283c66f (fixed DNS via Proxy)
24977
25013
fi
24978
25014
24979
25015
exit $RET
0 commit comments