Skip to content

Commit 7f40bf8

Browse files
committed
refactor: Remove convert_subdomains_to_domains function and update main menu options
1 parent e6ebc62 commit 7f40bf8

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

bugscanx/modules/others/file_toolkit.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,6 @@ def remove_duplicates():
114114
print(f"[green] - Unique count: {len(unique_lines)} lines[/green]")
115115
print(f"[green] - Duplicates removed: {duplicates_removed} lines[/green]")
116116

117-
def convert_subdomains_to_domains():
118-
file_path = get_input("Enter filename", "file")
119-
output_file = get_input("Enter output filename")
120-
121-
subdomains = read_lines(file_path)
122-
if not subdomains:
123-
return
124-
125-
root_domains = sorted({'.'.join(d.split('.')[-2:]) for d in subdomains if len(d.split('.')) >= 2})
126-
127-
if write_lines(output_file, root_domains):
128-
print(f"[green] Successfully converted subdomains to root domains:[/green]")
129-
print(f"[green] - Input subdomains: {len(subdomains)}[/green]")
130-
print(f"[green] - Unique root domains: {len(root_domains)}[/green]")
131-
print(f"[green] - Output file: '{os.path.basename(output_file)}'[/green]")
132-
133117
def filter_by_tlds():
134118
file_path = get_input("Enter filename", "file")
135119
tlds_input = get_input("Enter TLDs ", instruction="(e.g. com, org)")
@@ -243,12 +227,11 @@ def main():
243227
"1": ("SPLIT FILE", split_file, "bold cyan"),
244228
"2": ("MERGE FILES", merge_files, "bold blue"),
245229
"3": ("CLEAN FILE", clean_file, "bold cyan"),
246-
"4": ("REMOVE DUPLICATES", remove_duplicates, "bold yellow"),
247-
"5": ("SUBDOMAIN TO DOMAINS", convert_subdomains_to_domains, "bold magenta"),
248-
"6": ("FILTER BY TLD", filter_by_tlds, "bold magenta"),
249-
"7": ("FILTER BY KEYWORD", filter_by_keywords, "bold yellow"),
250-
"8": ("CIDR TO IP", cidr_to_ip, "bold green"),
251-
"9": ("DOMAIN TO IP", domains_to_ip, "bold blue"),
230+
"4": ("DEDUPLICATE", remove_duplicates, "bold yellow"),
231+
"5": ("FILTER BY TLD", filter_by_tlds, "bold magenta"),
232+
"6": ("FILTER BY KEYWORD", filter_by_keywords, "bold yellow"),
233+
"7": ("CIDR TO IP", cidr_to_ip, "bold green"),
234+
"8": ("DOMAIN TO IP", domains_to_ip, "bold blue"),
252235
"0": ("BACK", lambda: None, "bold red")
253236
}
254237

0 commit comments

Comments
 (0)