resurrecting-open-source-projects / dnsmap

Scan for subdomains using bruteforcing techniques
GNU General Public License v3.0
37 stars 7 forks source link

[ Bug ]: Not working with .network domain #2

Closed setuidroot closed 3 years ago

setuidroot commented 3 years ago

dnsmap doesn't work with any .network domain names. It just gives an error saying that "entered domain is not valid!" despite the fact that the domain name is valid.

This issue is due to the code in dnsmap.c limiting TLD names to between 2 and 6 characters. This is not long enough these days because there are so many more TLDomain names of various lengths.

You can run this command in Ubuntu (bash shell) to see a list of some of the longest TLD names:

curl -s https://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | awk '{ print length(), $0 | "sort -n" }'

From this TLD name list, we see that there are domains as long as 24 characters (longest English domain name is 18 characters.) I think 13 characters is long enough... there are few TLD names that are longer than 13 characters. Thus I have made a PR updating dnsmap.c to a 13 character TLD limit as well as updating the ChangeLog and man pages to reflect this patch (dnsmap version 0.36.)

This patch is helpful to me because I use dnsmap in Termux (Android) but I'm unable to test any domains longer than 6 characters. Hopefully this patch is added to the master here so it will fix this issue for others as well. I have followed the UPDATE-CHECK list with my PR. I tested it on Ubuntu 20.04 (64 bit) server and on my Android (ARMv7 32 bit) phone. It works well on both. The change is very minor, so I doubt it broke any functionality. I have some ideas for improving dnsmap using Mozilla's PublicSuffix list for TLDs and some other things... but that kind of large change would probably break things. For now just a minor bugfix patch PR.

eribertomota commented 3 years ago

Closed by #3