diff --git a/setup.py b/setup.py index 95c38a2..8623e73 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='evilurl', - version='2.0.2', + version='2.0.3', packages=['src'], package_data={'src': ['unicode_combinations.json']}, setup_requires=['wheel'], diff --git a/src/evilurl.py b/src/evilurl.py index ad0c6b5..6ff6bb9 100644 --- a/src/evilurl.py +++ b/src/evilurl.py @@ -86,7 +86,6 @@ def analyze_domain(self, domain): table_data = [] for index, main_domain_part in enumerate(unique_domains): full_domain = main_domain_part + '.' + domain_parts.suffix - formatted_combinations = [] punycode_encoded_domain = main_domain_part.encode('idna').decode() punycode_encoded_full_domain = punycode_encoded_domain + '.' + domain_parts.suffix if full_domain == punycode_encoded_full_domain: @@ -96,22 +95,25 @@ def analyze_domain(self, domain): if (not dns and self.show_registered_only) or (self.show_mixed_only and not self.is_mixed_domain(punycode_encoded_domain, families)): continue + combinations_list = [] + combinations_dict = {} for part in main_domain_part: for char in part: - if char in self.character_descriptions.keys(): - formatted_combinations.append(f"{char} → {self.character_descriptions.get(char)}") + if char in self.character_descriptions: + combinations_list.append(f"{char} → {self.character_descriptions[char]}") + combinations_dict[char] = self.character_descriptions[char] + if self.show_domains_only: print(full_domain) continue - combinations_str = "\n".join(formatted_combinations) table_data.append([ full_domain, punycode_encoded_full_domain, dns if dns else 'UNSET', "YES" if self.is_mixed_domain(punycode_encoded_domain, families) else self.colored_text("NO", 33), - combinations_str + "\n".join(combinations_list) if not self.json_format else combinations_dict ]) if self.json_format: @@ -123,7 +125,6 @@ def analyze_domain(self, domain): if not self.show_domains_only: print(tabulate(table_data, TABLE_HEADERS, tablefmt="grid")) - def load_unicode_combinations_from_file(file_path): try: with open(file_path, 'r') as file: