Agent API_p15 - grisuno/LazyOwn GitHub Wiki

API (page 15 of 23)

Previous: API_p14.md

modules/metrics.py

Depends on: core/logging.py Imported by: lazyc2.py, lazyown.py, modules/c2_builder.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/test_metrics.py

  • MetricsRegistry.__init__ (method) modules/metrics.py:63 def __init__(self) -- Create an empty registry with its own lock.
  • MetricsRegistry.inc (method) modules/metrics.py:69 def inc(self, name, labels, value) -- Increment the named counter for the given labels.
  • MetricsRegistry.get (method) modules/metrics.py:87 def get(self, name, labels) -- Return the current value of a counter.
  • MetricsRegistry.prometheus_text (method) modules/metrics.py:107 def prometheus_text(self) -- Render every counter in Prometheus text exposition format.
  • MetricRecord.to_dict (method) modules/metrics.py:167 def to_dict(self) -- Return the record as a JSON-serialisable dictionary.
  • MetricsWriter.__init__ (method) modules/metrics.py:189 def __init__(self, path) -- Initialise the writer.
  • MetricsWriter.path (method) modules/metrics.py:201 def path(self) -- Return the JSONL destination path.
  • MetricsWriter.append (method) modules/metrics.py:206 def append(self, record) -- Append a single record to disk.
  • MetricsAggregator.summarize (method) modules/metrics.py:254 def summarize(cls, records, window_seconds, now_utc) -- Compute aggregate statistics over the supplied records.
  • MetricsRecorder.__init__ (method) modules/metrics.py:339 def __init__(self, writer) -- Initialise the recorder.
  • MetricsRecorder.path (method) modules/metrics.py:350 def path(self) -- Return the JSONL path used by the underlying writer.
  • MetricsRecorder.record (method) modules/metrics.py:355 def record(self, command, args, duration_ms, success, exit_code, source) -- Persist a single command-execution telemetry record.
  • MetricsRecorder.summarize (method) modules/metrics.py:416 def summarize(self, window_seconds) -- Return aggregate statistics over recorded events.
  • MetricsRecorder.tail (method) modules/metrics.py:430 def tail(self, n) -- Return the most recent n records, newest first.
  • get_recorder (function) modules/metrics.py:452 def get_recorder() -- Return the process-wide :class:MetricsRecorder singleton.
  • reset_recorder_for_tests (function) modules/metrics.py:466 def reset_recorder_for_tests(writer) -- Replace the module-level recorder with a fresh instance.

modules/mfa_bypass.py

Imported by: cli/commands/cicd.py

  • MFABypassEngine.__init__ (method) modules/mfa_bypass.py:128 def __init__(self, sessions_dir)
  • MFABypassEngine.enumerate_techniques (method) modules/mfa_bypass.py:133 def enumerate_techniques(self, target) -- Enumerate viable MFA bypass techniques for a given target.
  • MFABypassEngine.generate_phishing_templates (method) modules/mfa_bypass.py:153 def generate_phishing_templates(self, target) -- Generate phishing templates tailored for MFA bypass.
  • MFABypassEngine.mfa_conditional_access_scan (method) modules/mfa_bypass.py:223 def mfa_conditional_access_scan(self, domain) -- Scan for conditional access policy gaps.
  • MFABypassEngine.replay_oauth_token (method) modules/mfa_bypass.py:252 def replay_oauth_token(self, access_token, refresh_token) -- Test if an OAuth2 token is still valid and can be replayed.
  • MFABypassEngine.saml_golden_ticket_check (method) modules/mfa_bypass.py:278 def saml_golden_ticket_check(self, adfs_server) -- Check for ADFS token signing certificate exposure.
  • MFABypassEngine.export_report (method) modules/mfa_bypass.py:303 def export_report(self) -- Export MFA bypass results to a JSON report.

modules/module_registry.py

Depends on: core/logging.py Imported by: cli/commands/marketplace.py, cli/commands/misc_migrated.py, cli/commands/module_manager.py, cli/commands/session_ops.py, skills/lazyown_mcp.py, tests/test_module_registry.py

modules/moe_router.py

Depends on: core/logging.py, modules/toposwarm_bridge.py Imported by: modules/lesson_ingestor.py, modules/loop_ai_bridge.py, skills/swan_agent.py, tests/integration_autonomous_flow.py, tests/test_moe_rl_swan.py, tests/test_moe_router_check_regression.py

  • ExpertProfile.is_local (method) modules/moe_router.py:96 def is_local(self)
  • ExpertPerformance.update (method) modules/moe_router.py:115 def update(self, reward, detection_prob)
  • IExpertSelector.select (method) modules/moe_router.py:261 def select(self, candidates, task_type, performance_store, deterministic) -- Return the selected expert from candidates.
  • ExpertPerformanceStore.__init__ (method) modules/moe_router.py:283 def __init__(self, path)
  • ExpertPerformanceStore.record (method) modules/moe_router.py:298 def record(self, expert_id, task_type, reward, detection_prob) -- Update performance for (expert, task_type) and persist.
  • ExpertPerformanceStore.get (method) modules/moe_router.py:316 def get(self, expert_id, task_type)
  • ExpertPerformanceStore.all_for_task (method) modules/moe_router.py:321 def all_for_task(self, task_type)
  • ExpertPerformanceStore.performance_bonus (method) modules/moe_router.py:325 def performance_bonus(self, expert_id, task_type) -- Return a bonus scalar in [-0.3, +0.5] based on EMA reward history.
  • SoftmaxSelector.__init__ (method) modules/moe_router.py:377 def __init__(self, temperature)
  • SoftmaxSelector.temperature (method) modules/moe_router.py:381 def temperature(self)
  • SoftmaxSelector.temperature (method) modules/moe_router.py:385 def temperature(self, value)
  • SoftmaxSelector.select (method) modules/moe_router.py:388 def select(self, candidates, task_type, performance_store, deterministic)
  • ExpertAvailabilityChecker.__init__ (method) modules/moe_router.py:443 def __init__(self)
  • ExpertAvailabilityChecker.is_available (method) modules/moe_router.py:447 def is_available(self, expert, api_key)
  • MoERouter.__init__ (method) modules/moe_router.py:500 def __init__(self, experts, selector, performance_store, api_key)
  • MoERouter.route (method) modules/moe_router.py:515 def route(self, task_type, goal, deterministic) -- Return the single best expert for the given task_type.
  • MoERouter.ensemble (method) modules/moe_router.py:547 def ensemble(self, task_type, goal, n) -- Return up to n distinct experts for ensemble execution.
  • adjusted_weight (function) modules/moe_router.py:562 def adjusted_weight(ep)
  • MoERouter.record_outcome (method) modules/moe_router.py:575 def record_outcome(self, expert_id, task_type, reward, detection_prob) -- Record the outcome of an expert execution.
  • MoERouter.top_experts_for_task (method) modules/moe_router.py:589 def top_experts_for_task(self, task_type, top_k) -- Return (expert, adjusted_weight) sorted descending for diagnostics.
  • MoERouter.get_expert (method) modules/moe_router.py:605 def get_expert(self, expert_id) -- Return expert by ID, or None.
  • MoERouter.status_report (method) modules/moe_router.py:609 def status_report(self) -- Return a diagnostic snapshot of all experts and their weights.
  • get_router (function) modules/moe_router.py:684 def get_router(api_key) -- Return (or create) the module-level singleton MoERouter.

modules/morse.py

  • reverse_morse_code (function) modules/morse.py:98 def reverse_morse_code() -- Build the reverse lookup table from Morse code to characters.
  • text_to_morse (function) modules/morse.py:109 def text_to_morse(text, config) -- Convert plain text to Morse code.
  • morse_to_text (function) modules/morse.py:130 def morse_to_text(morse_code, config) -- Convert Morse code back to plain text.
  • clear_screen (function) modules/morse.py:157 def clear_screen(config) -- Reset the terminal screen using a bounded subprocess call.
  • read_choice (function) modules/morse.py:171 def read_choice(config) -- Read and validate the menu choice from standard input.
  • run_driver (function) modules/morse.py:186 def run_driver(config) -- Run the interactive Morse code conversion loop.

modules/mysql_hookandroot_lib.c

modules/network_opsec.py

Imported by: cli/commands/opsec_cleanup.py

  • NetworkOpsecEngine.__init__ (method) modules/network_opsec.py:83 def __init__(self, config)
  • NetworkOpsecEngine.configure_proxy_chain (method) modules/network_opsec.py:87 def configure_proxy_chain(self, chain_type) -- Configure a proxy chain for C2 communication.
  • NetworkOpsecEngine.check_canary_tokens (method) modules/network_opsec.py:131 def check_canary_tokens(self) -- Check if the target has canary token / deception technology.
  • NetworkOpsecEngine.analyze_traffic_with_canary_check (method) modules/network_opsec.py:179 def analyze_traffic_with_canary_check(self, target_host, target_port) -- Analyze whether target traffic is being intercepted or analyzed.
  • NetworkOpsecEngine.dns_over_https_config (method) modules/network_opsec.py:246 def dns_over_https_config(self) -- Generate DNS-over-HTTPS configuration for proxy and system.
  • NetworkOpsecEngine.source_port_randomize (method) modules/network_opsec.py:269 def source_port_randomize(self) -- Randomize source port for outbound connections.
  • NetworkOpsecEngine.connection_jitter_schedule (method) modules/network_opsec.py:294 def connection_jitter_schedule(self, beacon_interval) -- Generate a jitter schedule for beacon connections.
  • NetworkOpsecEngine.canary_detection_setup (method) modules/network_opsec.py:317 def canary_detection_setup(self) -- Set up canary detection for the engagement.
  • NetworkOpsecEngine.summary (method) modules/network_opsec.py:349 def summary(self)

modules/nmap2csv.py

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/atomic_exploit_bridge.py, modules/intelligence_engine.py, modules/operation.py, modules/planner.py, modules/playbook_engine.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, modules/auto_registry.py Imported by: cli/commands/lazyops.py, cli/lazy_orchestrator.py, modules/auto_registry.py, modules/lazy_loop.py, modules/loop_ai_bridge.py, tests/test_lazy_orchestrator.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/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_engine.py

Depends on: core/logging.py, core/safe_exec.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 Imported by: tests/test_bdd_infra_range_report.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:217 def classify_findings(self, data) -- Classify collected data into structured findings.
  • RedTeamReportGenerator.generate (method) modules/professional_report.py:244 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:841 def collect_command_history(self, max_entries) -- Collect operator command history for the engagement timeline.
  • RedTeamReportGenerator.collect_loot_summary (method) modules/professional_report.py:865 def collect_loot_summary(self) -- Summarize exfiltrated loot without embedding sensitive content.
  • RedTeamReportGenerator.generate_executive_summary (method) modules/professional_report.py:911 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/reactive_engine.py

Depends on: core/config.py, core/logging.py, modules/session_rag.py Imported by: 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, modules/cli_auth.py Imported by: cli/commands/redteam_gym.py, modules/exploitgym_gym.py, tests/test_infra_disposable.py

  • list_challenges (function) modules/redteam_gym.py:357 def list_challenges() -- Return all defined gym challenges with metadata.
  • start_challenge (function) modules/redteam_gym.py:378 def start_challenge(challenge_id) -- Begin a gym challenge and track start time.
  • submit_challenge (function) modules/redteam_gym.py:448 def submit_challenge(techniques_used, success) -- Submit a completed challenge for scoring.
  • show_leaderboard (function) modules/redteam_gym.py:679 def show_leaderboard(top_n) -- Return the top N players from the leaderboard.
  • get_active_challenge (function) modules/redteam_gym.py:706 def get_active_challenge() -- Return the currently active challenge for this operator, if any.
  • record_external_attempt (function) modules/redteam_gym.py:736 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:790 def main() -- CLI entry point — show gym leaderboard from command line.

Next: API_p16.md