From 986c8f631c9f987dae959d2f006913e7fe6a5606 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Sun, 1 Sep 2024 23:57:28 +0900 Subject: [PATCH] chore: fix max-rtt-timeout of ping --- src/my_portscanner/scan_tools/Scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/my_portscanner/scan_tools/Scan.py b/src/my_portscanner/scan_tools/Scan.py index 234f10e..69c9fda 100644 --- a/src/my_portscanner/scan_tools/Scan.py +++ b/src/my_portscanner/scan_tools/Scan.py @@ -52,7 +52,7 @@ def _get_latency(self) -> None: """ packet = IP(dst=self.target_ip) / ICMP() start_time = time.time() - response = sr1(packet, timeout=self.max_rtt_timeout, verbose=0) + response = sr1(packet, timeout=self.max_rtt_timeout / 1000, verbose=0) if response: latency = time.time() - start_time print(f"Host is up ({latency}s latency).")