1
0

fix: prevent endless loop of wildcard enumeration

This commit is contained in:
Nicolas Duchon 2021-08-03 23:16:36 +02:00
parent 2b5fd94271
commit dddd7a5a82
No known key found for this signature in database
GPG Key ID: EA3151C66A4D79E7

@ -43,7 +43,11 @@ function ascending_wildcard_locations {
until [[ "$domain" =~ $regex ]]; do
first_label="${domain%%.*}"
domain="${domain/${first_label}./}"
echo "*.${domain}"
if [[ -z "$domain" ]]; then
return
else
echo "*.${domain}"
fi
done
}
@ -59,7 +63,11 @@ function descending_wildcard_locations {
until [[ "$domain" =~ $regex ]]; do
last_label="${domain##*.}"
domain="${domain/.${last_label}/}"
echo "${domain}.*"
if [[ -z "$domain" ]]; then
return
else
echo "${domain}.*"
fi
done
}