MCPcopy
hub / github.com/guelfoweb/knockpy / print_scan_status

Function print_scan_status

knockpy/output.py:658–695  ·  view source on GitHub ↗
(
    timeout: float,
    threads: Optional[int],
    dns: str,
    useragent: str,
    recon: bool,
    brute: bool,
    wordlist: Optional[str] = None,
    target_count: Optional[int] = None,
)

Source from the content-addressed store, hash-verified

656
657
658def print_scan_status(
659 timeout: float,
660 threads: Optional[int],
661 dns: str,
662 useragent: str,
663 recon: bool,
664 brute: bool,
665 wordlist: Optional[str] = None,
666 target_count: Optional[int] = None,
667) -> None:
668 if threads is None:
669 if target_count is None:
670 threads_value = "auto (dynamic: min(300, max(20, targets)))"
671 else:
672 auto_threads = min(300, max(20, target_count))
673 threads_value = f"auto ({auto_threads})"
674 else:
675 threads_value = str(threads)
676
677 default_wordlist = ROOT / "wordlist" / "wordlist.txt"
678 default_wordlist_status = "present" if default_wordlist.is_file() else "missing"
679 wordlist_mode = "custom" if wordlist else "default"
680
681 table = _new_table(title="Scan Status", box_style=box.MINIMAL_DOUBLE_HEAD)
682 _add_kv_columns(table)
683
684 table.add_row("Timeout", str(timeout))
685 table.add_row("Threads", threads_value)
686 table.add_row("DNS", dns)
687 table.add_row("User-Agent", useragent)
688 table.add_row("Recon", str(recon))
689 table.add_row("Bruteforce", str(brute))
690 table.add_row("Wordlist Mode", wordlist_mode)
691 table.add_row("Default Wordlist", f"{default_wordlist} ({default_wordlist_status})")
692 table.add_row("Reports DB", str(get_db_path()))
693 table.add_row("Reports Count", str(count_reports()))
694
695 console.print(table)
696
697
698def show_reports_catalog(reports: List[Dict[str, Any]]) -> None:

Callers 1

mainFunction · 0.85

Calls 4

_new_tableFunction · 0.85
_add_kv_columnsFunction · 0.85
get_db_pathFunction · 0.85
count_reportsFunction · 0.85

Tested by

no test coverage detected