pogzyb / asyncwhois

Python WHOIS and RDAP utility for querying and parsing information about Domains, IPv4s, IPv6s, and AS numbers
MIT License
63 stars 18 forks source link

Stuck on .tk domain #34

Closed Rubikoid closed 2 years ago

Rubikoid commented 2 years ago

On whois of any registered in the past .tk domain, entire thread gets stuck on regex.

For example, let's use asdasdasdasd.tk domain, which is has been registered sometime ago, but now is free.

Whois service return the text data:


   Domain name:
      ASDASDASDASD.TK

   Organisation:
      Freedom Registry, Inc.
      2225 East Bayshore Road #290
      Palo Alto CA 94303
      United States
      Phone: +1 650-681-4172
      Fax: +1 650-681-4173

   Domain Nameservers:
      NS01.FREENOM.COM
      NS02.FREENOM.COM
      NS03.FREENOM.COM
      NS04.FREENOM.COM

   Your selected domain name is a domain name that has been
   cancelled, suspended, refused or reserved at the Dot TK Registry

   It may be available for re-registration at http://www.dot.tk

   In the interim, the rights for this domain have been automatically
   transferred to Freedom Registry, Inc.

   Please be advised that the Dot TK Registry, Freenom and
   Freedom Registry, Inc. cannot be held responsible for any content
   that was previously available at this domain name.

   Due to restrictions in Dot TK 's Privacy Statement personal information
   about the previous registrants of the domain name cannot be released
   to the general public.

   Dot TK is proud to work with numerous governmental law enforcement
   agencies to stop spam, fraud, phishing attempts, child pornography and
   other illicit content on Dot TK websites. These agencies may contact the
   Dot TK Registry directly with any enquiries they may have regarding the
   usage of this domain by previous registrants.

   Record maintained by: Dot TK Domain Registry

So, the problem is in parse_tld.py#L1169, because it search for Owner contact, that doesn't exist.

imho, this regex enough dangerous, but as hotfix, i assume, would be enough to add const available for re-registration at to parse_tld.DomainParser._no_match_checks

pogzyb commented 2 years ago

Thank you for finding this! This bug is gross.

I think your suggestion for adding "available for re-registration" to parse_tld.DomainParser._no_match_checks is a good idea for handling this scenario. Additionally, I will fix that regex as there are likely other scenarios where it will fail.

pogzyb commented 2 years ago

I'll leave #35 open for some time if you want to review it. I think it handles the scenarios described here.