Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does the subdomain finder stop because "label empty or too long"?

So I made this subdomain finder from a hacking course. It seems to work fine for a little bit but then gives a weird error. Could anyone help me?

Here is the code

        import requests

        url = "youtube.com"

        def request(url):
            try:
                return requests.get("http://" + url, timeout=2)
            except requests.exceptions.ConnectionError:
                pass
            except requests.exceptions.InvalidURL:
                print('INVALID:', url)

        with open("/home/kali/PycharmProjects/websitesub/subdomains-wodlist.txt", "r") as wordlist_file:
            for line in wordlist_file:
                word = line.strip()
                test_url = word + "." + url
                response = request(test_url)
                if response:
                    print("Discovered SUBDOM" + test_url) 

here is the output I am getting, as we can see it finds a few websites then stops

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

From the image with the stacktrace, last subdomains tested are:

  • pl,
  • es.

And then, the interesting part is at the end of the stackatrace:

failed to parse m..youtube.com

It seems that the word that failed is ending with a dot m. and thus the tried url is m..youtube and there is nothing between the two dots, leading to the error you get.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading