diff --git a/tldsec b/tldsec
@@ -1,5 +1,6 @@
#!/bin/sh
# NSEC walk script for DNSSEC - developed by acidvegas (https://git.acid.vegas/nsecx)
+# tldsec
# This script will check the DNSSEC status of all TLDs and output the results separated by NSEC, NSEC3, and NODNSSEC.
# NSEC3 records will also include the NSEC3PARAM parameters for the zone as well for cracking in Hashcat.
@@ -11,18 +12,15 @@ YELLOW='\033[0;33m'
CYAN='\033[0;36m'
PURPLE='\033[0;35m'
GRAY='\033[1;30m'
-NC='\033[0m' # No Color
+NC='\033[0m'
# Create the output directory if it doesn't exist
mkdir -p output
# Parse the tld list from a root nameserver (todo: randomize the root nameserver)
-rndroot=$(dig AXFR . @a.root-servers.net | grep -E 'IN\s+NS' | awk '{print $1}' | sed 's/\.$//' | sort -u)
-if [ -z $rndroot ]; then
- echo "Failed to AXFR a root nameserver (using IANA list instead)"
- tlds=$(curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | tail -n +2 | tr '[:upper:]' '[:lower:]')
-else
- tlds=$(echo | )
+tld_list=$(dig AXFR . @g.root-servers.net | grep -E 'IN\s+NS' | awk '{print $1}' | sed 's/\.$//' | sort -u)
+if [ -z $tld_list ]; then
+ tld_list=$(curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | tail -n +2 | tr '[:upper:]' '[:lower:]')
fi
# Check if the list was retrieved successfully
@@ -81,7 +79,4 @@ echo "$tld_list" | while read -r tld; do
"$nsec_total" "$nsec3_total" "$nodnssec_total" "$tld"
done
-# Move to a new line after the loop is done to avoid overwriting the last line
-echo
-
-echo "Check completed! Data written to the output directory."
+echo "\nCheck completed! Data written to the output directory."
+\ No newline at end of file
|