From 8d5f30281ed4e1a3b7bad6b1b460cfff27862fc2 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Fri, 24 Oct 2025 22:37:05 +0530 Subject: [PATCH 01/26] File named hostcheck.py is added to check whether target is buggy or not and changes are done accordingly in app.py to drop buggy target names . e.g. 465.54.543.35 , google , ajkbfdsv etc. --- nettacker/core/app.py | 69 ++++++++++++++++++++- nettacker/core/hostcheck.py | 120 ++++++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 nettacker/core/hostcheck.py diff --git a/nettacker/core/app.py b/nettacker/core/app.py index 5cd47a98b..eb2868a4e 100644 --- a/nettacker/core/app.py +++ b/nettacker/core/app.py @@ -7,7 +7,7 @@ from threading import Thread import multiprocess - +from concurrent.futures import ThreadPoolExecutor, as_completed from nettacker import logger from nettacker.config import Config, version_info from nettacker.core.arg_parser import ArgParser @@ -23,6 +23,7 @@ is_ipv6_range, is_ipv6_cidr, ) +from nettacker.core.hostcheck import resolve_quick, is_ip_literal, valid_hostname from nettacker.core.messages import messages as _ from nettacker.core.module import Module from nettacker.core.socks_proxy import set_socks_proxy @@ -142,7 +143,7 @@ def expand_targets(self, scan_id): ): targets += generate_ip_range(target) # domains probably - else: + else: targets.append(target) self.arguments.targets = targets self.arguments.url_base_path = base_path @@ -206,6 +207,7 @@ def run(self): Returns: True when it ends """ + log.info("Process started!!") scan_id = common_utils.generate_random_token(32) log.info("ScanID: {0}".format(scan_id)) log.info(_("regrouping_targets")) @@ -214,13 +216,14 @@ def run(self): self.arguments.targets = self.expand_targets(scan_id) if not self.arguments.targets: log.info(_("no_live_service_found")) + log.info("Process done!!") return True exit_code = self.start_scan(scan_id) create_report(self.arguments, scan_id) if self.arguments.scan_compare_id is not None: create_compare_report(self.arguments, scan_id) log.info("ScanID: {0} ".format(scan_id) + _("done")) - + log.info("Process done!!") return exit_code def start_scan(self, scan_id): @@ -289,7 +292,67 @@ def scan_target( return os.EX_OK + + def filter_valid_targets(self, targets, timeout_per_target=2.0, max_workers=None, dedupe=True): + """ + Parallel validation of targets via resolve_quick(target, timeout_sec). + Returns a list of canonical targets (order preserved, invalids removed). + """ + # Ensure it's a concrete list (len, indexing OK) + try: + targets = list(targets) + except TypeError: + raise TypeError(f"`targets` must be iterable, got {type(targets).__name__}") + + if not targets: + return [] + + if max_workers is None: + max_workers = min(len(targets), 64) # cap threads + + # Preserve order + canon_by_index = [None] * len(targets) + + def _task(idx, t): + ok, canon = resolve_quick(t, timeout_sec=timeout_per_target) + return idx, t, (canon if ok and canon else None) + + with ThreadPoolExecutor(max_workers=max_workers) as ex: + futures = [ex.submit(_task, i, t) for i, t in enumerate(targets)] + for fut in as_completed(futures): + try: + idx, orig_target, canon = fut.result() + except Exception as e: + # Treat as invalid on error; log with the best context we have + log.info(f"Invalid target (exception): {e!s}") + continue + + if canon: + canon_by_index[idx] = canon + else: + log.info(f"Invalid target -> dropping: {orig_target}") + + # Keep order, drop Nones + filtered = [c for c in canon_by_index if c is not None] + + if dedupe: + seen, unique = set(), [] + for c in filtered: + if c not in seen: + seen.add(c) + unique.append(c) + return unique + return filtered + def scan_target_group(self, targets, scan_id, process_number): + + if(not self.arguments.socks_proxy): + targets = self.filter_valid_targets( + targets, + timeout_per_target=2.0, + max_workers=self.arguments.parallel_module_scan or None, + dedupe=True, + ) active_threads = [] log.verbose_event_info(_("single_process_started").format(process_number)) total_number_of_modules = len(targets) * len(self.arguments.selected_modules) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py new file mode 100644 index 000000000..ca219a002 --- /dev/null +++ b/nettacker/core/hostcheck.py @@ -0,0 +1,120 @@ +# nettacker/core/hostcheck.py +from __future__ import annotations +import re +import socket +import time +import concurrent.futures +import os +import sys + + +_LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? bool: + try: + socket.inet_pton(socket.AF_INET, name); return True + except OSError: + pass + try: + socket.inet_pton(socket.AF_INET6, name); return True + except OSError: + return False + +def valid_hostname(host: str, allow_single_label: bool = False) -> bool: + if len(host) > 253: + return False + if host.endswith("."): + host = host[:-1] + parts = host.split(".") + if len(parts) < 2 and not allow_single_label: + # log.warn("Its a name like google") + print("itegb") + return False + return all(_LABEL.match(p) for p in parts) + +def _system_search_suffixes() -> list[str]: + # Only used when host has no dots; mirrors OS resolver search behavior (UNIX). + sufs: list[str] = [] + try: + with open("/etc/resolv.conf") as f: + for line in f: + line = line.strip() + if not line or line.startswith("#"): continue + if line.startswith("search") or line.startswith("domain"): + sufs += [x for x in line.split()[1:] if x] + except Exception: + pass + seen = set(); out: list[str] = [] + for s in sufs: + if s not in seen: + seen.add(s); out.append(s) + return out + +# --- safer, more robust pieces to replace in hostcheck.py --- + +def _gai_once(name: str, use_ai_addrconfig: bool, port): + flags = getattr(socket, "AI_ADDRCONFIG", 0) if use_ai_addrconfig else 0 + return socket.getaddrinfo( + name, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, flags + ) + +def resolve_quick(host: str, + timeout_sec: float = 2.0, + try_search_suffixes: bool = True, + allow_single_label: bool = True) -> tuple[bool, str | None]: + + candidates: list[str] = [] + if "." in host: + # try both plain and absolute forms; whichever resolves first wins + if host.endswith("."): + candidates.extend([host, host[:-1]]) + else: + candidates.extend([host, host + "."]) + else: + # single label (e.g., "intranet") + if try_search_suffixes: + for s in _system_search_suffixes(): + candidates.extend([f"{host}.{s}", f"{host}.{s}."]) + if not host.endswith("."): + candidates.append(host + ".") # bare absolute + candidates.append(host) + + seen, uniq = set(), [] + for c in candidates: + if c not in seen: + seen.add(c); uniq.append(c) + candidates = uniq + if not candidates: + return False, None + + for pass_ix, (use_ai_addrconfig, port) in enumerate(((True, None), (False, None))): + deadline = time.monotonic() + timeout_sec + with concurrent.futures.ThreadPoolExecutor(max_workers=len(candidates)) as ex: + fut2cand = {ex.submit(_gai_once, c, use_ai_addrconfig, port): c for c in candidates} + pending = set(fut2cand) + while pending: + remaining = deadline - time.monotonic() + if remaining <= 0: + break + done, pending = concurrent.futures.wait( + pending, timeout=remaining, + return_when=concurrent.futures.FIRST_COMPLETED + ) + for fut in done: + try: + res = fut.result() # success if no exception + # Optional: assert non-empty result + if not res: + # treat as failure + raise RuntimeError("empty getaddrinfo result") + chosen = fut2cand[fut] + # cancel stragglers + for p in pending: p.cancel() + return True, (chosen[:-1] if chosen.endswith(".") else chosen) + except Exception as e: + # TEMPORARY DEBUG LOGS — remove later + # print(f"[pass {pass_ix}] {fut2cand[fut]} -> {type(e).__name__}: {e!s}") + continue + # cancel any survivors in this pass + for f in fut2cand: f.cancel() + return False, None From aa994c57cf3472d1fc62ebce490903eab5c27a3b Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Fri, 24 Oct 2025 23:01:42 +0530 Subject: [PATCH 02/26] Update app.py Signed-off-by: Aarush289 --- nettacker/core/app.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/nettacker/core/app.py b/nettacker/core/app.py index eb2868a4e..c323f8c33 100644 --- a/nettacker/core/app.py +++ b/nettacker/core/app.py @@ -207,7 +207,6 @@ def run(self): Returns: True when it ends """ - log.info("Process started!!") scan_id = common_utils.generate_random_token(32) log.info("ScanID: {0}".format(scan_id)) log.info(_("regrouping_targets")) @@ -216,14 +215,12 @@ def run(self): self.arguments.targets = self.expand_targets(scan_id) if not self.arguments.targets: log.info(_("no_live_service_found")) - log.info("Process done!!") return True exit_code = self.start_scan(scan_id) create_report(self.arguments, scan_id) if self.arguments.scan_compare_id is not None: create_compare_report(self.arguments, scan_id) log.info("ScanID: {0} ".format(scan_id) + _("done")) - log.info("Process done!!") return exit_code def start_scan(self, scan_id): From ed7c81e8705ddc24f91de38705f5860c2cd1bc12 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Fri, 24 Oct 2025 23:41:50 +0530 Subject: [PATCH 03/26] Update hostcheck.py , removed unnecessary logs Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index ca219a002..d99c3f7af 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -27,8 +27,6 @@ def valid_hostname(host: str, allow_single_label: bool = False) -> bool: host = host[:-1] parts = host.split(".") if len(parts) < 2 and not allow_single_label: - # log.warn("Its a name like google") - print("itegb") return False return all(_LABEL.match(p) for p in parts) From ccd870e3a82d14ff4fb16c1f9e53704d7a62dec6 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Fri, 24 Oct 2025 23:57:34 +0530 Subject: [PATCH 04/26] Updated hostcheck.py to use allow_single_label and return the lower-cased name Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index d99c3f7af..77503fda1 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -27,6 +27,8 @@ def valid_hostname(host: str, allow_single_label: bool = False) -> bool: host = host[:-1] parts = host.split(".") if len(parts) < 2 and not allow_single_label: + # log.warn("Its a name like google") + print("itegb") return False return all(_LABEL.match(p) for p in parts) @@ -56,10 +58,12 @@ def _gai_once(name: str, use_ai_addrconfig: bool, port): name, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, flags ) -def resolve_quick(host: str, - timeout_sec: float = 2.0, - try_search_suffixes: bool = True, - allow_single_label: bool = True) -> tuple[bool, str | None]: +def resolve_quick( + host: str, + timeout_sec: float = 2.0, + try_search_suffixes: bool = True, + allow_single_label: bool = True +) -> tuple[bool, str | None]: candidates: list[str] = [] if "." in host: @@ -70,6 +74,8 @@ def resolve_quick(host: str, candidates.extend([host, host + "."]) else: # single label (e.g., "intranet") + if not allow_single_label: + return False, None if try_search_suffixes: for s in _system_search_suffixes(): candidates.extend([f"{host}.{s}", f"{host}.{s}."]) @@ -100,18 +106,16 @@ def resolve_quick(host: str, ) for fut in done: try: - res = fut.result() # success if no exception - # Optional: assert non-empty result + res = fut.result() if not res: # treat as failure raise RuntimeError("empty getaddrinfo result") chosen = fut2cand[fut] # cancel stragglers for p in pending: p.cancel() - return True, (chosen[:-1] if chosen.endswith(".") else chosen) + canon = chosen[:-1] if chosen.endswith(".") else chosen + return True, canon.lower() except Exception as e: - # TEMPORARY DEBUG LOGS — remove later - # print(f"[pass {pass_ix}] {fut2cand[fut]} -> {type(e).__name__}: {e!s}") continue # cancel any survivors in this pass for f in fut2cand: f.cancel() From b5da801d64a305ff92ca2740b9416a33622b2578 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 00:01:01 +0530 Subject: [PATCH 05/26] Docstring added Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 77503fda1..e5b4b8d82 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -64,7 +64,18 @@ def resolve_quick( try_search_suffixes: bool = True, allow_single_label: bool = True ) -> tuple[bool, str | None]: - + """ + Perform fast DNS resolution with timeout and suffix search. + + Args: + host: Hostname or IP literal to resolve. + timeout_sec: Maximum time to wait for resolution. + try_search_suffixes: If True, append /etc/resolv.conf search suffixes for single-label hosts. + allow_single_label: If True, allow single-label hostnames (e.g., "intranet"). + + Returns: + (True, canonical_hostname) on success, (False, None) on failure/timeout. + """ candidates: list[str] = [] if "." in host: # try both plain and absolute forms; whichever resolves first wins From c1a92010ebfa071c8f594bafda8aee6303d8641a Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 00:05:13 +0530 Subject: [PATCH 06/26] app.py updated to remove noise in exception handling Signed-off-by: Aarush289 --- nettacker/core/app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nettacker/core/app.py b/nettacker/core/app.py index c323f8c33..0bdb0a9e7 100644 --- a/nettacker/core/app.py +++ b/nettacker/core/app.py @@ -207,6 +207,7 @@ def run(self): Returns: True when it ends """ + log.info("Process started!!") scan_id = common_utils.generate_random_token(32) log.info("ScanID: {0}".format(scan_id)) log.info(_("regrouping_targets")) @@ -215,12 +216,14 @@ def run(self): self.arguments.targets = self.expand_targets(scan_id) if not self.arguments.targets: log.info(_("no_live_service_found")) + log.info("Process done!!") return True exit_code = self.start_scan(scan_id) create_report(self.arguments, scan_id) if self.arguments.scan_compare_id is not None: create_compare_report(self.arguments, scan_id) log.info("ScanID: {0} ".format(scan_id) + _("done")) + log.info("Process done!!") return exit_code def start_scan(self, scan_id): @@ -319,9 +322,8 @@ def _task(idx, t): for fut in as_completed(futures): try: idx, orig_target, canon = fut.result() - except Exception as e: - # Treat as invalid on error; log with the best context we have - log.info(f"Invalid target (exception): {e!s}") + except (OSError, socket.gaierror) as exc: + log.debug(f"Invalid target (resolver error): {exc!s}") continue if canon: From b66a59852e71fbf2b9229583be40c28346ae895d Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 00:58:20 +0530 Subject: [PATCH 07/26] Multi-threading issue is resolved Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 48 +++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index e5b4b8d82..d5e1e411b 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -11,16 +11,31 @@ _LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? bool: + """Return True if name is a valid IPv4 or IPv6 address literal.""" try: - socket.inet_pton(socket.AF_INET, name); return True + socket.inet_pton(socket.AF_INET, name) + return True except OSError: pass try: - socket.inet_pton(socket.AF_INET6, name); return True + socket.inet_pton(socket.AF_INET6, name) + return True except OSError: return False -def valid_hostname(host: str, allow_single_label: bool = False) -> bool: +def valid_hostname( + host: str, + allow_single_label: bool = False +) -> bool: + """ + Validate hostname syntax per RFC 1123. + Args: + host: Hostname to validate. + allow_single_label: If True, accept single-label names (e.g., "localhost"). + + Returns: + True if the hostname is syntactically valid. + """ if len(host) > 253: return False if host.endswith("."): @@ -104,7 +119,9 @@ def resolve_quick( for pass_ix, (use_ai_addrconfig, port) in enumerate(((True, None), (False, None))): deadline = time.monotonic() + timeout_sec - with concurrent.futures.ThreadPoolExecutor(max_workers=len(candidates)) as ex: + maxw = min(len(candidates), 4) + ex = concurrent.futures.ThreadPoolExecutor(max_workers=maxw) + try: fut2cand = {ex.submit(_gai_once, c, use_ai_addrconfig, port): c for c in candidates} pending = set(fut2cand) while pending: @@ -119,15 +136,26 @@ def resolve_quick( try: res = fut.result() if not res: - # treat as failure - raise RuntimeError("empty getaddrinfo result") + continue chosen = fut2cand[fut] - # cancel stragglers - for p in pending: p.cancel() + for p in pending: + p.cancel() + # ensure we don't wait on the executor shutdown + try: + ex.shutdown(wait=False, cancel_futures=True) + except TypeError: # Py<3.9 + ex.shutdown(wait=False) canon = chosen[:-1] if chosen.endswith(".") else chosen return True, canon.lower() - except Exception as e: + except Exception: continue # cancel any survivors in this pass - for f in fut2cand: f.cancel() + for f in fut2cand: + f.cancel() + finally: + # best-effort non-blocking shutdown + try: + ex.shutdown(wait=False, cancel_futures=True) + except TypeError: + ex.shutdown(wait=False) return False, None From 949c91117e89d0b987d6b4b1ad8071ff9157dab5 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 01:41:09 +0530 Subject: [PATCH 08/26] chore: test signed commit (SSH) From 50374b9b23c42faf097eb48209d8ec064d71b023 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 01:44:04 +0530 Subject: [PATCH 09/26] chore: test signed commit (SSH) #2 From 2389890924c5591bfd3239fff70918b0c9d94c2c Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 01:49:17 +0530 Subject: [PATCH 10/26] chore: test signed commit (SSH) #3 From a83c17f21e17b6431c61c90a1a779871ece9480e Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 13:28:40 +0530 Subject: [PATCH 11/26] Removed unnecessary print statements Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index d5e1e411b..5a5a07c03 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -42,8 +42,6 @@ def valid_hostname( host = host[:-1] parts = host.split(".") if len(parts) < 2 and not allow_single_label: - # log.warn("Its a name like google") - print("itegb") return False return all(_LABEL.match(p) for p in parts) From d85260924a18a8558fdc6111a7726577e678a12b Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 13:38:21 +0530 Subject: [PATCH 12/26] Indentation done Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 5a5a07c03..4f72b340a 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -52,15 +52,18 @@ def _system_search_suffixes() -> list[str]: with open("/etc/resolv.conf") as f: for line in f: line = line.strip() - if not line or line.startswith("#"): continue + if not line or line.startswith("#"): + continue if line.startswith("search") or line.startswith("domain"): sufs += [x for x in line.split()[1:] if x] except Exception: pass - seen = set(); out: list[str] = [] + seen = set() + out: list[str] = [] for s in sufs: if s not in seen: - seen.add(s); out.append(s) + seen.add(s) + out.append(s) return out # --- safer, more robust pieces to replace in hostcheck.py --- @@ -115,7 +118,7 @@ def resolve_quick( if not candidates: return False, None - for pass_ix, (use_ai_addrconfig, port) in enumerate(((True, None), (False, None))): + for _pass_ix, (use_ai_addrconfig, port) in enumerate(((True, None), (False, None))): deadline = time.monotonic() + timeout_sec maxw = min(len(candidates), 4) ex = concurrent.futures.ThreadPoolExecutor(max_workers=maxw) @@ -137,7 +140,7 @@ def resolve_quick( continue chosen = fut2cand[fut] for p in pending: - p.cancel() + p.cancel() # ensure we don't wait on the executor shutdown try: ex.shutdown(wait=False, cancel_futures=True) @@ -145,7 +148,8 @@ def resolve_quick( ex.shutdown(wait=False) canon = chosen[:-1] if chosen.endswith(".") else chosen return True, canon.lower() - except Exception: + except (OSError, socket.gaierror): + # DNS resolution failed for this candidate, try next continue # cancel any survivors in this pass for f in fut2cand: From 4de4cca71f8dd19806fc63d4ca8476c470ba1cc1 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 13:45:52 +0530 Subject: [PATCH 13/26] trim dot before checking the length Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 4f72b340a..e793b418e 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -36,10 +36,10 @@ def valid_hostname( Returns: True if the hostname is syntactically valid. """ - if len(host) > 253: - return False if host.endswith("."): host = host[:-1] + if len(host) > 253: + return False parts = host.split(".") if len(parts) < 2 and not allow_single_label: return False From c472e71eac551bf14662201aa3bb11e31d27a062 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 17:02:43 +0530 Subject: [PATCH 14/26] Update hostcheck.py Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index e793b418e..dd4dde7d8 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -36,10 +36,10 @@ def valid_hostname( Returns: True if the hostname is syntactically valid. """ - if host.endswith("."): - host = host[:-1] if len(host) > 253: return False + if host.endswith("."): + host = host[:-1] parts = host.split(".") if len(parts) < 2 and not allow_single_label: return False @@ -113,7 +113,8 @@ def resolve_quick( seen, uniq = set(), [] for c in candidates: if c not in seen: - seen.add(c); uniq.append(c) + seen.add(c) + uniq.append(c) candidates = uniq if not candidates: return False, None From fb43addc49373a0fd39227cfd1b3c63f941f37c9 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Sat, 25 Oct 2025 17:09:05 +0530 Subject: [PATCH 15/26] Logging exceptions for better debugging Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index dd4dde7d8..7720015a1 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -6,7 +6,8 @@ import concurrent.futures import os import sys - +import logging +logger = logging.getLogger(__name__) _LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? 253: - return False if host.endswith("."): host = host[:-1] + if len(host) > 253: + return False parts = host.split(".") if len(parts) < 2 and not allow_single_label: return False @@ -56,7 +57,8 @@ def _system_search_suffixes() -> list[str]: continue if line.startswith("search") or line.startswith("domain"): sufs += [x for x in line.split()[1:] if x] - except Exception: + except Exception as e: + logger.debug(f"Could not read /etc/resolv.conf: {e}") pass seen = set() out: list[str] = [] From 8102395b1988315bff429ab4647748ce40e75a46 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 18:38:50 +0530 Subject: [PATCH 16/26] Hostcheck.py OS-independent; add validate_before_scan --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b5debb571..729f4d4e9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ results.* coverage.xml venv +Public_sign +Public_sign.pub +cks_proxy From cd4e5abab88413af05ec4e9c060944cad89abc38 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 19:03:19 +0530 Subject: [PATCH 17/26] Hostchecker is made OS independent and validate_before_scan is added as an option --- nettacker/config.py | 1 + nettacker/core/app.py | 7 ++----- nettacker/core/arg_parser.py | 9 +++++++++ nettacker/locale/ar.yaml | 1 + nettacker/locale/bn.yaml | 1 + nettacker/locale/de.yaml | 1 + nettacker/locale/el.yaml | 2 ++ nettacker/locale/en.yaml | 1 + nettacker/locale/es.yaml | 1 + nettacker/locale/fa.yaml | 1 + nettacker/locale/fr.yaml | 1 + nettacker/locale/hi.yaml | 1 + nettacker/locale/hy.yaml | 1 + nettacker/locale/id.yaml | 1 + nettacker/locale/it.yaml | 1 + nettacker/locale/iw.yaml | 1 + nettacker/locale/ja.yaml | 1 + nettacker/locale/ko.yaml | 1 + nettacker/locale/nl.yaml | 1 + nettacker/locale/ps.yaml | 1 + nettacker/locale/pt-br.yaml | 1 + nettacker/locale/ru.yaml | 1 + nettacker/locale/tr.yaml | 1 + nettacker/locale/ur.yaml | 1 + nettacker/locale/vi.yaml | 1 + nettacker/locale/zh-cn.yaml | 1 + 26 files changed, 36 insertions(+), 5 deletions(-) diff --git a/nettacker/config.py b/nettacker/config.py index f573ef515..68ea3dd39 100644 --- a/nettacker/config.py +++ b/nettacker/config.py @@ -162,6 +162,7 @@ class DefaultSettings(ConfigBase): show_all_profiles = False show_help_menu = False show_version = False + validate_before_scan = False skip_service_discovery = False socks_proxy = None targets = None diff --git a/nettacker/core/app.py b/nettacker/core/app.py index 0bdb0a9e7..2abfd4858 100644 --- a/nettacker/core/app.py +++ b/nettacker/core/app.py @@ -207,7 +207,6 @@ def run(self): Returns: True when it ends """ - log.info("Process started!!") scan_id = common_utils.generate_random_token(32) log.info("ScanID: {0}".format(scan_id)) log.info(_("regrouping_targets")) @@ -216,14 +215,12 @@ def run(self): self.arguments.targets = self.expand_targets(scan_id) if not self.arguments.targets: log.info(_("no_live_service_found")) - log.info("Process done!!") return True exit_code = self.start_scan(scan_id) create_report(self.arguments, scan_id) if self.arguments.scan_compare_id is not None: create_compare_report(self.arguments, scan_id) log.info("ScanID: {0} ".format(scan_id) + _("done")) - log.info("Process done!!") return exit_code def start_scan(self, scan_id): @@ -308,7 +305,7 @@ def filter_valid_targets(self, targets, timeout_per_target=2.0, max_workers=None return [] if max_workers is None: - max_workers = min(len(targets), 64) # cap threads + max_workers = min(len(targets), 10) # cap threads # Preserve order canon_by_index = [None] * len(targets) @@ -345,7 +342,7 @@ def _task(idx, t): def scan_target_group(self, targets, scan_id, process_number): - if(not self.arguments.socks_proxy): + if(not self.arguments.socks_proxy and self.arguments.validate_before_scan): targets = self.filter_valid_targets( targets, timeout_per_target=2.0, diff --git a/nettacker/core/arg_parser.py b/nettacker/core/arg_parser.py index e8aed1218..b02a6a0e8 100644 --- a/nettacker/core/arg_parser.py +++ b/nettacker/core/arg_parser.py @@ -355,6 +355,15 @@ def add_arguments(self): dest="skip_service_discovery", help=_("skip_service_discovery"), ) + method_options.add_argument( + "-C" , + "--validate-before-scan", + action="store_true", + default=Config.settings.validate_before_scan, + dest= "validate_before_scan", + help=_("validate_before_scan"), + + ) method_options.add_argument( "-t", "--thread-per-host", diff --git a/nettacker/locale/ar.yaml b/nettacker/locale/ar.yaml index f730cff67..23efab922 100644 --- a/nettacker/locale/ar.yaml +++ b/nettacker/locale/ar.yaml @@ -22,6 +22,7 @@ username_from_file: قراءة اسم المستخدم (ق) من الملف password_separator: كلمة (كلمات) المرور ، منفصلة مع "،" read_passwords: قراءة كلمة (كلمات) من الملف port_separator: قائمة port (s) ، منفصلة مع "،" +validate_before_scan: تحقق مسبقًا من الأهداف/الاتصال قبل الفحص؛ سيتم تخطي الأهداف غير القابلة للوصول time_to_sleep: وقت للنوم بين كل طلب error_target: لا يمكن تحديد الهدف (الأهداف) error_target_file: "لا يمكن تحديد الهدف (الأهداف) ، غير قادر على فتح الملف: {0}" diff --git a/nettacker/locale/bn.yaml b/nettacker/locale/bn.yaml index 063b17f35..90848ed5e 100644 --- a/nettacker/locale/bn.yaml +++ b/nettacker/locale/bn.yaml @@ -21,6 +21,7 @@ connection_retries: সংযোগ সময়সীমা (ডিফল্ট current_version: আপনি কোড নাম {3}{4}{5} সহ OWASP Nettacker সংস্করণ {0}{1}{2}{6} চালাচ্ছেন database_connect_fail: ডাটাবেস সংযোগ করতে পারে না! database_connection_failed: সংযোগ নির্বাচিত ডাটাবেস থেকে ব্যর্থ হয়েছে +validate_before_scan: স্ক্যানের আগে টার্গেট/কানেক্টিভিটি প্রি-ভ্যালিডেট করুন; যেগুলো পৌঁছানো যায় না সেগুলো বাদ দেওয়া হবে define_white_list: "হোয়াইট লিস্ট হোস্টকে সংজ্ঞায়িত করুন, এটি আলাদা করুন, (উদাহরণ: 127.0.0.1, 1 9 2.168.0.1/24, 10.0.0.1-10.0.0.255 )" engine: ইঞ্জিন filtered_content: ... [রিপোর্টে পূর্ণ সামগ্রী দেখুন] diff --git a/nettacker/locale/de.yaml b/nettacker/locale/de.yaml index 38adc45a4..a4ca757e3 100644 --- a/nettacker/locale/de.yaml +++ b/nettacker/locale/de.yaml @@ -15,6 +15,7 @@ target_input: Zieleingabeoptionen target_list: Ziel (e) Liste, getrennt mit "," read_target: Lese Ziel (e) aus Datei scan_method_options: Scan-Methodenoptionen +validate_before_scan: "Ziele/Konnektivität vor dem Scan vorvalidieren; nicht erreichbare Ziele werden übersprungen." choose_scan_method: Suchmethode {0} auswählen exclude_scan_method: Suchmethode auswählen, um {0} auszuschließen username_list: Benutzername (s) Liste, getrennt mit "," diff --git a/nettacker/locale/el.yaml b/nettacker/locale/el.yaml index 773e5c457..842dfdf1e 100644 --- a/nettacker/locale/el.yaml +++ b/nettacker/locale/el.yaml @@ -18,11 +18,13 @@ target_input: Επιλογές εισαγωγής στόχων target_list: λίστα στόχων, χωριστά με "," read_target: να διαβάσετε τους στόχους από το αρχείο scan_method_options: Επιλογές μεθόδου σάρωσης +validate_before_scan: Προέλεγχος στόχων/συνδεσιμότητας πριν από τη σάρωση· οι μη προσβάσιμοι στόχοι παραλείπονται choose_scan_method: επιλέξτε τη μέθοδο σάρωσης {0} exclude_scan_method: επιλέξτε μέθοδο σάρωσης για να εξαιρέσετε {0} username_list: όνομα χρήστη (ες), χωριστά με "," username_from_file: να διαβάσετε το όνομα χρήστη από το αρχείο password_separator: λίστα κωδικών πρόσβασης, ξεχωριστά με "," +validate_before_scan: Προέλεγχος στόχων/συνδεσιμότητας πριν από τη σάρωση· οι μη προσβάσιμοι στόχοι παραλείπονται read_passwords: διαβάζουν τον κωδικό πρόσβασης από το αρχείο port_separator: λίστα λιμένων, χωριστά με "," time_to_sleep: χρόνος για ύπνο μεταξύ κάθε αιτήματος diff --git a/nettacker/locale/en.yaml b/nettacker/locale/en.yaml index e6e29e444..4c81f0f8e 100644 --- a/nettacker/locale/en.yaml +++ b/nettacker/locale/en.yaml @@ -11,6 +11,7 @@ API_options: API options API_port: API port number Method: Method skip_service_discovery: skip service discovery before scan and enforce all modules to scan anyway +validate_before_scan: Pre-validate targets/connectivity before scanning; unreachable targets are skipped. no_live_service_found: no any live service found to scan. icmp_need_root_access: to use icmp_scan module or --ping-before-scan you need to run the script as root! available_graph: "build a graph of all activities and information, you must use HTML output. available graphs: {0}" diff --git a/nettacker/locale/es.yaml b/nettacker/locale/es.yaml index 957e70489..d39d7ac16 100644 --- a/nettacker/locale/es.yaml +++ b/nettacker/locale/es.yaml @@ -19,6 +19,7 @@ scan_method_options: Opciones de método de escaneo choose_scan_method: elija el método de escaneo {0} exclude_scan_method: elija el método de escaneo para excluir {0} username_list: nombre de usuario (s) list, separe con "," +validate_before_scan: Prevalidar objetivos/conectividad antes de escanear; los objetivos inaccesibles se omiten username_from_file: leer nombre (s) de usuario del archivo password_separator: lista de contraseña (s), separe con "," read_passwords: leer contraseña (s) del archivo diff --git a/nettacker/locale/fa.yaml b/nettacker/locale/fa.yaml index 8f990d7e8..6c053d79b 100644 --- a/nettacker/locale/fa.yaml +++ b/nettacker/locale/fa.yaml @@ -20,6 +20,7 @@ target_list: لیست هدف (ها)، با "," جدا کنید read_target: خواندن هدف (ها) از فایل scan_method_options: گزینه های متود های اسکن choose_scan_method: متود اسکن را انتخاب کنید {0} +validate_before_scan: قبل از اسکن، هدف‌ها/اتصال بررسی اولیه شوند؛ هدف‌های غیرقابل دسترس نادیده گرفته می‌شوند exclude_scan_method: انتخاب متود اسکن استثنا {0} username_list: لیست نام کاربری (ها)، با "," جدا شود username_from_file: خواندن نام کاربری (ها) از لیست diff --git a/nettacker/locale/fr.yaml b/nettacker/locale/fr.yaml index 2e35f1e26..22e60c3a1 100644 --- a/nettacker/locale/fr.yaml +++ b/nettacker/locale/fr.yaml @@ -22,6 +22,7 @@ choose_scan_method: choisissez la méthode de scan {0} exclude_scan_method: choisissez la méthode de scan pour exclure {0} username_list: nom d'utilisateur (s), séparé par "," username_from_file: lire le (s) nom (s) d'utilisateur à partir du fichier +validate_before_scan: Pré-valider les cibles/la connectivité avant l’analyse ; les cibles injoignables sont ignorées password_separator: mot de passe (s), séparé par "," read_passwords: lire le (s) mot de passe (s) du fichier port_separator: port (s) list, séparé par "," diff --git a/nettacker/locale/hi.yaml b/nettacker/locale/hi.yaml index 30fd16fe7..4fa798e8a 100644 --- a/nettacker/locale/hi.yaml +++ b/nettacker/locale/hi.yaml @@ -22,6 +22,7 @@ password_separator: पासवर्ड (ओं) सूची, "," से अ read_passwords: फ़ाइल से पासवर्ड पढ़ें port_separator: पोर्ट (ओं) सूची, "," से अलग time_to_sleep: प्रत्येक अनुरोध के बीच रुकने के लिए समय +validate_before_scan: स्कैन से पहले टार्गेट/कनेक्टिविटी का प्री-वैलिडेशन करें; जो टार्गेट पहुँच में नहीं हैं उन्हें छोड़ दिया जाएगा error_target: लक्ष्य निर्दिष्ट नहीं कर सकते error_target_file: "फ़ाइल को खोलने में असमर्थ, लक्ष्य (लक्ष्य) निर्दिष्ट नहीं कर सकते: diff --git a/nettacker/locale/hy.yaml b/nettacker/locale/hy.yaml index 78cee4290..fe84f9768 100644 --- a/nettacker/locale/hy.yaml +++ b/nettacker/locale/hy.yaml @@ -23,6 +23,7 @@ username_from_file: կարդացեք օգտվողի անունը (ներ) ը ֆ password_separator: գաղտնաբառերի ցուցակը, որը առանձին է «,» read_passwords: կարդալ գաղտնաբառ (ներ) ը ֆայլից port_separator: պորտ (ներ) ցուցակը, որը առանձին է «,» +validate_before_scan: Սքանավորումից առաջ նախաստուգել թիրախները/կապը; անհասանելի թիրախները կբաց թողնվեն։ time_to_sleep: յուրաքանչյուր խնդրի միջեւ քնելու ժամանակ error_target: Հնարավոր չէ նշել թիրախ (ներ) error_target_file: Հնարավոր չէ նշել թիրախ (ներ) ը, չի կարող բացել ֆայլը, {0} diff --git a/nettacker/locale/id.yaml b/nettacker/locale/id.yaml index 59c924983..406401ede 100644 --- a/nettacker/locale/id.yaml +++ b/nettacker/locale/id.yaml @@ -24,6 +24,7 @@ password_separator: daftar kata sandi, terpisah dengan "," read_passwords: baca kata sandi (s) dari file port_separator: daftar port (s), terpisah dengan "," time_to_sleep: waktu untuk tidur di antara setiap permintaan +validate_before_scan: Pra-validasi target/konektivitas sebelum pemindaian; target yang tidak dapat dijangkau akan dilewati error_target: Tidak dapat menentukan target (s) error_target_file: "Tidak dapat menentukan target (s), tidak dapat membuka file: {0}" thread_number_warning: diff --git a/nettacker/locale/it.yaml b/nettacker/locale/it.yaml index 572429e6e..5587b9139 100644 --- a/nettacker/locale/it.yaml +++ b/nettacker/locale/it.yaml @@ -23,6 +23,7 @@ username_from_file: "leggi username (s) dal file" password_separator: lista password (s), separare con "," read_passwords: "leggere password (s) dal file" port_separator: elenco port (s), separare con "," +validate_before_scan: "Pre-convalidare target/connettività prima della scansione; i target non raggiungibili vengono ignorati" time_to_sleep: "tempo di dormire tra ogni richiesta" error_target: "Non è possibile specificare il / i target / i" error_target_file: "Impossibile specificare il / i target / i, impossibile aprire il file: {0}" diff --git a/nettacker/locale/iw.yaml b/nettacker/locale/iw.yaml index b1c22380c..0e47f41fb 100644 --- a/nettacker/locale/iw.yaml +++ b/nettacker/locale/iw.yaml @@ -27,6 +27,7 @@ time_to_sleep: זמן לישון בין כל בקשה error_target: לא ניתן להגדיר את המיקודים error_target_file: "לא ניתן לציין את היעדים, לא ניתן לפתוח את הקובץ: {0}" thread_number_warning: עדיף להשתמש במספר פתיל נמוך מ -100, BTW אנחנו ממשיכים ... +validate_before_scan: אמת מראש יעדים/קישוריות לפני הסריקה; יעדים שאינם נגישים ידולגו. settimeout: להגדיר פסק זמן ל {0} שניות, זה גדול מדי, לא? בדרך שאנחנו ממשיכים ... scan_module_not_found: מודול הסריקה [{0}] לא נמצא! error_exclude_all: לא ניתן לבצע אי הכללה של כל שיטות הסריקה diff --git a/nettacker/locale/ja.yaml b/nettacker/locale/ja.yaml index 37a451c54..247f43100 100644 --- a/nettacker/locale/ja.yaml +++ b/nettacker/locale/ja.yaml @@ -25,6 +25,7 @@ read_passwords: ファイルからパスワードを読み込む port_separator: ポートリスト、 "、" time_to_sleep: 各リクエストの間にスリープする時間 error_target: ターゲットを指定できません +validate_before_scan: スキャン前にターゲット/接続性を事前検証します。到達不能なターゲットはスキップされます。 error_target_file: ファイルを開くことができないターゲットを指定することはできません:{0} thread_number_warning: 100より低いスレッド番号を使用する方が良いです、私たちは継続しています... settimeout: タイムアウトを{0}秒に設定すると大きすぎますね。私たちが続けているところで... diff --git a/nettacker/locale/ko.yaml b/nettacker/locale/ko.yaml index 7fdad55e6..c2c12fb1d 100644 --- a/nettacker/locale/ko.yaml +++ b/nettacker/locale/ko.yaml @@ -26,6 +26,7 @@ port_separator: 포트 목록, "," time_to_sleep: 각 요청 사이에 잠자기 시간 error_target: 타겟을 지정할 수 없습니다. error_target_file: "파일을 열 수없는 대상을 지정할 수 없습니다 : {0}" +validate_before_scan: 스캔 전에 대상/연결성을 사전 검증합니다. 도달 불가능한 대상은 건너뜁니다. thread_number_warning: 100보다 낮은 스레드 번호를 사용하는 것이 좋습니다. 계속 진행 중입니다 ... settimeout: 시간 초과를 {0} 초로 설정하면 너무 큽니다. 그렇지 않습니까? 그런데 우리가 계속 ... scan_module_not_found: 이 스캔 모듈 [{0}]을 찾을 수 없습니다! diff --git a/nettacker/locale/nl.yaml b/nettacker/locale/nl.yaml index fec1de89c..f170f29ee 100644 --- a/nettacker/locale/nl.yaml +++ b/nettacker/locale/nl.yaml @@ -25,6 +25,7 @@ read_passwords: lees wachtwoord (s) uit bestand port_separator: poort (en) lijst, gescheiden door "," time_to_sleep: tijd om te slapen tussen elk verzoek error_target: Kan het doel (de doelen) niet specificeren +validate_before_scan: Targets/verbinding vooraf valideren vóór de scan; onbereikbare targets worden overgeslagen error_target_file: "Kan doel (en) niet specificeren, kan bestand niet openen: {0}" thread_number_warning: het is beter om een ​​draadnummer lager dan 100 te gebruiken, diff --git a/nettacker/locale/ps.yaml b/nettacker/locale/ps.yaml index 3c49ce66c..093ab0254 100644 --- a/nettacker/locale/ps.yaml +++ b/nettacker/locale/ps.yaml @@ -22,6 +22,7 @@ username_list: د کارن نوموونکي لیست، د "،" سره جلا username_from_file: د دوتنې څخه کارن نوم password_separator: د پټنوم (لسټ) لیست، د "،" سره جلا کړئ read_passwords: د دوتنې څخه پټنوم (پوسټ) ولولئ +validate_before_scan: له سکان مخکې هدفونه/نښلول مخکې له مخکې تایید کړئ؛ ناہرسايل هدفونه پرېښودل کېږي port_separator: د بندرونو لیست، د "،" سره جلا کول time_to_sleep: د هرې غوښتنې په منځ کې د خوب کولو وخت error_target: هدف یا هدف مشخص کولی نشی diff --git a/nettacker/locale/pt-br.yaml b/nettacker/locale/pt-br.yaml index 431f6a0bc..2c5233058 100644 --- a/nettacker/locale/pt-br.yaml +++ b/nettacker/locale/pt-br.yaml @@ -28,6 +28,7 @@ username_from_file: ler nome(s) de usuário(s) do arquivo password_separator: 'lista de senha(s), separe com ","' read_passwords: ler senhas(s) do arquivo port_separator: 'lsita de porta(s), separe com ","' +validate_before_scan: Pré-validar alvos/conectividade antes da varredura; alvos inacessíveis serão ignorados time_to_sleep: tempo para esperar entre cada solicitação error_target: Não foi possível especificar o(s) alvo(s) error_target_file: 'Não foi possível especificar o(s) alvo(s), impossível abrir o arquivo: {0}' diff --git a/nettacker/locale/ru.yaml b/nettacker/locale/ru.yaml index ba295b4d4..909dc187a 100644 --- a/nettacker/locale/ru.yaml +++ b/nettacker/locale/ru.yaml @@ -32,6 +32,7 @@ settimeout: установлен таймаут до {0} секунд, он слишком велик, но мы продолжаем... scan_module_not_found: этот модуль сканирования [{0}] не найден! error_exclude_all: вы не можете исключить все методы сканирования +validate_before_scan: Предварительно проверять цели/подключение перед сканированием; недоступные цели пропускаются exclude_module_error: модуль {0}, который вы выбрали для исключения, не найден! method_inputs: "введите параметры методов, например: ftp_brute_users = test, admin & ftp_brute_passwds diff --git a/nettacker/locale/tr.yaml b/nettacker/locale/tr.yaml index 670120ac6..d213fce0e 100644 --- a/nettacker/locale/tr.yaml +++ b/nettacker/locale/tr.yaml @@ -24,6 +24,7 @@ password_separator: şifre listesi "," ile ayrı read_passwords: dosyadan şifre (ler) oku port_separator: port (lar) listesi, "," ile ayrı time_to_sleep: her istek arasında uyumak için zaman +validate_before_scan: Taramadan önce hedefleri/bağlanılabilirliği önceden doğrula; erişilemeyen hedefler atlanır error_target: Hedef (ler) belirtilemiyor error_target_file: "Dosya açılamayan hedef (ler) belirtilemiyor: {0}" thread_number_warning: diff --git a/nettacker/locale/ur.yaml b/nettacker/locale/ur.yaml index 1201e7313..315176448 100644 --- a/nettacker/locale/ur.yaml +++ b/nettacker/locale/ur.yaml @@ -28,6 +28,7 @@ port_separator: بندرگاہ کی فہرست، کے ساتھ علیحدہ "،" time_to_sleep: ہر درخواست کے درمیان سونے کا وقت error_target: ہدف مقرر نہیں کر سکتے ہیں error_target_file: "ہدف (ن) کی وضاحت نہیں کرسکتا، فائل کو کھولنے میں ناکام ہے: {0}" +validate_before_scan: اسکین سے پہلے ٹارگٹس/کنیکٹیوٹی کی ابتدائی توثیق کریں؛ ناقابلِ رسائی ٹارگٹس چھوڑ دیے جائیں گے۔ thread_number_warning: اس موضوع کو 100 سے زائد کم دھاگے کا استعمال کرنا بہتر ہے، بی ٹی ڈبلیو ہم جاری رہے گی ... diff --git a/nettacker/locale/vi.yaml b/nettacker/locale/vi.yaml index 2494612dc..dceb4c28d 100644 --- a/nettacker/locale/vi.yaml +++ b/nettacker/locale/vi.yaml @@ -22,6 +22,7 @@ username_list: (các) tên người dùng, riêng biệt với "," username_from_file: đọc (các) tên người dùng từ tệp password_separator: (các) mật khẩu, riêng biệt với "," read_passwords: đọc (các) mật khẩu từ tệp +validate_before_scan: Tiền kiểm tra mục tiêu/kết nối trước khi quét; các mục tiêu không truy cập được sẽ bị bỏ qua port_separator: danh sách cổng, tách biệt với "," time_to_sleep: thời gian để ngủ giữa mỗi yêu cầu error_target: Không thể chỉ định (các) mục tiêu diff --git a/nettacker/locale/zh-cn.yaml b/nettacker/locale/zh-cn.yaml index f15b65142..7b795c44e 100644 --- a/nettacker/locale/zh-cn.yaml +++ b/nettacker/locale/zh-cn.yaml @@ -23,6 +23,7 @@ username_from_file: 从文件中读取用户名 password_separator: 密码列表,用“,”分开 read_passwords: 从文件中读取密码 port_separator: 端口列表,用“,”分开 +validate_before_scan: 在扫描前预先验证目标/连通性;无法访问的目标将被跳过。 time_to_sleep: 每次请求的间隔时间 error_target: 无法指定目标(s) error_target_file: 无法指定目标,无法打开文件:{0} From c92c7f35f7c70f4a755fe4a53b8de4ade1d6c529 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 19:14:47 +0530 Subject: [PATCH 18/26] Update hostcheck.py to make it OS independent Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 154 ++++++++++++++---------------------- 1 file changed, 59 insertions(+), 95 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 7720015a1..e30167752 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -6,8 +6,18 @@ import concurrent.futures import os import sys -import logging -logger = logging.getLogger(__name__) +from nettacker import logger +log = logger.get_logger() +from nettacker.core.ip import ( + get_ip_range, + generate_ip_range, + is_single_ipv4, + is_ipv4_range, + is_ipv4_cidr, + is_single_ipv6, + is_ipv6_range, + is_ipv6_cidr, +) _LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? bool: def valid_hostname( host: str, - allow_single_label: bool = False + allow_single_label: bool = True ) -> bool: """ Validate hostname syntax per RFC 1123. @@ -46,29 +56,6 @@ def valid_hostname( return False return all(_LABEL.match(p) for p in parts) -def _system_search_suffixes() -> list[str]: - # Only used when host has no dots; mirrors OS resolver search behavior (UNIX). - sufs: list[str] = [] - try: - with open("/etc/resolv.conf") as f: - for line in f: - line = line.strip() - if not line or line.startswith("#"): - continue - if line.startswith("search") or line.startswith("domain"): - sufs += [x for x in line.split()[1:] if x] - except Exception as e: - logger.debug(f"Could not read /etc/resolv.conf: {e}") - pass - seen = set() - out: list[str] = [] - for s in sufs: - if s not in seen: - seen.add(s) - out.append(s) - return out - -# --- safer, more robust pieces to replace in hostcheck.py --- def _gai_once(name: str, use_ai_addrconfig: bool, port): flags = getattr(socket, "AI_ADDRCONFIG", 0) if use_ai_addrconfig else 0 @@ -76,6 +63,16 @@ def _gai_once(name: str, use_ai_addrconfig: bool, port): name, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, flags ) +def _clean_host(s: str) -> str: + # remove surrounding quotes and whitespace, lone commas, repeated dots + s = s.strip().strip('"').strip("'") + s = s.strip() # again, after quote strip + # drop trailing commas that often sneak in from CSV-like inputs + if s.endswith(","): + s = s[:-1].rstrip() + # collapse accidental spaces inside + return s + def resolve_quick( host: str, timeout_sec: float = 2.0, @@ -88,79 +85,46 @@ def resolve_quick( Args: host: Hostname or IP literal to resolve. timeout_sec: Maximum time to wait for resolution. - try_search_suffixes: If True, append /etc/resolv.conf search suffixes for single-label hosts. allow_single_label: If True, allow single-label hostnames (e.g., "intranet"). Returns: - (True, canonical_hostname) on success, (False, None) on failure/timeout. - """ - candidates: list[str] = [] - if "." in host: - # try both plain and absolute forms; whichever resolves first wins - if host.endswith("."): - candidates.extend([host, host[:-1]]) - else: - candidates.extend([host, host + "."]) - else: - # single label (e.g., "intranet") - if not allow_single_label: - return False, None - if try_search_suffixes: - for s in _system_search_suffixes(): - candidates.extend([f"{host}.{s}", f"{host}.{s}."]) - if not host.endswith("."): - candidates.append(host + ".") # bare absolute - candidates.append(host) + (True, host_name) on success, (False, None) on failure/timeout. + """ + host = _clean_host(host) + if(is_single_ipv4(host) or is_single_ipv6(host)): + if(is_ip_literal(host)): + return True , host + return False ,None + + if host.endswith("."): + host = host[:-1] + + if(not valid_hostname(host)): + return False , None + + if "." not in host and not allow_single_label: + return False ,None + + deadline = time.monotonic() + timeout_sec - seen, uniq = set(), [] - for c in candidates: - if c not in seen: - seen.add(c) - uniq.append(c) - candidates = uniq - if not candidates: - return False, None + def _call(use_ai_addrconfig: bool): + return _gai_once(host, use_ai_addrconfig, None) - for _pass_ix, (use_ai_addrconfig, port) in enumerate(((True, None), (False, None))): - deadline = time.monotonic() + timeout_sec - maxw = min(len(candidates), 4) - ex = concurrent.futures.ThreadPoolExecutor(max_workers=maxw) + for use_ai in (True, False): + remaining = deadline - time.monotonic() + if remaining <= 0: + return False, None try: - fut2cand = {ex.submit(_gai_once, c, use_ai_addrconfig, port): c for c in candidates} - pending = set(fut2cand) - while pending: - remaining = deadline - time.monotonic() - if remaining <= 0: - break - done, pending = concurrent.futures.wait( - pending, timeout=remaining, - return_when=concurrent.futures.FIRST_COMPLETED - ) - for fut in done: - try: - res = fut.result() - if not res: - continue - chosen = fut2cand[fut] - for p in pending: - p.cancel() - # ensure we don't wait on the executor shutdown - try: - ex.shutdown(wait=False, cancel_futures=True) - except TypeError: # Py<3.9 - ex.shutdown(wait=False) - canon = chosen[:-1] if chosen.endswith(".") else chosen - return True, canon.lower() - except (OSError, socket.gaierror): - # DNS resolution failed for this candidate, try next - continue - # cancel any survivors in this pass - for f in fut2cand: - f.cancel() - finally: - # best-effort non-blocking shutdown - try: - ex.shutdown(wait=False, cancel_futures=True) - except TypeError: - ex.shutdown(wait=False) + # Run getaddrinfo in a thread so we can enforce timeout + with concurrent.futures.ThreadPoolExecutor(max_workers=1) as ex: + fut = ex.submit(_call, use_ai) + fut.result(timeout=remaining) # raises on timeout or error + return True, host.lower() + except concurrent.futures.TimeoutError: + return False, None + except (OSError, socket.gaierror): + # DNS resolution failed for this candidate, try next + continue return False, None + + From 8752881700f1ed501df505508b97c77d89050029 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 19:32:13 +0530 Subject: [PATCH 19/26] Indentation done Signed-off-by: Aarush289 --- nettacker/core/arg_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nettacker/core/arg_parser.py b/nettacker/core/arg_parser.py index b02a6a0e8..aaeac79ef 100644 --- a/nettacker/core/arg_parser.py +++ b/nettacker/core/arg_parser.py @@ -356,11 +356,11 @@ def add_arguments(self): help=_("skip_service_discovery"), ) method_options.add_argument( - "-C" , + "-C", "--validate-before-scan", action="store_true", default=Config.settings.validate_before_scan, - dest= "validate_before_scan", + dest="validate_before_scan", help=_("validate_before_scan"), ) From bd762cd56c5ff0f06c51ebb71f08fc374ca7cf13 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 19:33:08 +0530 Subject: [PATCH 20/26] removed the duplicate key Signed-off-by: Aarush289 --- nettacker/locale/el.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/nettacker/locale/el.yaml b/nettacker/locale/el.yaml index 842dfdf1e..70159b4e0 100644 --- a/nettacker/locale/el.yaml +++ b/nettacker/locale/el.yaml @@ -24,7 +24,6 @@ exclude_scan_method: επιλέξτε μέθοδο σάρωσης για να ε username_list: όνομα χρήστη (ες), χωριστά με "," username_from_file: να διαβάσετε το όνομα χρήστη από το αρχείο password_separator: λίστα κωδικών πρόσβασης, ξεχωριστά με "," -validate_before_scan: Προέλεγχος στόχων/συνδεσιμότητας πριν από τη σάρωση· οι μη προσβάσιμοι στόχοι παραλείπονται read_passwords: διαβάζουν τον κωδικό πρόσβασης από το αρχείο port_separator: λίστα λιμένων, χωριστά με "," time_to_sleep: χρόνος για ύπνο μεταξύ κάθε αιτήματος From c23507ef7bb24edc2d1dee0360f4ff6a8a804479 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 19:38:35 +0530 Subject: [PATCH 21/26] unused parameter removed Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index e30167752..3dd0ef359 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -76,7 +76,6 @@ def _clean_host(s: str) -> str: def resolve_quick( host: str, timeout_sec: float = 2.0, - try_search_suffixes: bool = True, allow_single_label: bool = True ) -> tuple[bool, str | None]: """ @@ -91,19 +90,19 @@ def resolve_quick( (True, host_name) on success, (False, None) on failure/timeout. """ host = _clean_host(host) - if(is_single_ipv4(host) or is_single_ipv6(host)): + if is_single_ipv4(host) or is_single_ipv6(host): if(is_ip_literal(host)): - return True , host - return False ,None + return True, host + return False, None if host.endswith("."): host = host[:-1] - if(not valid_hostname(host)): - return False , None + if not valid_hostname(host): + return False, None if "." not in host and not allow_single_label: - return False ,None + return False, None deadline = time.monotonic() + timeout_sec From 7de608e5443273dc427536d0ab13232e1fafca99 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 20:39:27 +0530 Subject: [PATCH 22/26] "Fix import order (ruff E402), isort formatting; run pre-commit" Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 3dd0ef359..ee6bf53ea 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -7,7 +7,6 @@ import os import sys from nettacker import logger -log = logger.get_logger() from nettacker.core.ip import ( get_ip_range, generate_ip_range, @@ -18,6 +17,7 @@ is_ipv6_range, is_ipv6_cidr, ) +log = logger.get_logger() _LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? Date: Mon, 27 Oct 2025 20:55:51 +0530 Subject: [PATCH 23/26] Per-pass timeout added Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index ee6bf53ea..d2d0f925f 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -79,8 +79,7 @@ def resolve_quick( allow_single_label: bool = True ) -> tuple[bool, str | None]: """ - Perform fast DNS resolution with timeout and suffix search. - + Perform fast DNS resolution with timeout. Args: host: Hostname or IP literal to resolve. timeout_sec: Maximum time to wait for resolution. @@ -91,7 +90,7 @@ def resolve_quick( """ host = _clean_host(host) if is_single_ipv4(host) or is_single_ipv6(host): - if(is_ip_literal(host)): + if is_ip_literal(host): return True, host return False, None @@ -103,21 +102,17 @@ def resolve_quick( if "." not in host and not allow_single_label: return False, None - - deadline = time.monotonic() + timeout_sec def _call(use_ai_addrconfig: bool): return _gai_once(host, use_ai_addrconfig, None) for use_ai in (True, False): - remaining = deadline - time.monotonic() - if remaining <= 0: - return False, None + deadline = time.monotonic() + timeout_sec try: # Run getaddrinfo in a thread so we can enforce timeout with concurrent.futures.ThreadPoolExecutor(max_workers=1) as ex: fut = ex.submit(_call, use_ai) - fut.result(timeout=remaining) # raises on timeout or error + fut.result(timeout=timeout_sec) # raises on timeout or error return True, host.lower() except concurrent.futures.TimeoutError: return False, None From 0ac3a96558aca9dcf31a5b0f47534a2b3a281635 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 21:09:07 +0530 Subject: [PATCH 24/26] Deadline removed Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index d2d0f925f..751849b4d 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -107,7 +107,6 @@ def _call(use_ai_addrconfig: bool): return _gai_once(host, use_ai_addrconfig, None) for use_ai in (True, False): - deadline = time.monotonic() + timeout_sec try: # Run getaddrinfo in a thread so we can enforce timeout with concurrent.futures.ThreadPoolExecutor(max_workers=1) as ex: @@ -115,7 +114,7 @@ def _call(use_ai_addrconfig: bool): fut.result(timeout=timeout_sec) # raises on timeout or error return True, host.lower() except concurrent.futures.TimeoutError: - return False, None + continue except (OSError, socket.gaierror): # DNS resolution failed for this candidate, try next continue From 8565db691ea3c679f92192f3ae78d03151d6e834 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Mon, 27 Oct 2025 21:20:33 +0530 Subject: [PATCH 25/26] Indentation done Signed-off-by: Aarush289 --- nettacker/core/hostcheck.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 751849b4d..11f6f00a4 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -4,8 +4,6 @@ import socket import time import concurrent.futures -import os -import sys from nettacker import logger from nettacker.core.ip import ( get_ip_range, @@ -87,7 +85,7 @@ def resolve_quick( Returns: (True, host_name) on success, (False, None) on failure/timeout. - """ + """ host = _clean_host(host) if is_single_ipv4(host) or is_single_ipv6(host): if is_ip_literal(host): From ec9726692f4d77179252b5c39a2b7d2bcb3304d9 Mon Sep 17 00:00:00 2001 From: Aarush289 Date: Thu, 30 Oct 2025 01:04:11 +0530 Subject: [PATCH 26/26] Suggested changes are done --- nettacker/core/app.py | 26 ++++++++++++------------ nettacker/core/hostcheck.py | 40 ++++++++++++++++++++++--------------- nettacker/locale/ar.yaml | 1 - nettacker/locale/bn.yaml | 1 - nettacker/locale/de.yaml | 1 - nettacker/locale/el.yaml | 1 - nettacker/locale/es.yaml | 1 - nettacker/locale/fa.yaml | 1 - nettacker/locale/fr.yaml | 1 - nettacker/locale/hi.yaml | 1 - nettacker/locale/hy.yaml | 1 - nettacker/locale/id.yaml | 1 - nettacker/locale/it.yaml | 1 - nettacker/locale/iw.yaml | 1 - nettacker/locale/ja.yaml | 1 - nettacker/locale/ko.yaml | 1 - nettacker/locale/nl.yaml | 1 - nettacker/locale/ps.yaml | 1 - nettacker/locale/pt-br.yaml | 1 - nettacker/locale/ru.yaml | 1 - nettacker/locale/tr.yaml | 1 - nettacker/locale/ur.yaml | 1 - nettacker/locale/vi.yaml | 1 - nettacker/locale/zh-cn.yaml | 1 - 24 files changed, 37 insertions(+), 51 deletions(-) diff --git a/nettacker/core/app.py b/nettacker/core/app.py index 2abfd4858..0b0a9d0a9 100644 --- a/nettacker/core/app.py +++ b/nettacker/core/app.py @@ -290,7 +290,7 @@ def scan_target( return os.EX_OK - def filter_valid_targets(self, targets, timeout_per_target=2.0, max_workers=None, dedupe=True): + def filter_valid_targets(self, targets, timeout_per_target=2.0, max_threads=None, dedupe=True): """ Parallel validation of targets via resolve_quick(target, timeout_sec). Returns a list of canonical targets (order preserved, invalids removed). @@ -304,39 +304,39 @@ def filter_valid_targets(self, targets, timeout_per_target=2.0, max_workers=None if not targets: return [] - if max_workers is None: - max_workers = min(len(targets), 10) # cap threads + if max_threads is None: + max_threads = min(len(targets), 10) # cap threads # Preserve order - canon_by_index = [None] * len(targets) + validated_target = [None] * len(targets) # Invalid targets will be replaced by "None" def _task(idx, t): ok, canon = resolve_quick(t, timeout_sec=timeout_per_target) return idx, t, (canon if ok and canon else None) - with ThreadPoolExecutor(max_workers=max_workers) as ex: + with ThreadPoolExecutor(max_workers=max_threads) as ex: futures = [ex.submit(_task, i, t) for i, t in enumerate(targets)] for fut in as_completed(futures): try: idx, orig_target, canon = fut.result() except (OSError, socket.gaierror) as exc: - log.debug(f"Invalid target (resolver error): {exc!s}") + log.error(f"Invalid target (resolver error): {exc!s}") continue if canon: - canon_by_index[idx] = canon + validated_target[idx] = canon else: log.info(f"Invalid target -> dropping: {orig_target}") # Keep order, drop Nones - filtered = [c for c in canon_by_index if c is not None] + filtered = [c for c in validated_target if c is not None] if dedupe: seen, unique = set(), [] - for c in filtered: - if c not in seen: - seen.add(c) - unique.append(c) + for _c in filtered: + if _c not in seen: + seen.add(_c) + unique.append(_c) return unique return filtered @@ -346,7 +346,7 @@ def scan_target_group(self, targets, scan_id, process_number): targets = self.filter_valid_targets( targets, timeout_per_target=2.0, - max_workers=self.arguments.parallel_module_scan or None, + max_threads=self.arguments.parallel_module_scan or None, dedupe=True, ) active_threads = [] diff --git a/nettacker/core/hostcheck.py b/nettacker/core/hostcheck.py index 11f6f00a4..a48ffa693 100644 --- a/nettacker/core/hostcheck.py +++ b/nettacker/core/hostcheck.py @@ -19,18 +19,29 @@ _LABEL = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(? bool: + return bool(_IPV4_VALID_RE.match(s)) + def is_ip_literal(name: str) -> bool: """Return True if name is a valid IPv4 or IPv6 address literal.""" - try: - socket.inet_pton(socket.AF_INET, name) - return True - except OSError: - pass - try: - socket.inet_pton(socket.AF_INET6, name) - return True - except OSError: - return False + if is_single_ipv4(name): + if is_valid_ipv4(name): + return True + else: + return False + else: + try: + socket.inet_pton(socket.AF_INET6, name) + return True + except OSError: + return False def valid_hostname( host: str, @@ -45,7 +56,7 @@ def valid_hostname( Returns: True if the hostname is syntactically valid. """ - if host.endswith("."): + if host.endswith("."): # From RFC 1123 ,the number of characters can be 250 at max (without dots) and 253 with dots host = host[:-1] if len(host) > 253: return False @@ -62,7 +73,7 @@ def _gai_once(name: str, use_ai_addrconfig: bool, port): ) def _clean_host(s: str) -> str: - # remove surrounding quotes and whitespace, lone commas, repeated dots + # remove surrounding quotes and whitespaces s = s.strip().strip('"').strip("'") s = s.strip() # again, after quote strip # drop trailing commas that often sneak in from CSV-like inputs @@ -95,10 +106,7 @@ def resolve_quick( if host.endswith("."): host = host[:-1] - if not valid_hostname(host): - return False, None - - if "." not in host and not allow_single_label: + if not valid_hostname(host, allow_single_label=allow_single_label): return False, None def _call(use_ai_addrconfig: bool): diff --git a/nettacker/locale/ar.yaml b/nettacker/locale/ar.yaml index 23efab922..f730cff67 100644 --- a/nettacker/locale/ar.yaml +++ b/nettacker/locale/ar.yaml @@ -22,7 +22,6 @@ username_from_file: قراءة اسم المستخدم (ق) من الملف password_separator: كلمة (كلمات) المرور ، منفصلة مع "،" read_passwords: قراءة كلمة (كلمات) من الملف port_separator: قائمة port (s) ، منفصلة مع "،" -validate_before_scan: تحقق مسبقًا من الأهداف/الاتصال قبل الفحص؛ سيتم تخطي الأهداف غير القابلة للوصول time_to_sleep: وقت للنوم بين كل طلب error_target: لا يمكن تحديد الهدف (الأهداف) error_target_file: "لا يمكن تحديد الهدف (الأهداف) ، غير قادر على فتح الملف: {0}" diff --git a/nettacker/locale/bn.yaml b/nettacker/locale/bn.yaml index 90848ed5e..063b17f35 100644 --- a/nettacker/locale/bn.yaml +++ b/nettacker/locale/bn.yaml @@ -21,7 +21,6 @@ connection_retries: সংযোগ সময়সীমা (ডিফল্ট current_version: আপনি কোড নাম {3}{4}{5} সহ OWASP Nettacker সংস্করণ {0}{1}{2}{6} চালাচ্ছেন database_connect_fail: ডাটাবেস সংযোগ করতে পারে না! database_connection_failed: সংযোগ নির্বাচিত ডাটাবেস থেকে ব্যর্থ হয়েছে -validate_before_scan: স্ক্যানের আগে টার্গেট/কানেক্টিভিটি প্রি-ভ্যালিডেট করুন; যেগুলো পৌঁছানো যায় না সেগুলো বাদ দেওয়া হবে define_white_list: "হোয়াইট লিস্ট হোস্টকে সংজ্ঞায়িত করুন, এটি আলাদা করুন, (উদাহরণ: 127.0.0.1, 1 9 2.168.0.1/24, 10.0.0.1-10.0.0.255 )" engine: ইঞ্জিন filtered_content: ... [রিপোর্টে পূর্ণ সামগ্রী দেখুন] diff --git a/nettacker/locale/de.yaml b/nettacker/locale/de.yaml index a4ca757e3..38adc45a4 100644 --- a/nettacker/locale/de.yaml +++ b/nettacker/locale/de.yaml @@ -15,7 +15,6 @@ target_input: Zieleingabeoptionen target_list: Ziel (e) Liste, getrennt mit "," read_target: Lese Ziel (e) aus Datei scan_method_options: Scan-Methodenoptionen -validate_before_scan: "Ziele/Konnektivität vor dem Scan vorvalidieren; nicht erreichbare Ziele werden übersprungen." choose_scan_method: Suchmethode {0} auswählen exclude_scan_method: Suchmethode auswählen, um {0} auszuschließen username_list: Benutzername (s) Liste, getrennt mit "," diff --git a/nettacker/locale/el.yaml b/nettacker/locale/el.yaml index 70159b4e0..773e5c457 100644 --- a/nettacker/locale/el.yaml +++ b/nettacker/locale/el.yaml @@ -18,7 +18,6 @@ target_input: Επιλογές εισαγωγής στόχων target_list: λίστα στόχων, χωριστά με "," read_target: να διαβάσετε τους στόχους από το αρχείο scan_method_options: Επιλογές μεθόδου σάρωσης -validate_before_scan: Προέλεγχος στόχων/συνδεσιμότητας πριν από τη σάρωση· οι μη προσβάσιμοι στόχοι παραλείπονται choose_scan_method: επιλέξτε τη μέθοδο σάρωσης {0} exclude_scan_method: επιλέξτε μέθοδο σάρωσης για να εξαιρέσετε {0} username_list: όνομα χρήστη (ες), χωριστά με "," diff --git a/nettacker/locale/es.yaml b/nettacker/locale/es.yaml index d39d7ac16..957e70489 100644 --- a/nettacker/locale/es.yaml +++ b/nettacker/locale/es.yaml @@ -19,7 +19,6 @@ scan_method_options: Opciones de método de escaneo choose_scan_method: elija el método de escaneo {0} exclude_scan_method: elija el método de escaneo para excluir {0} username_list: nombre de usuario (s) list, separe con "," -validate_before_scan: Prevalidar objetivos/conectividad antes de escanear; los objetivos inaccesibles se omiten username_from_file: leer nombre (s) de usuario del archivo password_separator: lista de contraseña (s), separe con "," read_passwords: leer contraseña (s) del archivo diff --git a/nettacker/locale/fa.yaml b/nettacker/locale/fa.yaml index 6c053d79b..8f990d7e8 100644 --- a/nettacker/locale/fa.yaml +++ b/nettacker/locale/fa.yaml @@ -20,7 +20,6 @@ target_list: لیست هدف (ها)، با "," جدا کنید read_target: خواندن هدف (ها) از فایل scan_method_options: گزینه های متود های اسکن choose_scan_method: متود اسکن را انتخاب کنید {0} -validate_before_scan: قبل از اسکن، هدف‌ها/اتصال بررسی اولیه شوند؛ هدف‌های غیرقابل دسترس نادیده گرفته می‌شوند exclude_scan_method: انتخاب متود اسکن استثنا {0} username_list: لیست نام کاربری (ها)، با "," جدا شود username_from_file: خواندن نام کاربری (ها) از لیست diff --git a/nettacker/locale/fr.yaml b/nettacker/locale/fr.yaml index 22e60c3a1..2e35f1e26 100644 --- a/nettacker/locale/fr.yaml +++ b/nettacker/locale/fr.yaml @@ -22,7 +22,6 @@ choose_scan_method: choisissez la méthode de scan {0} exclude_scan_method: choisissez la méthode de scan pour exclure {0} username_list: nom d'utilisateur (s), séparé par "," username_from_file: lire le (s) nom (s) d'utilisateur à partir du fichier -validate_before_scan: Pré-valider les cibles/la connectivité avant l’analyse ; les cibles injoignables sont ignorées password_separator: mot de passe (s), séparé par "," read_passwords: lire le (s) mot de passe (s) du fichier port_separator: port (s) list, séparé par "," diff --git a/nettacker/locale/hi.yaml b/nettacker/locale/hi.yaml index 4fa798e8a..30fd16fe7 100644 --- a/nettacker/locale/hi.yaml +++ b/nettacker/locale/hi.yaml @@ -22,7 +22,6 @@ password_separator: पासवर्ड (ओं) सूची, "," से अ read_passwords: फ़ाइल से पासवर्ड पढ़ें port_separator: पोर्ट (ओं) सूची, "," से अलग time_to_sleep: प्रत्येक अनुरोध के बीच रुकने के लिए समय -validate_before_scan: स्कैन से पहले टार्गेट/कनेक्टिविटी का प्री-वैलिडेशन करें; जो टार्गेट पहुँच में नहीं हैं उन्हें छोड़ दिया जाएगा error_target: लक्ष्य निर्दिष्ट नहीं कर सकते error_target_file: "फ़ाइल को खोलने में असमर्थ, लक्ष्य (लक्ष्य) निर्दिष्ट नहीं कर सकते: diff --git a/nettacker/locale/hy.yaml b/nettacker/locale/hy.yaml index fe84f9768..78cee4290 100644 --- a/nettacker/locale/hy.yaml +++ b/nettacker/locale/hy.yaml @@ -23,7 +23,6 @@ username_from_file: կարդացեք օգտվողի անունը (ներ) ը ֆ password_separator: գաղտնաբառերի ցուցակը, որը առանձին է «,» read_passwords: կարդալ գաղտնաբառ (ներ) ը ֆայլից port_separator: պորտ (ներ) ցուցակը, որը առանձին է «,» -validate_before_scan: Սքանավորումից առաջ նախաստուգել թիրախները/կապը; անհասանելի թիրախները կբաց թողնվեն։ time_to_sleep: յուրաքանչյուր խնդրի միջեւ քնելու ժամանակ error_target: Հնարավոր չէ նշել թիրախ (ներ) error_target_file: Հնարավոր չէ նշել թիրախ (ներ) ը, չի կարող բացել ֆայլը, {0} diff --git a/nettacker/locale/id.yaml b/nettacker/locale/id.yaml index 406401ede..59c924983 100644 --- a/nettacker/locale/id.yaml +++ b/nettacker/locale/id.yaml @@ -24,7 +24,6 @@ password_separator: daftar kata sandi, terpisah dengan "," read_passwords: baca kata sandi (s) dari file port_separator: daftar port (s), terpisah dengan "," time_to_sleep: waktu untuk tidur di antara setiap permintaan -validate_before_scan: Pra-validasi target/konektivitas sebelum pemindaian; target yang tidak dapat dijangkau akan dilewati error_target: Tidak dapat menentukan target (s) error_target_file: "Tidak dapat menentukan target (s), tidak dapat membuka file: {0}" thread_number_warning: diff --git a/nettacker/locale/it.yaml b/nettacker/locale/it.yaml index 5587b9139..572429e6e 100644 --- a/nettacker/locale/it.yaml +++ b/nettacker/locale/it.yaml @@ -23,7 +23,6 @@ username_from_file: "leggi username (s) dal file" password_separator: lista password (s), separare con "," read_passwords: "leggere password (s) dal file" port_separator: elenco port (s), separare con "," -validate_before_scan: "Pre-convalidare target/connettività prima della scansione; i target non raggiungibili vengono ignorati" time_to_sleep: "tempo di dormire tra ogni richiesta" error_target: "Non è possibile specificare il / i target / i" error_target_file: "Impossibile specificare il / i target / i, impossibile aprire il file: {0}" diff --git a/nettacker/locale/iw.yaml b/nettacker/locale/iw.yaml index 0e47f41fb..b1c22380c 100644 --- a/nettacker/locale/iw.yaml +++ b/nettacker/locale/iw.yaml @@ -27,7 +27,6 @@ time_to_sleep: זמן לישון בין כל בקשה error_target: לא ניתן להגדיר את המיקודים error_target_file: "לא ניתן לציין את היעדים, לא ניתן לפתוח את הקובץ: {0}" thread_number_warning: עדיף להשתמש במספר פתיל נמוך מ -100, BTW אנחנו ממשיכים ... -validate_before_scan: אמת מראש יעדים/קישוריות לפני הסריקה; יעדים שאינם נגישים ידולגו. settimeout: להגדיר פסק זמן ל {0} שניות, זה גדול מדי, לא? בדרך שאנחנו ממשיכים ... scan_module_not_found: מודול הסריקה [{0}] לא נמצא! error_exclude_all: לא ניתן לבצע אי הכללה של כל שיטות הסריקה diff --git a/nettacker/locale/ja.yaml b/nettacker/locale/ja.yaml index 247f43100..37a451c54 100644 --- a/nettacker/locale/ja.yaml +++ b/nettacker/locale/ja.yaml @@ -25,7 +25,6 @@ read_passwords: ファイルからパスワードを読み込む port_separator: ポートリスト、 "、" time_to_sleep: 各リクエストの間にスリープする時間 error_target: ターゲットを指定できません -validate_before_scan: スキャン前にターゲット/接続性を事前検証します。到達不能なターゲットはスキップされます。 error_target_file: ファイルを開くことができないターゲットを指定することはできません:{0} thread_number_warning: 100より低いスレッド番号を使用する方が良いです、私たちは継続しています... settimeout: タイムアウトを{0}秒に設定すると大きすぎますね。私たちが続けているところで... diff --git a/nettacker/locale/ko.yaml b/nettacker/locale/ko.yaml index c2c12fb1d..7fdad55e6 100644 --- a/nettacker/locale/ko.yaml +++ b/nettacker/locale/ko.yaml @@ -26,7 +26,6 @@ port_separator: 포트 목록, "," time_to_sleep: 각 요청 사이에 잠자기 시간 error_target: 타겟을 지정할 수 없습니다. error_target_file: "파일을 열 수없는 대상을 지정할 수 없습니다 : {0}" -validate_before_scan: 스캔 전에 대상/연결성을 사전 검증합니다. 도달 불가능한 대상은 건너뜁니다. thread_number_warning: 100보다 낮은 스레드 번호를 사용하는 것이 좋습니다. 계속 진행 중입니다 ... settimeout: 시간 초과를 {0} 초로 설정하면 너무 큽니다. 그렇지 않습니까? 그런데 우리가 계속 ... scan_module_not_found: 이 스캔 모듈 [{0}]을 찾을 수 없습니다! diff --git a/nettacker/locale/nl.yaml b/nettacker/locale/nl.yaml index f170f29ee..fec1de89c 100644 --- a/nettacker/locale/nl.yaml +++ b/nettacker/locale/nl.yaml @@ -25,7 +25,6 @@ read_passwords: lees wachtwoord (s) uit bestand port_separator: poort (en) lijst, gescheiden door "," time_to_sleep: tijd om te slapen tussen elk verzoek error_target: Kan het doel (de doelen) niet specificeren -validate_before_scan: Targets/verbinding vooraf valideren vóór de scan; onbereikbare targets worden overgeslagen error_target_file: "Kan doel (en) niet specificeren, kan bestand niet openen: {0}" thread_number_warning: het is beter om een ​​draadnummer lager dan 100 te gebruiken, diff --git a/nettacker/locale/ps.yaml b/nettacker/locale/ps.yaml index 093ab0254..3c49ce66c 100644 --- a/nettacker/locale/ps.yaml +++ b/nettacker/locale/ps.yaml @@ -22,7 +22,6 @@ username_list: د کارن نوموونکي لیست، د "،" سره جلا username_from_file: د دوتنې څخه کارن نوم password_separator: د پټنوم (لسټ) لیست، د "،" سره جلا کړئ read_passwords: د دوتنې څخه پټنوم (پوسټ) ولولئ -validate_before_scan: له سکان مخکې هدفونه/نښلول مخکې له مخکې تایید کړئ؛ ناہرسايل هدفونه پرېښودل کېږي port_separator: د بندرونو لیست، د "،" سره جلا کول time_to_sleep: د هرې غوښتنې په منځ کې د خوب کولو وخت error_target: هدف یا هدف مشخص کولی نشی diff --git a/nettacker/locale/pt-br.yaml b/nettacker/locale/pt-br.yaml index 2c5233058..431f6a0bc 100644 --- a/nettacker/locale/pt-br.yaml +++ b/nettacker/locale/pt-br.yaml @@ -28,7 +28,6 @@ username_from_file: ler nome(s) de usuário(s) do arquivo password_separator: 'lista de senha(s), separe com ","' read_passwords: ler senhas(s) do arquivo port_separator: 'lsita de porta(s), separe com ","' -validate_before_scan: Pré-validar alvos/conectividade antes da varredura; alvos inacessíveis serão ignorados time_to_sleep: tempo para esperar entre cada solicitação error_target: Não foi possível especificar o(s) alvo(s) error_target_file: 'Não foi possível especificar o(s) alvo(s), impossível abrir o arquivo: {0}' diff --git a/nettacker/locale/ru.yaml b/nettacker/locale/ru.yaml index 909dc187a..ba295b4d4 100644 --- a/nettacker/locale/ru.yaml +++ b/nettacker/locale/ru.yaml @@ -32,7 +32,6 @@ settimeout: установлен таймаут до {0} секунд, он слишком велик, но мы продолжаем... scan_module_not_found: этот модуль сканирования [{0}] не найден! error_exclude_all: вы не можете исключить все методы сканирования -validate_before_scan: Предварительно проверять цели/подключение перед сканированием; недоступные цели пропускаются exclude_module_error: модуль {0}, который вы выбрали для исключения, не найден! method_inputs: "введите параметры методов, например: ftp_brute_users = test, admin & ftp_brute_passwds diff --git a/nettacker/locale/tr.yaml b/nettacker/locale/tr.yaml index d213fce0e..670120ac6 100644 --- a/nettacker/locale/tr.yaml +++ b/nettacker/locale/tr.yaml @@ -24,7 +24,6 @@ password_separator: şifre listesi "," ile ayrı read_passwords: dosyadan şifre (ler) oku port_separator: port (lar) listesi, "," ile ayrı time_to_sleep: her istek arasında uyumak için zaman -validate_before_scan: Taramadan önce hedefleri/bağlanılabilirliği önceden doğrula; erişilemeyen hedefler atlanır error_target: Hedef (ler) belirtilemiyor error_target_file: "Dosya açılamayan hedef (ler) belirtilemiyor: {0}" thread_number_warning: diff --git a/nettacker/locale/ur.yaml b/nettacker/locale/ur.yaml index 315176448..1201e7313 100644 --- a/nettacker/locale/ur.yaml +++ b/nettacker/locale/ur.yaml @@ -28,7 +28,6 @@ port_separator: بندرگاہ کی فہرست، کے ساتھ علیحدہ "،" time_to_sleep: ہر درخواست کے درمیان سونے کا وقت error_target: ہدف مقرر نہیں کر سکتے ہیں error_target_file: "ہدف (ن) کی وضاحت نہیں کرسکتا، فائل کو کھولنے میں ناکام ہے: {0}" -validate_before_scan: اسکین سے پہلے ٹارگٹس/کنیکٹیوٹی کی ابتدائی توثیق کریں؛ ناقابلِ رسائی ٹارگٹس چھوڑ دیے جائیں گے۔ thread_number_warning: اس موضوع کو 100 سے زائد کم دھاگے کا استعمال کرنا بہتر ہے، بی ٹی ڈبلیو ہم جاری رہے گی ... diff --git a/nettacker/locale/vi.yaml b/nettacker/locale/vi.yaml index dceb4c28d..2494612dc 100644 --- a/nettacker/locale/vi.yaml +++ b/nettacker/locale/vi.yaml @@ -22,7 +22,6 @@ username_list: (các) tên người dùng, riêng biệt với "," username_from_file: đọc (các) tên người dùng từ tệp password_separator: (các) mật khẩu, riêng biệt với "," read_passwords: đọc (các) mật khẩu từ tệp -validate_before_scan: Tiền kiểm tra mục tiêu/kết nối trước khi quét; các mục tiêu không truy cập được sẽ bị bỏ qua port_separator: danh sách cổng, tách biệt với "," time_to_sleep: thời gian để ngủ giữa mỗi yêu cầu error_target: Không thể chỉ định (các) mục tiêu diff --git a/nettacker/locale/zh-cn.yaml b/nettacker/locale/zh-cn.yaml index 7b795c44e..f15b65142 100644 --- a/nettacker/locale/zh-cn.yaml +++ b/nettacker/locale/zh-cn.yaml @@ -23,7 +23,6 @@ username_from_file: 从文件中读取用户名 password_separator: 密码列表,用“,”分开 read_passwords: 从文件中读取密码 port_separator: 端口列表,用“,”分开 -validate_before_scan: 在扫描前预先验证目标/连通性;无法访问的目标将被跳过。 time_to_sleep: 每次请求的间隔时间 error_target: 无法指定目标(s) error_target_file: 无法指定目标,无法打开文件:{0}