Bug Hunter - Program Python Clean IPv6 extraction

  Рет қаралды 20

Sharing Ilmu

Sharing Ilmu

Күн бұрын

Пікірлер: 1
@sharingilmubarengibnu
@sharingilmubarengibnu 11 күн бұрын
from rich.console import Console from rich.panel import Panel from rich.text import Text from rich.table import Table from rich import print as rprint import re import sys import os console = Console() def clear_screen(): os.system('cls' if os.name == 'nt' else 'clear') def show_banner(): banner = Text() banner.append("╔══════════════════════════════════════════╗ ", style="cyan") banner.append("║ IPv6 Extractor Tool v1.0 ║ ", style="cyan bold") banner.append("║ DNS Enumeration & Analysis Tool ║ ", style="cyan") banner.append("╚══════════════════════════════════════════╝ ", style="cyan") console.print(Panel(banner, border_style="cyan")) def show_author(): author = Table(show_header=False, border_style="cyan") author.add_row("[cyan]Developer[/cyan]", "[white]:[/white]", "[yellow]Ibnu Rusdianto[/yellow]") author.add_row("[cyan]Version[/cyan]", "[white]:[/white]", "[yellow]1.0[/yellow]") author.add_row("[cyan]Github[/cyan]", "[white]:[/white]", "[yellow]github.com/ibnurusdianto[/yellow]") console.print(Panel(author, title="[cyan]Author Information[/cyan]", border_style="cyan")) def show_description(): desc = """ This tool is designed to extract IPv6 addresses from DNS enumeration results. It processes MassDNS output format and cleanly extracts only the IPv6 addresses. Features: • Clean IPv6 extraction • Duplicate removal • Formatted output • File handling """ console.print(Panel(desc, title="[cyan]Tool Description[/cyan]", border_style="cyan")) def show_usage(): usage = """ [cyan]Usage:[/cyan] 1. Place your input file (output_ipv6.txt) in the same directory 2. Select option 1 to process the file 3. Results will be saved to 'extracted_ipv6.txt' [cyan]Input Format:[/cyan] domain.example.com. AAAA 2606:4700:20::681a:804 [cyan]Output Format:[/cyan] 2606:4700:20::681a:804 """ console.print(Panel(usage, title="[cyan]Usage Guide[/cyan]", border_style="cyan")) def process_file(filename): try: with open(filename, 'r') as file: content = file.read() # Extract IPv6 addresses using regex ipv6_pattern = r'AAAA\s+([0-9a-fA-F:]+)' ipv6_addresses = re.findall(ipv6_pattern, content) # Remove duplicates while preserving order unique_ipv6 = list(dict.fromkeys(ipv6_addresses)) # Save to output file with open('extracted_ipv6.txt', 'w') as outfile: for ip in unique_ipv6: outfile.write(f"{ip} ") # Show results result_table = Table(title="Processing Results", border_style="cyan") result_table.add_column("Description", style="cyan") result_table.add_column("Count", style="green") result_table.add_row("Total IPv6 addresses found", str(len(ipv6_addresses))) result_table.add_row("Unique IPv6 addresses", str(len(unique_ipv6))) result_table.add_row("Output file", "extracted_ipv6.txt") console.print(result_table) return True except FileNotFoundError: console.print("[red]Error: Input file not found![/red]") return False except Exception as e: console.print(f"[red]Error: {str(e)}[/red]") return False def main_menu(): while True: clear_screen() show_banner() menu = Table(show_header=False, border_style="cyan") menu.add_row("[cyan]1.[/cyan]", "[white]Process IPv6 File[/white]") menu.add_row("[cyan]2.[/cyan]", "[white]Show Tool Description[/white]") menu.add_row("[cyan]3.[/cyan]", "[white]Show Usage Guide[/white]") menu.add_row("[cyan]4.[/cyan]", "[white]Show Author Information[/white]") menu.add_row("[cyan]5.[/cyan]", "[white]Exit[/white]") console.print(Panel(menu, title="[cyan]Main Menu[/cyan]", border_style="cyan")) choice = console.input("[cyan]Enter your choice (1-5): [/cyan]") if choice == "1": clear_screen() show_banner() console.print("[cyan]Processing file...[/cyan]") if process_file('output_ipv6.txt'): console.input(" [green]Press Enter to continue...[/green]") elif choice == "2": clear_screen() show_banner() show_description() console.input(" [cyan]Press Enter to continue...[/cyan]") elif choice == "3": clear_screen() show_banner() show_usage() console.input(" [cyan]Press Enter to continue...[/cyan]") elif choice == "4": clear_screen() show_banner() show_author() console.input(" [cyan]Press Enter to continue...[/cyan]") elif choice == "5": clear_screen() console.print("[cyan]Thank you for using IPv6 Extractor Tool![/cyan]") sys.exit(0) else: console.print("[red]Invalid choice! Please try again.[/red]") console.input(" Press Enter to continue...") if __name__ == "__main__": main_menu()
Why are files stored in the database?
17:40
Programmer Zaman Now
Рет қаралды 23 М.
Microsoft Office 2024 secara resmi Microsoft
24:38
Sharing Ilmu
Рет қаралды 388
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Fenomena Sains Aneh yang Ditemukan di Internet.
16:52
Fajrul Fx
Рет қаралды 210 М.
Faulty Ubiquiti POE Network Switch | Can I Fix It?
31:22
Buy it Fix it
Рет қаралды 34 М.
Kenapa Semua Orang Salah Menjawab Pertanyaan Ini.
12:46
Fajrul Fx
Рет қаралды 429 М.
Claude MCP - How To Modify Your Servers To The Next Level
14:21
All About AI
Рет қаралды 8 М.
Just Tried WORDPRESS 🤯
27:55
Dea Afrizal
Рет қаралды 30 М.
PHP is slow, it needs 16 cpu for 1000 users
16:20
Programmer Zaman Now
Рет қаралды 22 М.
Your Own WEB SERVER On CasaOS, It's Easy!
23:34
Dea Afrizal
Рет қаралды 12 М.
Apa itu Pemrograman?
7:22
Web Programming UNPAS
Рет қаралды 166 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19