TypeError / domained

Multi Tool Subdomain Enumeration
GNU General Public License v3.0
722 stars 157 forks source link

Invalid domains/subdomains should be removed #64

Open ccsplit opened 4 years ago

ccsplit commented 4 years ago

Currently the application will send all of the results into the various tools such as EyeWitness which can cause issues such as the one below. Therefore, it would be a good idea to remove invalid domains after the results are returned. This could be done a couple of ways such as trying to resolve the domains and if it errors/cannot obtain an IP address ignoring and/or placing it into an invalid domain list.

I will work on implementing this if I get a chance.

Attempting to screenshot https://.example.com
Process Process-5:
Traceback (most recent call last):
File "/usr/lib/python3.7/encodings/idna.py", line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/ec2-user/domained/bin/EyeWitness/EyeWitness.py", line 303, in worker_thread
http_object.resolved = resolve_host(http_object.remote_system)
File "/home/ec2-user/domained/bin/EyeWitness/modules/helpers.py", line 293, in resolve_host
resolved = socket.gethostbyname(system)
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
Finished in 8636.717457056046 seconds

Originally posted by @tanujjane in https://github.com/TypeError/domained/issues/61#issuecomment-558174781