From 2f5cacd57be4825a710ffe8f530423603df53c6f Mon Sep 17 00:00:00 2001 From: WhatDidYouExpect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Sat, 26 Jul 2025 15:11:41 +0200 Subject: [PATCH] forgot to push whoopsie --- main.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index f0f3aac..4539f26 100644 --- a/main.py +++ b/main.py @@ -220,10 +220,19 @@ def main(): ip_line_map[ip] = idx + 1 for ip in ips_to_scan: print_status_line(ip, "waiting to scan...") - for ip in ips_to_scan: - if shutdown_event.is_set(): - break - scan_ports_for_ip(ip, port_start, port_end) + with ThreadPoolExecutor(max_workers=50) as ip_executor: + futures = [] + for ip in ips_to_scan: + if shutdown_event.is_set(): + break + futures.append(ip_executor.submit(scan_ports_for_ip, ip, port_start, port_end)) + + for future in as_completed(futures): + try: + future.result() + except Exception as e: + print(f"[!] error scanning IP: {e}") + bottom_line = len(ip_line_map) + 3 + len(open_port_msgs) move_cursor(bottom_line, 0)