Skip to content

Agent KB_core_p2

grisun0 edited this page Oct 16, 2026 · 20 revisions

Subsystem: core (page 2 of 2)

Previous: KB_core.md

core/protocols.py

  • Doc: Stable structural interfaces (PEP 544 Protocol) for high-level orchestration.
  • Layer: utility
  • Language: py
  • Symbols:
    • Selector (class, line 17) class Selector(Protocol)
    • LLMBackend (class, line 37) class LLMBackend(Protocol)
    • MemoryStore (class, line 51) class MemoryStore(Protocol)
    • BridgeCatalog (class, line 62) class BridgeCatalog(Protocol)
    • OutcomeEvaluator (class, line 70) class OutcomeEvaluator(Protocol)
    • suggest (method, line 27) def suggest(self, target, phase, context)
    • complete (method, line 40) def complete(self, system, user, max_tokens, temperature)
    • put (method, line 54) def put(self, key, value)
    • get (method, line 56) def get(self, key, default)
    • search (method, line 58) def search(self, query, k)
    • filter (method, line 65) def filter(self, phase, os_id)
    • evaluate (method, line 73) def evaluate(self, command, output, target, phase)
  • Imported by: tests/test_core.py

core/reverse_shell_secret.py

  • Doc: Reverse-shell fallback secret — sealed persistence contract.
  • Layer: utility
  • Language: py
  • Symbols:
    • seal_reverse_shell_password (function, line 24) def seal_reverse_shell_password(plaintext)
    • load_reverse_shell_password (function, line 41) def load_reverse_shell_password(secret_path)
    • generate_reverse_shell_password (function, line 65) def generate_reverse_shell_password()
    • is_configured_password_valid (function, line 74) def is_configured_password_valid(candidate, minimum_length)
  • Depends on: core/hardening.py
  • Imported by: lazyc2.py, tests/test_security_alerts_fix.py

core/safe_console.py

core/safe_exec.py

core/safe_import.py

  • Doc: Fail-closed import of attacker-supplied campaign packages.
  • Layer: utility
  • Language: py
  • Symbols:
    • is_safe_identifier (function, line 20) def is_safe_identifier(name)
    • filter_columns (function, line 32) def filter_columns(src_columns, dest_columns)
    • safe_extract_zip (function, line 51) def safe_extract_zip(archive, dest)
    • safe_copy_tree (function, line 93) def safe_copy_tree(src, dest)
  • Imported by: cli/commands/campaign.py, tests/test_campaign_import_safety.py

core/safe_subprocess.py

core/scheduler.py

  • Doc: Centralized task scheduler for the LazyOwn framework.
  • Layer: infrastructure
  • Language: py
  • Symbols:
    • _TaskInfo (class, line 41) class _TaskInfo
    • TaskScheduler (class, line 50) class TaskScheduler
    • get_scheduler (function, line 285) def get_scheduler()
    • __init__ (method, line 61) def __init__(self)
    • instance (method, line 73) def instance(cls)
    • start (method, line 81) def start(self)
    • stop (method, line 100) def stop(self)
    • schedule_task (method, line 123) def schedule_task(self, name, interval_seconds, func)
    • schedule_once (method, line 157) def schedule_once(self, name, delay_seconds, func)
    • cancel_task (method, line 192) def cancel_task(self, name)
    • list_tasks (method, line 205) def list_tasks(self)
    • _cancel_internal (method, line 224) def _cancel_internal(self, name)
    • _schedule_recurring_stdlib (method, line 238) def _schedule_recurring_stdlib(self, info)
    • _run_once_wrapper (method, line 254) def _run_once_wrapper(self, name, func)
    • _run_stdlib_loop (method, line 268) def _run_stdlib_loop(self)
    • _wrapper (function, line 241) def _wrapper()
    • _wrapper (function, line 257) def _wrapper()
  • Depends on: core/logging.py

core/security.py

  • Doc: Security helpers for LazyOwn — anti-debug, certificate generation.
  • Layer: utility
  • Language: py
  • Symbols:
    • anti_debug (function, line 18) def anti_debug()
    • generate_certificates (function, line 58) def generate_certificates(output_dir)
  • Depends on: core/logging.py

core/terminal_guard.py

  • Doc: Terminal state guard for interactive automation.
  • Layer: utility
  • Language: py
  • Symbols:
    • _tty_fd (function, line 30) def _tty_fd()
    • emit_restore_sequences (function, line 41) def emit_restore_sequences()
    • apply_stty_sane (function, line 62) def apply_stty_sane()
    • TerminalGuard (class, line 73) class TerminalGuard
    • __init__ (method, line 85) def __init__(self)
    • __enter__ (method, line 91) def __enter__(self)
    • __exit__ (method, line 104) def __exit__(self)
    • restore (method, line 108) def restore(self)
  • Imported by: modules/lazy_runner.py, tests/test_lazy_runner.py

core/text_utils.py

core/validators.py

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally