mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-11 03:00:57 +01:00
FIX #691 (addressing case sensitive local hostnames)
This commit is contained in:
parent
540567ec83
commit
c9b833ed5c
@ -8126,7 +8126,7 @@ get_local_aaaa() {
|
|||||||
local etchosts="/etc/hosts /c/Windows/System32/drivers/etc/hosts"
|
local etchosts="/etc/hosts /c/Windows/System32/drivers/etc/hosts"
|
||||||
|
|
||||||
# for security testing sometimes we have local entries. Getent is BS under Linux for localhost: No network, no resolution
|
# for security testing sometimes we have local entries. Getent is BS under Linux for localhost: No network, no resolution
|
||||||
ip6=$(grep -wh "$1" $etchosts 2>/dev/null | grep ':' | egrep -v '^#|\.local' | egrep "[[:space:]]$1" | awk '{ print $1 }')
|
ip6=$(grep -wih "$1" $etchosts 2>/dev/null | grep ':' | egrep -v '^#|\.local' | egrep -i "[[:space:]]$1" | awk '{ print $1 }')
|
||||||
if is_ipv6addr "$ip6"; then
|
if is_ipv6addr "$ip6"; then
|
||||||
echo "$ip6"
|
echo "$ip6"
|
||||||
else
|
else
|
||||||
@ -8139,7 +8139,7 @@ get_local_a() {
|
|||||||
local etchosts="/etc/hosts /c/Windows/System32/drivers/etc/hosts"
|
local etchosts="/etc/hosts /c/Windows/System32/drivers/etc/hosts"
|
||||||
|
|
||||||
# for security testing sometimes we have local entries. Getent is BS under Linux for localhost: No network, no resolution
|
# for security testing sometimes we have local entries. Getent is BS under Linux for localhost: No network, no resolution
|
||||||
ip4=$(grep -wh "$1" $etchosts 2>/dev/null | egrep -v ':|^#|\.local' | egrep "[[:space:]]$1" | awk '{ print $1 }')
|
ip4=$(grep -wih "$1" $etchosts 2>/dev/null | egrep -v ':|^#|\.local' | egrep -i "[[:space:]]$1" | awk '{ print $1 }')
|
||||||
if is_ipv4addr "$ip4"; then
|
if is_ipv4addr "$ip4"; then
|
||||||
echo "$ip4"
|
echo "$ip4"
|
||||||
else
|
else
|
||||||
@ -9198,4 +9198,4 @@ fi
|
|||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
|
||||||
# $Id: testssl.sh,v 1.574 2017/03/27 20:37:06 dirkw Exp $
|
# $Id: testssl.sh,v 1.576 2017/04/04 08:03:41 dirkw Exp $
|
||||||
|
Loading…
Reference in New Issue
Block a user