Projects STRLCPY opensquat Commits bf2c7139
🤬
  • ■ ■ ■ ■ ■
    opensquat/app.py
    skipped 388 lines
    389 389   
    390 390   return self.list_domains
    391 391   
    392  - # Check if site is reachable.
    393  - # Returns a tuple -> (is_reachable: bool, description: str)
    394 392   def is_site_reachable(self, domain):
    395  - output = (False, "Not reachable")
     393 + """
     394 + Check if site is reachable in HTTPS
     395 + 
     396 + Args:
     397 + domain name: domain name to search
     398 + 
     399 + Returns 2-length tuple:
     400 + Site reachable -> bool
     401 + Error string -> str
     402 + """
    396 403   try:
    397 404   response = requests.get(f"https://{domain}")
    398 405   self.response = response
    skipped 5 lines
    404 411   return output
    405 412   
    406 413   def response_contains_keyword(self, keyword):
     414 + """
     415 + Check if response contains a specific keyword in response
     416 + 
     417 + Args:
     418 + keyword: keyword to search
     419 + 
     420 + Returns:
     421 + bool
     422 + """
    407 423   return keyword in self.response.text
    408 424   
    409 425   def _process_doppelgagner_only(self, keyword, domain, domains):
    skipped 11 lines
    421 437   if doppelganger:
    422 438   reachable = self.is_site_reachable(domains)[0]
    423 439   if self.response_contains_keyword(keyword):
    424  - print_info(f"Site response contains {keyword} !")
     440 + print_info(f"Site contains {keyword} !")
    425 441   if not ct.CRTSH.check_certificate(domains):
    426 442   print_info("suspicious certificate detected")
    427 443   else:
    skipped 191 lines
Please wait...
Page is in error, reload to recover