Agent API_p6 - grisuno/LazyOwn GitHub Wiki

API (page 6 of 23)

Previous: API_p5.md

contrib/legacy/lazypwnkit.py

contrib/legacy/lazyreversentlmv2.py

Depends on: modules/lazyencoder_decoder.py

contrib/legacy/lazysearch.py

contrib/legacy/lazysearch_bot.py

Depends on: core/logging.py

contrib/legacy/lazyseo.py

Depends on: modules/colors.py

contrib/legacy/lazysmbrelay.py

Depends on: core/logging.py, utils.py

contrib/legacy/lazysniff.py

contrib/legacy/lazysqli.py

contrib/legacy/lazyssh.py

Depends on: core/logging.py

contrib/legacy/lazyvsftp.py

Depends on: cli/commands/pwn.py

contrib/legacy/sql.py

Depends on: cli/commands/pwn.py

core/api_authz.py

Imported by: lazyc2/app_factory.py, lazyc2/blueprints/api.py, tests/test_api_authz.py, tests/test_api_v1.py

  • ApiKey.to_dict (method) core/api_authz.py:94 def to_dict(self)
  • ApiKey.from_dict (method) core/api_authz.py:107 def from_dict(cls, data)
  • ApiKey.is_expired (method) core/api_authz.py:119 def is_expired(self)
  • ApiKey.is_retired (method) core/api_authz.py:124 def is_retired(self)
  • ApiKey.has_permission (method) core/api_authz.py:127 def has_permission(self, permission)
  • ApiKey.has_all_permissions (method) core/api_authz.py:130 def has_all_permissions(self, permissions)
  • ApiKeyStore.__init__ (method) core/api_authz.py:170 def __init__(self, config)
  • ApiKeyStore.config (method) core/api_authz.py:176 def config(self) -- The configuration this store was built with.
  • ApiKeyStore.list_keys (method) core/api_authz.py:217 def list_keys(self, tenant_id) -- List all active keys, optionally filtered by tenant_id.
  • ApiKeyStore.find_by_hash (method) core/api_authz.py:229 def find_by_hash(self, key_hash) -- Look up a key record by its SHA-256 hash.
  • ApiKeyStore.create_key (method) core/api_authz.py:238 def create_key(self, tenant_id, label, permissions, expires_in_days) -- Create a new API key and return (ApiKey, plaintext_secret).
  • ApiKeyStore.revoke_key (method) core/api_authz.py:273 def revoke_key(self, label, tenant_id) -- Revoke every key with label within tenant_id.
  • ApiKeyStore.validate_key (method) core/api_authz.py:287 def validate_key(self, plaintext) -- Validate a plaintext API key and return the ApiKey record.
  • ApiKeyStore.rotate_key (method) core/api_authz.py:309 def rotate_key(self, label, tenant_id) -- Rotate an existing key by label.
  • require_api_auth (function) core/api_authz.py:365 def require_api_auth(store, permissions, require_tenant) -- Flask-route decorator that enforces API-key + tenant authorization.
  • decorator (function) core/api_authz.py:405 def decorator(f)
  • decorated (function) core/api_authz.py:407 def decorated()
  • create_api_token (function) core/api_authz.py:440 def create_api_token(store, tenant_id, label, permissions, expires_in_days) -- Create an API key and return the one-time plaintext token.

core/autonomous.py

Imported by: cli/commands/exploit_migrated.py, cli/commands/mcp_bridge.py, lazyown.py, modules/lazy_runner.py, tests/test_lazy_runner.py

  • is_autonomous (function) core/autonomous.py:21 def is_autonomous() -- Return True while an autonomous loop run owns the process.
  • autonomous_mode (function) core/autonomous.py:27 def autonomous_mode() -- Suppress interactive prompts for the duration of a loop run.

core/command_bridge.py

Depends on: lazyown.py Imported by: tests/test_core_command_bridge.py

core/config.py

Depends on: core/logging.py, core/payload_schema.py Imported by: cli/aliases.py, cli/commands/bof_registry.py, cli/commands/command_and_control_migrated.py, cli/commands/defaults.py, cli/commands/help_ui.py, cli/commands/mcp_bridge.py, cli/commands/misc_migrated.py, cli/commands/persist_migrated.py, cli/commands/purple_team.py, cli/commands/recon_migrated.py, cli/commands/security.py, cli/commands/session_ops.py, cli/commands/ux.py, cli/engagement_hooks.py, cli/lazy_orchestrator.py, core/__init__.py, core/credential_vault.py, core/hardening.py, core/prompt.py, lazyc2/blueprints/api.py, lazyown.py, modules/auto_purple.py, modules/beacon_config_builder.py, modules/c2_profile_engine.py, modules/cli_auth.py, modules/config_store.py, modules/db.py, modules/lazy_agent.py, modules/lazy_cli_bridge.py, modules/lazy_installer.py, modules/lazy_intel.py, modules/lazy_loop.py, modules/lazy_sandbox.py, modules/operator_profiles.py, modules/opsec_scorer.py, modules/orchestrator_config.py, modules/reactive_engine.py, skills/lazyown_mcp.py, tests/test_aes_key_propagation.py, tests/test_cli_assign.py, tests/test_cli_command_sets.py, tests/test_core.py, tests/test_core_config.py, tests/test_improvements_spec.py, tests/test_lazy_agent.py, tests/test_lazy_orchestrator.py, tests/test_lazy_runner.py, tests/test_loop_supervision.py, utils.py

  • Config.__init__ (method) core/config.py:219 def __init__(self, config_dict, sessions_dir)
  • Config.as_params (method) core/config.py:234 def as_params(self) -- Return a shallow copy of the underlying parameter dictionary.
  • Config.overridden_keys (method) core/config.py:244 def overridden_keys(self) -- Return sorted list of keys that were overridden via LAZYOWN_* env vars.
  • resolve_aes_key (function) core/config.py:261 def resolve_aes_key(config_dict) -- Return a 32-byte AES key derived from config, disk, or randomness.
  • load_payload (function) core/config.py:327 def load_payload(path) -- Load and return the JSON payload at path.
  • load_and_validate (function) core/config.py:345 def load_and_validate(path) -- Load [payload.json](https://github.com/grisuno/LazyOwn/blob/146a52570ef792d1ec01ec4d3709b0c159990e47/payload.json), validate against the schema, and return a result dict.
  • save_payload (function) core/config.py:396 def save_payload(payload, path) -- Atomically write payload as pretty-printed JSON to path.

core/console.py

Imported by: cli/command_explorer.py, cli/commands/help_ui.py, cli/commands/misc_migrated.py, cli/commands/orchestration.py, cli/commands/recon.py, cli/commands/security.py, cli/commands/ux.py, cli/config_status.py, cli/contextual_help.py, cli/doctor.py, cli/exploit_advisor.py, cli/exploration_view.py, cli/protips.py, cli/reactive_hints.py, cli/session_resumer.py, cli/splash.py, cli/surface_tui.py, cli/tips_engine.py, cli/toast_bus.py, cli/tutorial.py, cli/wizard.py, contrib/legacy/lazybinenc.py, core/__init__.py, core/error_advice.py, core/http.py, core/network.py, core/process.py, core/safe_console.py, core/validators.py, key.py, lazy_sentinel4.py, lazyown.py, modules/apt_playbooks.py, modules/atomic_cli.py, modules/ia_code_analysis.py, modules/ia_logs_analysis.py, modules/ia_network_analysis.py, modules/lilsplunky.py, modules/privesc_predictor.py, modules/rich_tui.py, tests/test_console_stdio.py, tests/test_core.py, tests/test_exploration_and_addons.py, tests/test_lazy_parity.py, tests/test_loop_progress.py, tests/test_scope_guard_integration.py, tests/test_toast_bus.py, tests/test_tui_splash.py, tests/test_tui_style.py, tests/test_tui_themes.py, utils.py

  • colors_enabled (function) core/console.py:98 def colors_enabled() -- Return False when NO_COLOR or ANSI_COLORS_DISABLED is set.
  • format_line (function) core/console.py:121 def format_line(prefix, message, glyph) -- Build a single log line with standard prefix and sanitized message.
  • print_error (function) core/console.py:137 def print_error(error) -- Print a red error message to stdout (never raises on broken pipes).
  • print_msg (function) core/console.py:143 def print_msg(msg) -- Print a green informational message to stdout (never raises).
  • print_warn (function) core/console.py:149 def print_warn(warn) -- Print a magenta/yellow warning message to stdout (never raises).
  • print_succ (function) core/console.py:155 def print_succ(msg) -- Print a bright green success message to stdout (never raises).
  • ensure_blocking_stdio (function) core/console.py:161 def ensure_blocking_stdio() -- Restore blocking mode on stdio fds inherited as non-blocking.
  • write_stdout (function) core/console.py:180 def write_stdout(text) -- Write text to stdout, tolerating non-blocking or broken pipes.

core/credential_vault.py

Depends on: core/config.py, core/crypto.py, core/logging.py Imported by: cli/commands/security.py, core/hardening.py, lazyown.py, tests/test_credential_vault.py

  • check_dangerous_defaults (function) core/credential_vault.py:63 def check_dangerous_defaults(payload) -- Scan payload for unchanged default credential values.
  • seal_value (function) core/credential_vault.py:93 def seal_value(plaintext, key) -- Encrypt a single credential value.
  • unseal_value (function) core/credential_vault.py:112 def unseal_value(sealed, key) -- Decrypt a sealed credential value.
  • seal_payload (function) core/credential_vault.py:141 def seal_payload(payload, key) -- Return a copy of payload with all sensitive values encrypted.
  • unseal_payload (function) core/credential_vault.py:164 def unseal_payload(payload, key) -- Return a copy of payload with all sealed values decrypted.
  • rotate_aes_key (function) core/credential_vault.py:186 def rotate_aes_key(payload, current_key) -- Generate a new AES key, re-encrypt all sealed values under it.
  • generate_secure_defaults (function) core/credential_vault.py:215 def generate_secure_defaults() -- Generate cryptographically random default values for sensitive keys.

core/crypto.py

Imported by: cli/auto_crypto.py, cli/commands/exfiltration.py, core/__init__.py, core/credential_vault.py, modules/db.py, modules/lazy_loop.py, modules/phishing_orchestrator.py, modules/rootkit/rootkit.c, tests/test_core.py, utils.py

  • generate_salt (function) core/crypto.py:24 def generate_salt(length) -- Generate a cryptographically random salt.
  • derive_key (function) core/crypto.py:36 def derive_key(password, salt) -- Derive a Fernet-compatible key from a password using PBKDF2HMAC.
  • xor_encrypt_decrypt (function) core/crypto.py:67 def xor_encrypt_decrypt(data, key) -- Return bytearray produced by XOR-ing each byte of data with key.
  • generate_xor_key (function) core/crypto.py:83 def generate_xor_key(length) -- Generate a random XOR key of the given length as a hex string.
  • AESencrypt (function) core/crypto.py:98 def AESencrypt(plaintext, key) -- Encrypt plaintext with AES-256-GCM using a random nonce.
  • AESdecrypt (function) core/crypto.py:123 def AESdecrypt(data, key) -- Decrypt data produced by AESencrypt.
  • dropFile (function) core/crypto.py:154 def dropFile(key, ciphertext) -- Write AES key and ciphertext to sessions/cipher.bin and sessions/key.bin.

core/defaults.py

Imported by: cli/commands/cred_migrated.py, cli/commands/defaults.py, lazyc2/blueprints/api.py, lazyown.py, modules/autonomous_exploit_engine.py, modules/hash_cracker.py, tests/test_security_codeql_batch.py

  • load_defaults (function) core/defaults.py:21 def load_defaults(path) -- Load and cache the defaults document.
  • clear_cache (function) core/defaults.py:44 def clear_cache() -- Drop cached documents (tests only).
  • get (function) core/defaults.py:49 def get(section, key, default) -- Return defaults[section][key] or default when absent.
  • default_lport (function) core/defaults.py:63 def default_lport() -- Return the fallback listener port as an int.
  • default_rport (function) core/defaults.py:72 def default_rport() -- Return the fallback remote port as an int.
  • rockyou_wordlist (function) core/defaults.py:81 def rockyou_wordlist() -- Return the default wordlist path.
  • common_wordlists (function) core/defaults.py:90 def common_wordlists() -- Return the ordered wordlist fallback candidates.
  • sessions_dir (function) core/defaults.py:100 def sessions_dir() -- Return the sessions directory path.

core/dependencies.py

Imported by: core/__init__.py, tests/test_dependencies.py, utils.py

  • MissingDependencyError.__init__ (method) core/dependencies.py:45 def __init__(self, import_name, pip_package, feature) -- Build a remediation-oriented error message.
  • _DeferredImport.__init__ (method) core/dependencies.py:115 def __init__(self, spec) -- Store the dependency spec used to build remediation errors.
  • _DeferredImport.__call__ (method) core/dependencies.py:136 def __call__(self) -- Reject calling a missing dependency.
  • optional_import (function) core/dependencies.py:183 def optional_import(import_name) -- Import an optional module, returning a deferred proxy when absent.
  • optional_attr (function) core/dependencies.py:209 def optional_attr(import_name, attr) -- Import an attribute from an optional module, deferring failure.
  • DependencyReport.missing (method) core/dependencies.py:278 def missing(self) -- Return the optional Python dependencies that are not installed.
  • DependencyReport.ok (method) core/dependencies.py:283 def ok(self) -- Return True when every declared dependency is present.
  • probe_python_dependency (function) core/dependencies.py:288 def probe_python_dependency(spec) -- Probe a single Python dependency by importing it.
  • collect_dependency_report (function) core/dependencies.py:312 def collect_dependency_report() -- Probe every declared optional Python dependency.
  • format_report (function) core/dependencies.py:323 def format_report(report) -- Render a :class:DependencyReport as an aligned, human-readable block.
  • main (function) core/dependencies.py:368 def main() -- Print the optional-dependency report and return a process exit code.

core/error_advice.py

Depends on: core/console.py

  • ErrorAdvice.docs_url (method) core/error_advice.py:35 def docs_url(self, config) -- Return absolute documentation URL for this advice.
  • get_advice (function) core/error_advice.py:74 def get_advice(key) -- Return advice for key or None when unknown.
  • render_advice (function) core/error_advice.py:86 def render_advice(key, config) -- Render advice as four plain lines with explicit level tags.

core/errors.py

Depends on: cli/commands/enum.py Imported by: core/__init__.py

  • LazyOwnError.__init__ (method) core/errors.py:61 def __init__(self, message, error_code)
  • LazyOwnError.to_dict (method) core/errors.py:66 def to_dict(self) -- Return a serialisable dict with code, type, and message.
  • ConfigError.__init__ (method) core/errors.py:81 def __init__(self, message, error_code)
  • TargetError.__init__ (method) core/errors.py:88 def __init__(self, message, error_code)
  • AuthError.__init__ (method) core/errors.py:95 def __init__(self, message, error_code)
  • ToolError.__init__ (method) core/errors.py:102 def __init__(self, message, error_code)
  • PayloadError.__init__ (method) core/errors.py:109 def __init__(self, message, error_code)
  • DatabaseError.__init__ (method) core/errors.py:116 def __init__(self, message, error_code)
  • NetworkError.__init__ (method) core/errors.py:123 def __init__(self, message, error_code)
  • PermissionError.__init__ (method) core/errors.py:130 def __init__(self, message, error_code)
  • ValidationError.__init__ (method) core/errors.py:137 def __init__(self, message, error_code)

core/executor.py

Depends on: core/logging.py Imported by: tests/test_core_executor.py

core/hardening.py

Depends on: core/config.py, core/credential_vault.py, core/host_policy.py, core/logging.py Imported by: cli/commands/anti_forensics.py, cli/commands/cloud.py, cli/commands/command_and_control_migrated.py, cli/commands/exfiltration.py, cli/commands/lateral_migrated.py, cli/commands/nethelpers.py, cli/commands/persist_migrated.py, cli/commands/pivoting.py, core/process.py, core/reverse_shell_secret.py, core/safe_subprocess.py, lazyc2.py, lazyown.py, modules/atomic_cli.py, modules/domain_dominance.py, modules/lazy_loop.py, modules/lazy_proxy.py, modules/phishing_orchestrator.py, modules/websocket_beacon.py, scripts/devtools/core_smoke.py, skills/claude_md_orchestrator/validators.py, skills/lazyown_mcp.py, tests/test_host_policy.py, tests/test_security_alerts_fix.py, tests/test_security_hardening_v3.py, tests/test_shell_semantics.py

  • reject_option_injection (function) core/hardening.py:85 def reject_option_injection(argv) -- Reject argument-injection payloads in argv.
  • escape_powershell_single_quoted (function) core/hardening.py:104 def escape_powershell_single_quoted(value) -- Escape a value for embedding in a PowerShell single-quoted string.
  • terminal_env (function) core/hardening.py:129 def terminal_env(base) -- Return a child environment that keeps ANSI colors on a pipe.
  • safe_subprocess_run (function) core/hardening.py:150 def safe_subprocess_run(argv) -- Execute a command via subprocess without shell interpretation.
  • safe_clipboard_copy (function) core/hardening.py:195 def safe_clipboard_copy(content) -- Copy content to system clipboard without shell interpretation.
  • build_sshpass_command (function) core/hardening.py:234 def build_sshpass_command(password, ssh_args) -- Build an sshpass command using SSHPASS env var (sshpass -e).
  • set_sshpass_env (function) core/hardening.py:263 def set_sshpass_env(password) -- Create an environment dict with SSHPASS set for sshpass -e.
  • escape_html_content (function) core/hardening.py:282 def escape_html_content(value) -- Escape HTML special characters to prevent XSS.
  • safe_path_join (function) core/hardening.py:294 def safe_path_join(base_dir, user_path) -- Join base_dir and user_path safely, preventing path traversal.
  • validate_network_cidr (function) core/hardening.py:320 def validate_network_cidr(cidr) -- Validate a network CIDR notation string.
  • validate_port_spec (function) core/hardening.py:332 def validate_port_spec(ports) -- Validate a port specification string.
  • validate_host (function) core/hardening.py:348 def validate_host(host) -- Validate a hostname or IP address.
  • require_encryption_key (function) core/hardening.py:368 def require_encryption_key(env_key, secret_file) -- Require a proper encryption key; never fall back to a static default.
  • defused_xml_parse (function) core/hardening.py:396 def defused_xml_parse(source) -- Parse XML safely using defusedxml.
  • sanitize_filename (function) core/hardening.py:418 def sanitize_filename(filename, max_length) -- Sanitize a filename by removing dangerous characters.
  • tls_secure_context (function) core/hardening.py:438 def tls_secure_context(extra_ca) -- Build a verifying client TLS context with a TLS 1.2 floor.
  • tls_lab_unverified_allowed (function) core/hardening.py:463 def tls_lab_unverified_allowed(host) -- Return True only when unverified lab TLS is explicitly opted in.
  • tls_lab_fallback_context (function) core/hardening.py:490 def tls_lab_fallback_context() -- Build the gated unverified context for lab self-signed hosts.
  • validate_upstream_path (function) core/hardening.py:512 def validate_upstream_path(path) -- Validate an origin-form upstream path without regular expressions.
  • is_safe_path_segment (function) core/hardening.py:541 def is_safe_path_segment(segment) -- Validate one path segment with a linear charset scan (no regex).
  • is_safe_dir_path (function) core/hardening.py:562 def is_safe_dir_path(raw) -- Validate a relative directory path with linear scans (no regex).
  • is_safe_yaml_name (function) core/hardening.py:588 def is_safe_yaml_name(name) -- Validate a YAML filename with linear scans (no regex).
  • safe_join_under (function) core/hardening.py:607 def safe_join_under(base_dir, user_path) -- Join and resolve user_path under base_dir (symlink-safe).
  • safe_open_under (function) core/hardening.py:636 def safe_open_under(base_dir, user_path, mode) -- Open a file under base_dir after traversal validation.
  • store_secret_owner_only (function) core/hardening.py:663 def store_secret_owner_only(path, text) -- Atomically store a secret owner-only (0600, dir 0700).
  • contains_emoji (function) core/hardening.py:706 def contains_emoji(text) -- Return True when text carries any emoji codepoint.
  • iter_emoji_spans (function) core/hardening.py:721 def iter_emoji_spans(text) -- Return (offset, char) for every emoji char in text.
  • seal_secret (function) core/hardening.py:754 def seal_secret(plaintext) -- Seal a secret with Fernet (AES-128-CBC + HMAC) for storage.
  • unseal_secret (function) core/hardening.py:785 def unseal_secret(stored) -- Reveal a secret stored by :func:seal_secret (legacy-compatible).
  • redact_text (function) core/hardening.py:826 def redact_text(text) -- Mask credential-like patterns before persistence or display.

core/host_policy.py

Imported by: core/hardening.py, core/validators.py, tests/test_host_policy.py

  • rejects_shell_meta (function) core/host_policy.py:20 def rejects_shell_meta(value) -- Return True when value contains characters usable for shell injection.
  • is_valid_cidr (function) core/host_policy.py:32 def is_valid_cidr(value) -- Check value is a valid CIDR block.
  • is_valid_host (function) core/host_policy.py:48 def is_valid_host(value) -- Check value is a plain IP, CIDR, or hostname without shell metacharacters.

core/http.py

Depends on: core/console.py Imported by: core/__init__.py

  • generate_http_req (function) core/http.py:18 def generate_http_req(host, port, uri, custom_header, cmd) -- Build and send an HTTP GET request.
  • get_banner (function) core/http.py:50 def get_banner(host, port) -- Fetch a banner by connecting via HTTP to the given host and port.
  • get_command (function) core/http.py:69 def get_command(url, lhost) -- Fetch a command payload from a remote URL.
  • send_command (function) core/http.py:87 def send_command(cmd, url, lhost) -- Send a command via HTTP POST.
  • exploitalert (function) core/http.py:106 def exploitalert(content) -- Parse ExploitAlert search results HTML.
  • packetstormsecurity (function) core/http.py:125 def packetstormsecurity(content) -- Parse Packet Storm Security search results HTML.
  • nvddb (function) core/http.py:143 def nvddb(content) -- Parse NVD JSON vulnerability feed.
  • scrape_news (function) core/http.py:174 def scrape_news() -- Scrape Hacker News top stories.
  • display_news (function) core/http.py:198 def display_news(titles, links, scores) -- Display scraped news in the console.
  • inject_payloads (function) core/http.py:211 def inject_payloads(urls, payload_url, request_timeout) -- Attempt to inject a payload URL into a list of target URLs.

core/llm_budget.py

Imported by: cli/commands/ai.py, modules/llm_factory.py, skills/lazyown_mcp.py, tests/test_llm_budget.py

  • LLMBackendLike.generate (method) core/llm_budget.py:61 def generate(self, prompt)
  • LLMBackendLike.stream_generate (method) core/llm_budget.py:63 def stream_generate(self, prompt)
  • LLMBackendLike.complete (method) core/llm_budget.py:65 def complete(self, system, user, max_tokens, temperature)
  • ModelPrice.from_mapping (method) core/llm_budget.py:81 def from_mapping(cls, data) -- Build a ModelPrice from a JSON friendly mapping.
  • BudgetLedger.record (method) core/llm_budget.py:232 def record(self, entry) -- Append a charge to the ledger and persist the new state.
  • BudgetLedger.spent_today (method) core/llm_budget.py:251 def spent_today(self) -- Return the dollar amount the ledger charged for the current day.
  • BudgetLedger.calls_today (method) core/llm_budget.py:256 def calls_today(self) -- Return the number of calls the ledger recorded for the current day.
  • BudgetLedger.reset (method) core/llm_budget.py:261 def reset(self) -- Clear the ledger for the current day and persist the empty state.
  • TokenEstimator.__init__ (method) core/llm_budget.py:278 def __init__(self, encoding_name)
  • TokenEstimator.count (method) core/llm_budget.py:292 def count(self, text) -- Return the number of tokens the input text contains.
  • BudgetGuard.__init__ (method) core/llm_budget.py:319 def __init__(self, config, estimator, ledger)
  • BudgetGuard.price_for (method) core/llm_budget.py:329 def price_for(self, model) -- Return the price the guard applies to a model identifier.
  • BudgetGuard.estimate_cost (method) core/llm_budget.py:343 def estimate_cost(self, model, input_tokens, output_tokens) -- Return the dollar cost the guard would charge for a call.
  • BudgetGuard.estimate_and_check (method) core/llm_budget.py:356 def estimate_and_check(self, prompt, model, output_tokens) -- Check the budget and record a charge when the call fits.
  • BudgetedBackend.__init__ (method) core/llm_budget.py:417 def __init__(self, inner, guard, model)
  • BudgetedBackend.generate (method) core/llm_budget.py:422 def generate(self, prompt) -- Forward a non streaming call and record a charge.
  • BudgetedBackend.stream_generate (method) core/llm_budget.py:430 def stream_generate(self, prompt) -- Forward a streaming call.
  • BudgetedBackend.complete (method) core/llm_budget.py:435 def complete(self, system, user, max_tokens, temperature) -- Forward a role aware call.
  • default_model_prices (function) core/llm_budget.py:442 def default_model_prices() -- Return the default price table the guard ships with.
  • default_sessions_dir (function) core/llm_budget.py:461 def default_sessions_dir() -- Return the directory the ledger writes to by default.
  • load_budget_config (function) core/llm_budget.py:552 def load_budget_config(payload, sessions_dir) -- Build a BudgetConfig from a payload mapping.
  • read_budget_status (function) core/llm_budget.py:585 def read_budget_status(payload, sessions_dir) -- Return a structured snapshot of the current budget.
  • format_budget_status (function) core/llm_budget.py:616 def format_budget_status(config, ledger) -- Render the budget status as a human readable block.
  • wrap_backend_with_budget (function) core/llm_budget.py:657 def wrap_backend_with_budget(backend, config, estimator, model, ledger) -- Wrap a concrete backend with a budgeted proxy.

core/logging.py

Imported by: cli/auto_crypto.py, cli/chain_mode.py, cli/reactive_hints.py, cli/recommendation_signals.py, cli/session_resumer.py, cli/tips_engine.py, contrib/legacy/lazydeepseekcli.py, contrib/legacy/lazygptcli.py, contrib/legacy/lazygptcli_unified.py, contrib/legacy/lazyhoneypot.py, contrib/legacy/lazyopenssh77enum2.py, contrib/legacy/lazyphishingai.py, contrib/legacy/lazysearch_bot.py, contrib/legacy/lazysmbrelay.py, contrib/legacy/lazyssh.py, core/config.py, core/credential_vault.py, core/executor.py, core/hardening.py, core/safe_exec.py, core/scheduler.py, core/security.py, lazy_sentinel4.py, lazyc2.py, lazyc2/blueprints/addons.py, lazyc2/blueprints/api.py, lazyc2/blueprints/api_v1.py, lazyc2/blueprints/auth.py, lazyc2/blueprints/beacon.py, lazyc2/blueprints/phishing.py, lazyc2/extensions/short_urls.py, lazyc2/extensions/storage.py, lazygui/app.py, lazygui/config/c2_credentials.py, lazygui/config/settings.py, lazygui/services/local_backend.py, lazygui/services/teamserver_backend.py, lazygui/theme/manager.py, lazyown.py, modules/agent_runner.py, modules/ai_model.py, modules/atomic_cli.py, modules/atomic_enricher.py, modules/atomic_exploit_bridge.py, modules/atomic_resolver.py, modules/auto_purple.py, modules/beacon_config_builder.py, modules/beacon_history.py, modules/bof_registry.py, modules/c2_agent.py, modules/c2_profile.py, modules/c2_profile_engine.py, modules/c2_surfaces.py, modules/chain_registry.py, modules/collab_bp.py, modules/command_executor.py, modules/compliance.py, modules/conditional_hooks.py, modules/config_store.py, modules/credential_reuse.py, modules/cve_matcher.py, modules/db.py, modules/detection_feed.py, modules/detection_oracle.py, modules/engagement_hooks.py, modules/estorides_importer.py, modules/event_bus.py, modules/event_consumers.py, modules/hash_cracker.py, modules/ia_code_analysis.py, modules/ia_logs_analysis.py, modules/ia_network_analysis.py, modules/icmp_server.py, modules/integrations/misp_export.py, modules/integrations/nuclei_bridge.py, modules/integrations/nuclei_parser.py, modules/integrations/searchsploit.py, modules/intelligence_engine.py, modules/killchain.py, modules/lazy_loop.py, modules/lazy_proxy.py, modules/lazy_rbac.py, modules/lazyownerweb.py, modules/lesson_ingestor.py, modules/lilsplunky.py, modules/llm_adapter.py, modules/llm_client.py, modules/logging_config.py, modules/mcp_agent_bridge.py, modules/metrics.py, modules/module_registry.py, modules/moe_router.py, modules/obs_parser.py, modules/operation.py, modules/operator_profiles.py, modules/opsec_scorer.py, modules/pipeline_engine.py, modules/planner.py, modules/playbook_engine.py, modules/reactive_engine.py, modules/rl_trainer.py, modules/session_rag.py, modules/sleep_obfuscation.py, modules/socks_proxy.py, modules/state_manager.py, modules/sudo_tiocsti.py, modules/threat_model.py, modules/toposwarm_bridge.py, modules/ttp_coverage.py, modules/ttpscope_bridge.py, modules/unified_bridge.py, modules/unified_dashboard.py, modules/vulnbot.py, modules/world_model.py, skills/aci_planner.py, skills/autonomous_daemon.py, skills/autonomous_replay.py, skills/hive_mind.py, skills/lazyown_automapper.py, skills/lazyown_campaign.py, skills/lazyown_daemon.py, skills/lazyown_facts.py, skills/lazyown_llm.py, skills/lazyown_mcp.py, skills/lazyown_parquet_db.py, skills/lazyown_policy.py, skills/sessions_watcher.py, skills/swan_agent.py, skills/toposwarm_autonomous.py, skills/update_knowledge.py, tests/test_logging_config.py, tests/test_security_codeql_batch.py, tests/test_structured_logging.py

  • _JsonLineFormatter.__init__ (method) core/logging.py:74 def __init__(self, redacted_fields)
  • _JsonLineFormatter.format (method) core/logging.py:78 def format(self, record)
  • _ConsoleFormatter.format (method) core/logging.py:132 def format(self, record)
  • StructuredLogger.makeRecord (method) core/logging.py:148 def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func, extra, sinfo)
  • get_logger (function) core/logging.py:231 def get_logger(name) -- Return a cached :class:StructuredLogger for name.
  • install_json_handler (function) core/logging.py:251 def install_json_handler(name, config) -- Install a JSON-lines file handler on name, preserving existing handlers.
  • reconfigure (function) core/logging.py:300 def reconfigure(config) -- Replace the cached configuration globally.

core/network.py

Depends on: core/console.py Imported by: core/__init__.py

  • parse_ip_mac (function) core/network.py:18 def parse_ip_mac(input_string) -- Extract IP and MAC from a formatted string.
  • create_arp_packet (function) core/network.py:33 def create_arp_packet(src_mac, src_ip, dst_ip, dst_mac) -- Build a raw ARP request/reply packet.
  • send_packet (function) core/network.py:66 def send_packet(packet, iface) -- Send a raw packet on a given network interface.
  • parse_proc_net_file (function) core/network.py:78 def parse_proc_net_file(file_path) -- Parse a /proc/net/* file and extract (ip, port) pairs.
  • get_open_ports (function) core/network.py:105 def get_open_ports() -- Discover listening TCP ports from /proc/net/tcp and tcp6.
  • is_port_in_use (function) core/network.py:120 def is_port_in_use(port, host) -- Check whether a TCP port is already bound.
  • get_banner (function) core/network.py:134 def get_banner(ip, port) -- Grab a TCP banner from the given host and port.
  • get_network_info (function) core/network.py:154 def get_network_info() -- Collect local network information.

core/parsers.py

Imported by: cli/banner_config.py, core/__init__.py, discord_c2.py, lazyc2.py, slack_c2_bot.py, telegram_c2.py, telegram_hermes.py, tests/test_single_implementation.py, utils.py

  • strip_ansi (function) core/parsers.py:15 def strip_ansi(text) -- Remove ANSI escape sequences and readline markers from a string.

core/payload_schema.py

Depends on: cli/commands/enum.py, modules/llm_factory.py Imported by: cli/assign.py, cli/commands/session_ops.py, cli/wizard.py, core/__init__.py, core/config.py, scripts/devtools/core_smoke.py, skills/lazyown_mcp.py, tests/test_core_config.py, tests/test_core_defaults.py, tests/test_infra_disposable.py, tests/test_payload_schema.py, tests/test_placeholder_coverage.py

  • field_for (function) core/payload_schema.py:1582 def field_for(key) -- Return the :class:FieldSpec for key or None if it is unknown.
  • coerce_value (function) core/payload_schema.py:1587 def coerce_value(key, raw) -- Return raw coerced to the canonical type declared for key.
  • validate_value (function) core/payload_schema.py:1610 def validate_value(key, value) -- Validate value against the schema entry for key.
  • validate_payload (function) core/payload_schema.py:1684 def validate_payload(payload) -- Validate an entire payload dictionary and return all issues found.
  • format_issue (function) core/payload_schema.py:1719 def format_issue(issue) -- Render a :class:ValidationIssue as a single human-readable line.
  • default_payload (function) core/payload_schema.py:1737 def default_payload() -- Return a freshly built payload dict populated from the schema defaults.
  • categories (function) core/payload_schema.py:1745 def categories() -- Return schema entries grouped by :attr:FieldSpec.category.

core/process.py

Depends on: core/console.py, core/hardening.py, core/safe_exec.py, core/safe_subprocess.py, core/validators.py Imported by: cli/commands/lazyops.py, cli/commands/misc_migrated.py, cli/commands/mobile_macos.py, core/__init__.py, modules/auto_purple.py, modules/lazy_loop.py, static/js/particles.js, static/js/vis-network-9.1.2.min.js, static/js/vis-network.min.js, tests/test_lazy_runner.py, tests/test_shell_semantics.py, utils.py

  • check_go_tool_installed (function) core/process.py:34 def check_go_tool_installed(tool_name) -- Check if a Go tool binary is installed and runnable.
  • is_binary_present (function) core/process.py:54 def is_binary_present(binary_name) -- Check whether binary is on PATH.
  • handle_multiple_rhosts (function) core/process.py:68 def handle_multiple_rhosts(func) -- Decorator that iterates over a list of remote hosts.
  • wrapper (function) core/process.py:82 def wrapper(self)
  • check_sudo (function) core/process.py:97 def check_sudo() -- Re-launch the script with sudo if not already root.
  • run (function) core/process.py:108 def run(command) -- Execute a shell command via SafeRunner.
  • is_package_installed (function) core/process.py:143 def is_package_installed(package_name) -- Check whether a Python package is importable.
  • run_command (function) core/process.py:183 def run_command(command, timeout) -- Run a command, streaming output in real time.
  • ensure_tmux_session (function) core/process.py:253 def ensure_tmux_session(session_name) -- Create a tmux session if it does not already exist.
  • activate_server (function) core/process.py:271 def activate_server(httpd, url, lhost) -- Start an HTTP server and print the serving URL.

core/profiles.py

Imported by: cli/doctor.py, cli/wizard.py, tests/test_profiles.py

  • active_profile (function) core/profiles.py:40 def active_profile() -- Return the selected runtime profile.
  • is_light (function) core/profiles.py:59 def is_light() -- Return True when the light profile is selected.
  • specs_for_profile (function) core/profiles.py:64 def specs_for_profile(specs) -- Filter dependency specs down to the ones the active profile needs.

core/prompt.py

Depends on: core/config.py Imported by: contrib/legacy/lazybinenc.py, key.py, static/js/quill-2.0.3.js

  • get_git_info (function) core/prompt.py:35 def get_git_info() -- Return current git branch and dirty-status for the prompt.
  • get_venv_info (function) core/prompt.py:60 def get_venv_info() -- Return the active virtualenv name, or empty string if none.
  • get_kernel (function) core/prompt.py:68 def get_kernel() -- Return the running kernel version (short form).
  • get_terminal_size (function) core/prompt.py:78 def get_terminal_size() -- Return (width, height) of the terminal, defaulting to 80x24.
  • get_local_ips (function) core/prompt.py:87 def get_local_ips() -- Return a comma-separated string of non-loopback IPv4 addresses.
  • copy2clip (function) core/prompt.py:109 def copy2clip(text) -- Copy text to the system clipboard via xclip.
  • getprompt (function) core/prompt.py:127 def getprompt() -- Build the coloured status line for the CLI header and C2 dashboard.

core/protocols.py

Imported by: tests/test_core.py

  • Selector.suggest (method) core/protocols.py:27 def suggest(self, target, phase, context) -- Return {"command": str, "reasoning": str, "mitre": str} or None.
  • LLMBackend.complete (method) core/protocols.py:40 def complete(self, system, user, max_tokens, temperature) -- Return the model completion as a string.
  • MemoryStore.put (method) core/protocols.py:54 def put(self, key, value)
  • MemoryStore.get (method) core/protocols.py:56 def get(self, key, default)
  • MemoryStore.search (method) core/protocols.py:58 def search(self, query, k)
  • BridgeCatalog.filter (method) core/protocols.py:65 def filter(self, phase, os_id) -- Return command entries matching phase and os_id.
  • OutcomeEvaluator.evaluate (method) core/protocols.py:73 def evaluate(self, command, output, target, phase) -- Return a reward in [0.0, 1.0].

core/reverse_shell_secret.py

Depends on: core/hardening.py Imported by: lazyc2.py, tests/test_security_alerts_fix.py

  • seal_reverse_shell_password (function) core/reverse_shell_secret.py:24 def seal_reverse_shell_password(plaintext) -- Seal a fallback password for storage.
  • load_reverse_shell_password (function) core/reverse_shell_secret.py:41 def load_reverse_shell_password(secret_path) -- Load a persisted fallback password, unsealing vault values.
  • generate_reverse_shell_password (function) core/reverse_shell_secret.py:65 def generate_reverse_shell_password() -- Generate a fresh cryptographically random fallback password.
  • is_configured_password_valid (function) core/reverse_shell_secret.py:74 def is_configured_password_valid(candidate, minimum_length) -- Return True when an operator-configured password meets the floor.

core/safe_console.py

Depends on: core/console.py Imported by: cli/autosuggest.py, cli/ops_commands.py, cli/tips_engine.py, modules/loop_progress.py, tests/test_safe_console.py

  • supports_unicode (function) core/safe_console.py:33 def supports_unicode() -- Return True when stdout can encode box-drawing glyphs and emoji.
  • get_console (function) core/safe_console.py:42 def get_console() -- Build a Rich console with safe color/box defaults.
  • panel_box (function) core/safe_console.py:52 def panel_box() -- Return the ROUNDED box on UTF-8 sinks, ASCII otherwise.
  • milestone_glyph (function) core/safe_console.py:57 def milestone_glyph(state) -- Glyph for a milestone state: done / active / pending (or other).
  • progress_bar (function) core/safe_console.py:67 def progress_bar(ratio, width) -- Fixed-width fill bar, unicode blocks or ASCII hashes.

core/safe_exec.py

Depends on: core/logging.py Imported by: cli/banner_config.py, cli/commands/misc_migrated.py, cli/commands/pwn.py, cli/commands/shellsys.py, core/process.py, core/safe_subprocess.py, lazyc2/blueprints/api_v1.py, modules/atomic_exploit_bridge.py, modules/atomic_resolver.py, modules/autonomous_exploit_engine.py, modules/command_executor.py, modules/conditional_hooks.py, modules/dns_beacon.py, modules/playbook_engine.py, modules/resource_script.py, modules/ttpscope_bridge.py, tests/test_atomic_exploit_bridge.py, tests/test_executor_kernel.py, tests/test_security_hardening_v4.py, tests/test_shell_semantics.py

  • needs_shell (function) core/safe_exec.py:52 def needs_shell(command) -- Return True when a command string needs a shell to be interpreted.
  • safe_system (function) core/safe_exec.py:69 def safe_system(command) -- Execute a fixed command string through the shell safely.
  • safe_run_argv (function) core/safe_exec.py:106 def safe_run_argv(argv) -- Execute a command via subprocess without shell interpretation.
  • safe_run_shell (function) core/safe_exec.py:146 def safe_run_shell(command) -- Execute a command through the shell, gated by policy.
  • safe_clear_screen (function) core/safe_exec.py:192 def safe_clear_screen() -- Clear the terminal screen without using os.system.
  • validate_url (function) core/safe_exec.py:207 def validate_url(url) -- Validate a URL string, rejecting shell metacharacters.
  • safe_git_clone (function) core/safe_exec.py:234 def safe_git_clone(repo_url, target_dir) -- Clone a git repository safely using subprocess list-form.
  • safe_ip_show (function) core/safe_exec.py:268 def safe_ip_show(interface) -- Parse IP addresses from ip show output in Python.
  • safe_find_tool (function) core/safe_exec.py:305 def safe_find_tool(name) -- Find a tool on PATH using shutil.which.
  • safe_file_read (function) core/safe_exec.py:321 def safe_file_read(path) -- Read a file safely with a size limit.

core/safe_import.py

Imported by: cli/commands/campaign.py, tests/test_campaign_import_safety.py

  • is_safe_identifier (function) core/safe_import.py:20 def is_safe_identifier(name) -- Return True when name is a bare SQL identifier.
  • filter_columns (function) core/safe_import.py:32 def filter_columns(src_columns, dest_columns) -- Intersect source columns with destination columns, safely.
  • safe_extract_zip (function) core/safe_import.py:51 def safe_extract_zip(archive, dest) -- Extract a zip archive with ZipSlip protection.
  • safe_copy_tree (function) core/safe_import.py:93 def safe_copy_tree(src, dest) -- Copy a directory tree without symlink escape.

core/safe_subprocess.py

Depends on: core/hardening.py, core/safe_exec.py Imported by: core/process.py, tests/test_safe_subprocess.py, tests/test_safe_subprocess_behavior.py, tests/test_security_hardening.py, tests/test_shell_semantics.py, utils.py

core/scheduler.py

Depends on: core/logging.py

  • TaskScheduler.__init__ (method) core/scheduler.py:61 def __init__(self)
  • TaskScheduler.instance (method) core/scheduler.py:73 def instance(cls) -- Return the singleton TaskScheduler instance.
  • TaskScheduler.start (method) core/scheduler.py:81 def start(self) -- Start the scheduler background thread.
  • TaskScheduler.stop (method) core/scheduler.py:100 def stop(self) -- Stop the scheduler and cancel all pending tasks.
  • TaskScheduler.schedule_task (method) core/scheduler.py:123 def schedule_task(self, name, interval_seconds, func) -- Register a recurring task to run every interval_seconds.
  • TaskScheduler.schedule_once (method) core/scheduler.py:157 def schedule_once(self, name, delay_seconds, func) -- Register a one-shot task to run after delay_seconds.
  • TaskScheduler.cancel_task (method) core/scheduler.py:192 def cancel_task(self, name) -- Cancel a scheduled task by name.
  • TaskScheduler.list_tasks (method) core/scheduler.py:205 def list_tasks(self) -- Return metadata for all registered tasks.
  • get_scheduler (function) core/scheduler.py:285 def get_scheduler() -- Return the singleton TaskScheduler instance.

core/security.py

Depends on: core/logging.py

  • anti_debug (function) core/security.py:18 def anti_debug() -- Check for debugger attachment and exit if found.
  • generate_certificates (function) core/security.py:58 def generate_certificates(output_dir) -- Generate a self-signed CA certificate and key pair.

core/terminal_guard.py

Imported by: modules/lazy_runner.py, tests/test_lazy_runner.py

  • emit_restore_sequences (function) core/terminal_guard.py:41 def emit_restore_sequences() -- Write the mode-reset sequences to the controlling terminal.
  • apply_stty_sane (function) core/terminal_guard.py:62 def apply_stty_sane() -- Best-effort stty sane fallback when termios restore fails.
  • TerminalGuard.__init__ (method) core/terminal_guard.py:85 def __init__(self) -- Prepare an empty guard; the snapshot happens on __enter__.
  • TerminalGuard.restore (method) core/terminal_guard.py:108 def restore(self) -- Restore saved termios, then reset extra terminal modes once.

core/text_utils.py

Imported by: cli/autosuggest.py, cli/graph_overlay.py, cli/palette_command.py, cli/palette_overlay.py, cli/reactive_hints.py, cli/reasoning_stream.py, cli/tips_engine.py, cli/toast_bus.py

  • truncate_text (function) core/text_utils.py:10 def truncate_text(value, max_len, marker) -- Truncate value to max_len using marker.

core/validators.py

Depends on: core/console.py, core/host_policy.py Imported by: cli/commands/_base.py, cli/commands/enum.py, cli/commands/mobile_macos.py, cli/commands/pwn.py, core/__init__.py, core/process.py, modules/c2_builder.py, tests/test_core.py, tests/test_host_policy.py, tests/test_input_fuzz.py, tests/test_require_guards.py, utils.py

  • check_rhost (function) core/validators.py:26 def check_rhost(rhost) -- Return True if rhost is set, otherwise print an error and return False.
  • check_lhost (function) core/validators.py:40 def check_lhost(lhost) -- Return True if lhost is set, otherwise print an error and return False.
  • check_lport (function) core/validators.py:54 def check_lport(lport) -- Return True if lport is set, otherwise print an error and return False.
  • check_port (function) core/validators.py:64 def check_port(port, name) -- Return True if port is a valid TCP/UDP port (1-65535).
  • require_rhost (function) core/validators.py:77 def require_rhost(params) -- Gate a command on a valid rhost looked up from params.
  • require_lhost (function) core/validators.py:94 def require_lhost(params) -- Gate a command on a valid lhost looked up from params.
  • require_lport (function) core/validators.py:107 def require_lport(params) -- Gate a command on a valid lport looked up from params.
  • require_rport (function) core/validators.py:120 def require_rport(params) -- Gate a command on a valid rport looked up from params.

deploy/range/ad-mini/traffic-gen.py

discord_c2.py

Depends on: core/parsers.py, lazyown.py, modules/llm_adapter.py

external/install_external.sh

Next: API_p7.md