Skip to content

Agent API_p16

grisun0 edited this page Oct 26, 2026 · 34 revisions

API (page 16 of 24)

Previous: API_p15.md

modules/notify.py

Imported by: modules/custom_tools.py, modules/lazy_loop.py, skills/autonomous_daemon.py, static/js/chart.min.js, tests/test_autonomous_ops.py, tests/test_lazy_loop.py, tests/test_security_codeql_batch.py

  • severity_rank (function) modules/notify.py:31 def severity_rank(severity, config) -- Return the comparable order for a severity label.
  • mask_secrets (function) modules/notify.py:39 def mask_secrets(text, config) -- Replace known secret prefixes with a redaction marker.
  • url_allowed (function) modules/notify.py:57 def url_allowed(url) -- SSRF dial-guard for webhook delivery (LAZY parity).
  • post_url_validated (function) modules/notify.py:145 def post_url_validated(url, data, timeout) -- POST data to a webhook URL after SSRF validation, guarding redirects.
  • _GuardRedirect.redirect_request (method) modules/notify.py:159 def redirect_request(self, req, fp, code, msg, headers, newurl)
  • Notifier.__init__ (method) modules/notify.py:207 def __init__(self, config) -- Initialize with shared notification constants.
  • Notifier.should_send (method) modules/notify.py:215 def should_send(self, message, channel) -- Apply event, severity, keyword and scope gates (LAZY parity).
  • Notifier.render (method) modules/notify.py:238 def render(self, message) -- Render masked Markdown text for a message.
  • Notifier.dispatch (method) modules/notify.py:244 def dispatch(self, message, channels) -- Fan out to eligible channels and journal deliveries.
  • Notifier.flush_digest (method) modules/notify.py:260 def flush_digest(self, max_age_sec) -- Emit one digest per channel when due (default 30m, LAZY parity).

modules/nuclei_templates_sync.py

modules/obs_parser.py

Depends on: cli/commands/enum.py, core/logging.py Imported by: modules/intelligence_engine.py, modules/operation.py, modules/planner.py, modules/playbook_engine.py, modules/sinks/world_model.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/integration_autonomous_flow.py, tests/test_core_modules.py, tests/test_daemon_loop.py, tests/test_phase1_data_gaps.py

modules/operation.py

Depends on: cli/commands/enum.py, core/logging.py, modules/apt_playbooks.py, modules/obs_parser.py, modules/playbook_engine.py, modules/world_model.py Imported by: cli/commands/caldera.py

modules/operator_profiles.py

Depends on: core/config.py, core/logging.py Imported by: cli/commands/automation.py

modules/opsec_scorer.py

Depends on: cli/commands/enum.py, core/config.py, core/logging.py, modules/db.py, modules/killchain.py Imported by: cli/commands/opsec_cleanup.py, cli/commands/security.py, tests/test_opsec_scorer.py, tests/test_opsec_scorer_consolidated.py

modules/orchestrator_config.py

Depends on: core/config.py, core/logging.py, modules/auto_registry.py, modules/trigger_policy.py, modules/verb_catalog.py Imported by: cli/commands/lazyops.py, cli/lazy_orchestrator.py, cli/orchestrator_assets_tabs.py, lazyc2/blueprints/orchestrator.py, modules/auto_registry.py, modules/defense_stages.py, modules/harness.py, modules/lazy_loop.py, modules/loop_ai_bridge.py, modules/trigger_policy.py, skills/lazyown_mcp_opencode.py, tests/test_harness_mode.py, tests/test_lazy_orchestrator.py, tests/test_orchestrator_api.py, tests/test_orchestrator_yaml.py, tests/test_outcome_bus.py

modules/osint_enrich.py

Imported by: modules/finding_lifecycle.py, tests/test_finding_lifecycle.py

  • cve_lookup (function) modules/osint_enrich.py:122 def cve_lookup(cve_id, sessions_dir) -- Assemble OSV advisory + KEV flag + EPSS score for one CVE id.
  • reverse_dns (function) modules/osint_enrich.py:161 def reverse_dns(ip, sessions_dir) -- Best-effort PTR hostname for an IP (HackerTarget, then DoH).
  • host_geo (function) modules/osint_enrich.py:183 def host_geo(ip, sessions_dir) -- Country/org/ISP for an IP via the keyless ip-api endpoint.
  • domain_exposure (function) modules/osint_enrich.py:198 def domain_exposure(domain, sessions_dir) -- Count public urlscan.io results for a domain (no key needed).
  • enrich_evidence (function) modules/osint_enrich.py:213 def enrich_evidence(items, sessions_dir) -- Append keyless OSINT verdicts to CVE mentions inside evidence items.

modules/outcome_bus.py

Depends on: core/logging.py, modules/__init__.py Imported by: cli/commands/command_and_control_migrated.py, modules/atomic_exploit_bridge.py, modules/autonomous_exploit_engine.py, modules/beacon_recon.py, modules/ctf_capture.py, modules/emulation_runner.py, modules/exploit_chain.py, modules/lazy_loop.py, modules/redteam_gym.py, modules/sinks/attack_graph.py, modules/sinks/c2_surfaces.py, modules/sinks/campaign_db.py, modules/sinks/event_bus.py, modules/sinks/intel_graph.py, modules/sinks/killchain.py, modules/sinks/objectives.py, modules/sinks/routing.py, modules/sinks/world_model.py, tests/test_beacon_recon_sink.py, tests/test_gym_cli.py, tests/test_gym_lifecycle.py, tests/test_gym_registry.py, tests/test_lazy_orchestrator.py, tests/test_outcome_bus.py

modules/payload_factory.py

Imported by: cli/commands/misc_migrated.py, cli/commands/payload_generation.py, cli/commands/session_ops.py, lazyown.py, scripts/devtools/core_smoke.py, tests/test_payload_factory.py

modules/phishing_orchestrator.py

Depends on: core/crypto.py, core/hardening.py Imported by: cli/commands/phishing_wizard.py, tests/test_security_hardening_v3.py, tests/test_security_hardening_v5.py

modules/pipeline_engine.py

Depends on: core/logging.py, modules/engagement_hooks.py, skills/autonomous_daemon.py Imported by: cli/commands/session_ops.py, modules/playbook_executor.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/test_pipeline_engine.py

modules/planner.py

Depends on: core/logging.py, modules/llm_client.py, modules/obs_parser.py, modules/playbook_engine.py, modules/world_model.py Imported by: cli/commands/caldera.py, cli/commands/session_ops.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/test_autonomous_ops.py, tests/test_daemon_loop.py, tests/test_engage_gates.py, tests/test_lazy_parity.py

  • Planner.__init__ (method) modules/planner.py:269 def __init__(self, world_model, obs_parser, api_key)
  • Planner.plan (method) modules/planner.py:313 def plan(self, target, max_candidates) -- Return a ranked list of next-step candidates for target.
  • Planner.to_dict (method) modules/planner.py:413 def to_dict(self, result)
  • get_planner (function) modules/planner.py:446 def get_planner(api_key) -- Return a fact-based planner with an optional LLM tie-break key.
  • TodoList.__init__ (method) modules/planner.py:468 def __init__(self) -- Initialize an empty todo sequence.
  • TodoList.todo_add (method) modules/planner.py:472 def todo_add(self, name, requires) -- Append a step and return it.
  • TodoList.todo_done (method) modules/planner.py:478 def todo_done(self, name) -- Mark a step done when its requirements hold.
  • TodoList.next_ready (method) modules/planner.py:489 def next_ready(self) -- Return the first pending step whose requirements hold.
  • TodoList.blocks (method) modules/planner.py:497 def blocks(self, tactic) -- Return True when a tactic must wait for an unfinished chain.
  • Frontier.__init__ (method) modules/planner.py:514 def __init__(self, planner, todos) -- Bind the frontier to a planner and an optional todo list.
  • Frontier.todos (method) modules/planner.py:523 def todos(self) -- Expose the shared todo list.
  • Frontier.tried (method) modules/planner.py:528 def tried(self) -- Return the tried technique identifiers.
  • Frontier.refill (method) modules/planner.py:532 def refill(self, target, max_intents) -- Plan fresh intents, keeping only untried and unblocked ones.
  • Frontier.pop (method) modules/planner.py:551 def pop(self) -- Claim the oldest queued intent and mark its technique tried.

modules/playbook_admin.py

Imported by: cli/orchestrator_assets_tabs.py, tests/test_playbook_admin.py

modules/playbook_engine.py

Depends on: core/logging.py, core/safe_exec.py, modules/emulation_runner.py, modules/llm_client.py, modules/obs_parser.py, modules/world_model.py Imported by: cli/commands/caldera.py, cli/commands/mcp_bridge.py, modules/operation.py, modules/planner.py, skills/lazyown_mcp.py, tests/test_core_modules.py

modules/playbook_executor.py

Depends on: modules/pipeline_engine.py

modules/polymorphic_engine.py

Imported by: cli/commands/payload_arsenal.py

modules/privesc_predictor.py

Depends on: core/console.py, modules/llm_factory.py Imported by: cli/commands/crystal_ball.py

modules/professional_report.py

Depends on: modules/llm_factory.py, modules/world_model.py Imported by: tests/test_bdd_infra_range_report.py, tests/test_gym_matrix_ctf.py, tests/test_infra_disposable.py

  • RedTeamReportGenerator.__init__ (method) modules/professional_report.py:173 def __init__(self, include_credentials)
  • RedTeamReportGenerator.collect_data (method) modules/professional_report.py:179 def collect_data(self) -- Collect all available engagement data from sessions directory.
  • RedTeamReportGenerator.classify_findings (method) modules/professional_report.py:219 def classify_findings(self, data) -- Classify collected data into structured findings.
  • RedTeamReportGenerator.generate (method) modules/professional_report.py:247 def generate(self, output_dir, output_format, client_name, engagement_type, with_ai, ai_backend) -- Generate the report in the specified format.
  • RedTeamReportGenerator.collect_command_history (method) modules/professional_report.py:912 def collect_command_history(self, max_entries) -- Collect operator command history for the engagement timeline.
  • RedTeamReportGenerator.collect_loot_summary (method) modules/professional_report.py:936 def collect_loot_summary(self) -- Summarize exfiltrated loot without embedding sensitive content.
  • RedTeamReportGenerator.generate_executive_summary (method) modules/professional_report.py:982 def generate_executive_summary(self, data, with_ai, ai_backend) -- Build the executive summary in business language.

modules/r.sh

Imported by: static/js/quill-2.0.3.js::c, static/js/quill-2.0.3.js::h, static/js/quill-2.0.3.js::i, static/js/quill-2.0.3.js::o, static/js/quill-2.0.3.js::s, static/js/quill-2.0.3.js::u, static/js/xterm.js::a, static/js/xterm.js::n, static/js/xterm.js::o

  • download_kernel_sources (function) modules/r.sh:10 -- Función para descargar y extraer las fuentes del kernel

modules/reaction_bridge.py

Depends on: modules/lazy_loop.py Imported by: modules/lazy_loop.py, tests/test_reaction_bridge.py

  • ReactionPick.__init__ (method) modules/reaction_bridge.py:69 def __init__(self, command, reason, priority, mitre)
  • save_decisions (function) modules/reaction_bridge.py:80 def save_decisions(task_id, decisions) -- Park picks into the per-task buffer; returns the saved count.
  • load_reaction_triggers (function) modules/reaction_bridge.py:108 def load_reaction_triggers(task_id, consumer) -- Drain the buffer into planner trigger dicts (one-shot, one per round).
  • find_credentials (function) modules/reaction_bridge.py:159 def find_credentials(output) -- Extract user:pass pairs and hashes; placeholder values are dropped.

modules/reactive_engine.py

Depends on: core/config.py, core/logging.py, modules/session_rag.py Imported by: cli/apt_chain_support.py, modules/lazy_loop.py, skills/autonomous_daemon.py, skills/lazyown_groq_agents.py, skills/lazyown_mcp.py, skills/toposwarm_autonomous.py, tests/test_core_modules.py, tests/test_reactive_engine_semantic.py, tests/test_reactive_lateral_data.py

modules/recommender.py

Depends on: modules/ai_fallback.py, modules/session_state.py Imported by: skills/lazyown_mcp.py

  • recommend (function) modules/recommender.py:143 def recommend(state, api_key) -- Return ranked recommendations without writing to disk.
  • recommend_and_save (function) modules/recommender.py:163 def recommend_and_save(api_key) -- Build state → call Groq → write JSON → return recommendations.

modules/redteam_gym.py

Depends on: cli/engagement_hooks.py, core/config.py, modules/__init__.py, modules/atomic_exploit_bridge.py, modules/cli_auth.py, modules/gym_registry.py, modules/outcome_bus.py, modules/world_model.py Imported by: cli/commands/redteam_gym.py, cli/lazy_orchestrator.py, cli/orchestrator_assets_tabs.py, modules/exploitgym_gym.py, tests/test_gym_cli.py, tests/test_gym_registry.py, tests/test_infra_disposable.py, tests/test_lazy_orchestrator.py

  • reload_challenge_definitions (function) modules/redteam_gym.py:299 def reload_challenge_definitions(directory) -- Reload YAML definitions, falling back to the embedded catalogue.
  • definition_rows (function) modules/redteam_gym.py:393 def definition_rows() -- Return one row per gym YAML file, including invalid files.
  • create_gym (function) modules/redteam_gym.py:398 def create_gym(gym_id) -- Create a gym definition YAML and reload the catalogue.
  • save_gym_yaml (function) modules/redteam_gym.py:435 def save_gym_yaml(gym_id, text) -- Validate and persist raw YAML for one gym definition.
  • delete_gym (function) modules/redteam_gym.py:445 def delete_gym(gym_id) -- Delete one gym definition unless it has active runs.
  • list_challenges (function) modules/redteam_gym.py:453 def list_challenges() -- Return all defined gym challenges with metadata.
  • start_challenge (function) modules/redteam_gym.py:494 def start_challenge(challenge_id, target, spin_lab) -- Begin a gym challenge and persist the run in the world model.
  • submit_challenge (function) modules/redteam_gym.py:610 def submit_challenge(techniques_used, success, run_id) -- Submit a completed challenge for scoring.
  • stop_challenges (function) modules/redteam_gym.py:718 def stop_challenges(selector) -- Stop one gym by id/name/run id, or every gym when selector is empty.
  • engagement_context (function) modules/redteam_gym.py:804 def engagement_context(target) -- Return in-scope phase, compromised hosts and live shells.
  • get_active_challenges (function) modules/redteam_gym.py:864 def get_active_challenges() -- Return every active gym run across operators.
  • show_leaderboard (function) modules/redteam_gym.py:1023 def show_leaderboard(top_n) -- Return the top N players from the leaderboard.
  • get_active_challenge (function) modules/redteam_gym.py:1050 def get_active_challenge(run_id) -- Return one active challenge, preferring the current operator.
  • record_external_attempt (function) modules/redteam_gym.py:1081 def record_external_attempt(challenge_id, success, elo_bonus, techniques) -- Record a scored attempt for a challenge not defined in the catalog.
  • main (function) modules/redteam_gym.py:1135 def main() -- CLI entry point — show gym leaderboard from command line.

modules/reflective_dll.py

modules/resource_script.py

Depends on: core/safe_exec.py Imported by: cli/commands/resource_scripting.py, tests/test_resource_script.py, tests/test_security_hardening_v3.py

modules/retry_session.py

Depends on: modules/chain_state.py Imported by: cli/retry_support.py, tests/test_codeql_alert_fixes.py, tests/test_retry_session.py

  • is_active (function) modules/retry_session.py:56 def is_active() -- Return True when an elevated retry session is currently armed.
  • secret_enabled_path (function) modules/retry_session.py:61 def secret_enabled_path() -- Return the askpass helper path advertised via SUDO_ASKPASS.
  • sudo_gate_open (function) modules/retry_session.py:79 def sudo_gate_open() -- Return True when armed and the on-disk askpass pair is sound.
  • set_sudo_secret (function) modules/retry_session.py:94 def set_sudo_secret(secret) -- Arm the elevated retry session with one secret.
  • clear_sudo_secret (function) modules/retry_session.py:125 def clear_sudo_secret() -- Disarm the elevated retry session and wipe the secret from disk.
  • apply_sudo_askpass (function) modules/retry_session.py:137 def apply_sudo_askpass(command) -- Rewrite bare sudo tokens to sudo -A for one command.
  • newest_failed_checkpoint (function) modules/retry_session.py:180 def newest_failed_checkpoint(chain, run_id) -- Return the freshest unfinished checkpoint of one chain.
  • resolve_sudo_consent (function) modules/retry_session.py:204 def resolve_sudo_consent(confirmer, want_sudo) -- Gate the elevated mode behind an explicit, warned confirmation.

modules/reverse-shell.c

  • reverse_shell_init (function) modules/reverse-shell.c:12 static int __init reverse_shell_init(void) -- call_usermodehelper function is used to create user mode processes from kernel space
  • reverse_shell_exit (function) modules/reverse-shell.c:16 static void __exit reverse_shell_exit(void)

modules/revshell.c

modules/rich_tui.py

Depends on: core/console.py, modules/dashboard_engine.py Imported by: cli/commands/pwn.py

  • RichDashboard.__init__ (method) modules/rich_tui.py:74 def __init__(self, dashboard_engine, refresh_interval, live) -- Initialize the Rich dashboard.
  • RichDashboard.run (method) modules/rich_tui.py:96 def run(self) -- Run the dashboard.
  • RichDashboard.stop (method) modules/rich_tui.py:132 def stop(self) -- Gracefully shut down the dashboard and restore terminal state.

Next: API_p17.md

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally