Skip to content

Agent API_p8

grisun0 edited this page Oct 31, 2026 · 38 revisions

API (page 8 of 26)

Previous: API_p7.md

lazyc2.py

Depends on: cli/auto_crypto.py, cli/palette.py, cli/palette_command.py, core/config.py, core/console.py, core/hardening.py, core/logging.py, core/parsers.py, core/reverse_shell_secret.py, core/session_secrets.py, lazyc2/blueprints/__init__.py, lazyc2/extensions/users.py, lazyc2/security/cli_credentials.py, lazyc2/security/command_allowlist.py, lazyc2/security/constants.py, lazyc2/security/cors.py, lazyc2/security/csrf.py, lazyc2/security/html_sanitizer.py, lazyc2/security/https_redirect.py, lazyc2/security/services.py, lazyc2/security/trusted_proxy.py, lazyc2/security/validators.py, lazyown.py, modules/__init__.py, modules/attack_surface3d.py, modules/backdoor/server.c, modules/beacon_history.py, modules/beacon_recon.py, modules/c2_surfaces.py, modules/chain_approval.py, modules/collab_bp.py, modules/colors.py, modules/compliance.py, modules/conditional_hooks.py, modules/credential_reuse.py, modules/dashboard_bp.py, modules/event_bus.py, modules/event_consumers.py, modules/event_engine.py, modules/intel_fusion.py, modules/kill_chain_viz.py, modules/killchain.py, modules/lazy_loop.py, modules/lazy_mentions.py, modules/lazy_rbac.py, modules/listener_manager.py, modules/live_surface.py, modules/llm_adapter.py, modules/llm_orchestrator.py, modules/logging_config.py, modules/loop_manager.py, modules/metrics.py, modules/security_sanitizers.py, modules/state_manager.py, modules/world_model.py, skills/daemon_health.py, skills/lazyown_facts.py, utils.py

  • is_insecure_credential (function) lazyc2.py:242 def is_insecure_credential(user, pwd) -- Check for weak or default credentials
  • _JsonLogFormatter.format (method) lazyc2.py:482 def format(self, record)
  • ensure_sessions_dir (function) lazyc2.py:509 def ensure_sessions_dir() -- Ensure the sessions directory exists with safe permissions.
  • load_routes (function) lazyc2.py:520 def load_routes() -- Load dynamic routes from JSON file.
  • save_routes (function) lazyc2.py:530 def save_routes(routes) -- Save dynamic routes to JSON file with safe permissions.
  • validate_route_path (function) lazyc2.py:544 def validate_route_path(route_path) -- Module-level boolean adapter for :func:lazyc2.security.validators.validate_route_path.
  • validate_template_name (function) lazyc2.py:557 def validate_template_name(template_name) -- Module-level boolean adapter for :func:lazyc2.security.validators.validate_template_name.
  • is_safe_template_path (function) lazyc2.py:567 def is_safe_template_path(template_path, template_name) -- Verify template_path resolves inside app.template_folder.
  • is_binary (function) lazyc2.py:607 def is_binary(safe_filename) -- Check whether a session file is binary based on its header bytes.
  • clean_expired_tokens (function) lazyc2.py:648 def clean_expired_tokens()
  • clean_json (function) lazyc2.py:656 def clean_json(text) -- Extract only the JSON content between json and , discarding everything else.
  • load_yaml_safely (function) lazyc2.py:684 def load_yaml_safely(file_path) -- Load a YAML file safely with error handling and default values.
  • Handler.on_any_event (method) lazyc2.py:768 def on_any_event(event)
  • get_karma_name (function) lazyc2.py:793 def get_karma_name(elo)
  • fromjson (function) lazyc2.py:810 def fromjson(value)
  • run_shell (function) lazyc2.py:814 def run_shell()
  • load_banners (function) lazyc2.py:824 def load_banners() -- Loads the banners from the JSON file.
  • load_mitre_data (function) lazyc2.py:844 def load_mitre_data()
  • load_event_config (function) lazyc2.py:850 def load_event_config()
  • load_notifications (function) lazyc2.py:858 def load_notifications()
  • implants_check (function) lazyc2.py:876 def implants_check()
  • extract_attack_vectors (function) lazyc2.py:893 def extract_attack_vectors(nodes, edges) -- Analyzes BloodHound nodes and edges to extract critical attack vectors for AD compromise.
  • process_bloodhound_zip (function) lazyc2.py:980 def process_bloodhound_zip(zip_filepath) -- Processes a BloodHound ZIP file to extract nodes and edges for graph visualization.
  • start_watching (function) lazyc2.py:1078 def start_watching()
  • load_tasks (function) lazyc2.py:1094 def load_tasks()
  • create_cves (function) lazyc2.py:1102 def create_cves()
  • load_cves (function) lazyc2.py:1108 def load_cves()
  • save_cves (function) lazyc2.py:1116 def save_cves(cves)
  • create_report (function) lazyc2.py:1121 def create_report()
  • save_tasks (function) lazyc2.py:1127 def save_tasks(tasks)
  • load_note (function) lazyc2.py:1132 def load_note()
  • aumentar_elo (function) lazyc2.py:1150 def aumentar_elo(user_id, cantidad)
  • save_note (function) lazyc2.py:1180 def save_note(content)
  • escape_js (function) lazyc2.py:1186 def escape_js(s)
  • markdown_to_html (function) lazyc2.py:1223 def markdown_to_html(text)
  • to_serializable (function) lazyc2.py:1231 def to_serializable(obj) -- Convert objects to serializable format.
  • make_serializable (function) lazyc2.py:1238 def make_serializable(data) -- Recursively convert data to serializable format.
  • datetime_now_iso (function) lazyc2.py:1256 def datetime_now_iso() -- Return the current UTC timestamp as an ISO-8601 string.
  • escape_js_string (function) lazyc2.py:1475 def escape_js_string(value) -- Escape special characters in a string for JavaScript.
  • check_auth (function) lazyc2.py:1487 def check_auth(username, password) -- Verify credentials.
  • authenticate (function) lazyc2.py:1502 def authenticate() -- Requests authentication.
  • requires_auth_or_session (function) lazyc2.py:1511 def requires_auth_or_session(f) -- Require Basic auth credentials or a valid Flask-Login session.
  • decorated (function) lazyc2.py:1521 def decorated()
  • requires_auth (function) lazyc2.py:1532 def requires_auth(f)
  • decorated (function) lazyc2.py:1534 def decorated()
  • csrf_protect (function) lazyc2.py:1543 def csrf_protect(view) -- Decorator that enforces the per-session CSRF token.
  • wrapper (function) lazyc2.py:1553 def wrapper()
  • aicmd_deepseek (function) lazyc2.py:1564 def aicmd_deepseek(cmd)
  • aicmd (function) lazyc2.py:1678 def aicmd(cmd)
  • search_database (function) lazyc2.py:1783 def search_database(term, data_path) -- Busca un término en un DataFrame, manejando listas, dicts y distintas estructuras.
  • execute_command (function) lazyc2.py:1838 def execute_command(command)
  • CustomDNSResolver.resolve (method) lazyc2.py:1868 def resolve(self, request, handler)
  • start_dns_server (function) lazyc2.py:1972 def start_dns_server() -- Start the C2 DNS server, gracefully degrading when binding is unsafe.
  • tcp_bridge (function) lazyc2.py:2012 def tcp_bridge(local_port, remote_host, remote_port) -- Establish a TCP bridge between a local port and a remote host.
  • handle_client (function) lazyc2.py:2036 def handle_client(client_socket, remote_host, remote_port) -- Handle communication between the client and the remote server.
  • decoy (function) lazyc2.py:2055 def decoy() -- Serve a decoy page to non-operator IPs when decoy mode is enabled.
  • encrypt_data (function) lazyc2.py:2112 def encrypt_data(data)
  • decrypt_data (function) lazyc2.py:2121 def decrypt_data(encrypted_data, is_file)
  • set_winsize (function) lazyc2.py:2134 def set_winsize(fd, row, col, xpix, ypix) -- Configura el tamaño de la terminal
  • read_and_forward_pty_output (function) lazyc2.py:2140 def read_and_forward_pty_output() -- Lectura continua del PTY y envío por WebSocket
  • get_discovered_hosts (function) lazyc2.py:2157 def get_discovered_hosts() -- Reads the sessions/hostsdiscovery.txt file and returns a list of discovered hosts.
  • get_local_ip_addresses (function) lazyc2.py:2207 def get_local_ip_addresses()
  • sanitize_json (function) lazyc2.py:2232 def sanitize_json(data) -- Elimina datos sensibles del diccionario JSON.
  • add_dynamic_data (function) lazyc2.py:2262 def add_dynamic_data(data) -- Agrega datos dinámicos al diccionario JSON si es necesario, basándose en el contenido del diccionario 'data'.
  • get_client_ip (function) lazyc2.py:2284 def get_client_ip() -- Get the client's IP address, handling proxies.
  • get_request_details (function) lazyc2.py:2293 def get_request_details() -- Collect comprehensive request details.
  • save_to_log (function) lazyc2.py:2328 def save_to_log(data) -- Append request data to the JSON log file with safe permissions.
  • parse_access_log_for_short_url (function) lazyc2.py:2350 def parse_access_log_for_short_url(short_url) -- Parse access.log for entries matching the given short URL.
  • parse_execution_log (function) lazyc2.py:2372 def parse_execution_log(implante) -- Parse execution log for the given implante, returning execution events.
  • load_implant_config (function) lazyc2.py:2398 def load_implant_config(implante) -- Load implant configuration from JSON file.
  • load_short_urls (function) lazyc2.py:2408 def load_short_urls() -- Load short URLs from JSON file, creating it if it doesn't exist.
  • save_short_urls (function) lazyc2.py:2428 def save_short_urls(data) -- Save short URLs to JSON file.
  • is_valid_url (function) lazyc2.py:2438 def is_valid_url(url) -- Validate if the input is a valid URL or existing local file path.
  • get_safe_file_path (function) lazyc2.py:2446 def get_safe_file_path(user_path) -- Construye de forma segura el path del archivo y verifica que está en el directorio permitido.
  • analyze_behavioral_data (function) lazyc2.py:2541 def analyze_behavioral_data(behavioral_events) -- Analyze behavioral events using the orchestrator LLM chain.
  • analyze_campaign_progress (function) lazyc2.py:2593 def analyze_campaign_progress(campaign_id, events) -- Analyze campaign progress using the orchestrator LLM chain.
  • require_mfa_socket (function) lazyc2.py:2737 def require_mfa_socket(f) -- Socket.IO-compatible MFA guard for command/control namespaces.
  • decorated (function) lazyc2.py:2745 def decorated()
  • User.__init__ (method) lazyc2.py:3249 def __init__(self, user_data)
  • load_users (function) lazyc2.py:3271 def load_users()
  • save_users (function) lazyc2.py:3281 def save_users(users)
  • load_data (function) lazyc2.py:3292 def load_data()
  • load_user (function) lazyc2.py:3309 def load_user(user_id)
  • tojson_filter (function) lazyc2.py:3324 def tojson_filter(value) -- Custom tojson filter to handle non-serializable objects.
  • index (function) lazyc2.py:3331 def index()
  • send_command (function) lazyc2.py:3482 def send_command(client_id)
  • receive_result (function) lazyc2.py:3680 def receive_result(client_id)
  • issue_command (function) lazyc2.py:4239 def issue_command()
  • upload (function) lazyc2.py:4253 def upload()
  • download_file (function) lazyc2.py:4290 def download_file()
  • serve_file (function) lazyc2.py:4317 def serve_file(file_path) -- Serve a file from sessions/temp_uploads through :class:SafeFileService.
  • create_route (function) lazyc2.py:4419 def create_route() -- Register a new operator-supplied dynamic route bound to a template.
  • dynamic_route (function) lazyc2.py:4488 def dynamic_route(route_path, data) -- Handle dynamic routes based on stored route-to-template mappings.
  • sanitize_input (function) lazyc2.py:4495 def sanitize_input(input_str) -- Sanitize input to prevent XSS attacks.
  • is_valid_route_path (function) lazyc2.py:4505 def is_valid_route_path(route_path) -- Validate route path format.
  • is_valid_data (function) lazyc2.py:4512 def is_valid_data(data) -- Validate data parameter.
  • is_valid_template_name (function) lazyc2.py:4522 def is_valid_template_name(template_name) -- Validate template name.
  • log (function) lazyc2.py:4584 def log(data) -- Log request details to JSON file.
  • favicon (function) lazyc2.py:4602 def favicon() -- Serve the favicon.ico file.
  • palette_view (function) lazyc2.py:4615 def palette_view() -- Render the operator command palette browser.
  • palette_api (function) lazyc2.py:4643 def palette_api() -- JSON catalogue feed for the global Cmd+K / Ctrl+K overlay.
  • api_data (function) lazyc2.py:4664 def api_data()
  • create_short_url (function) lazyc2.py:4826 def create_short_url() -- Create multiple short URLs for a single original URL.
  • track_interaction (function) lazyc2.py:4854 def track_interaction(short_url) -- Serve tracking page and log behavioral data.
  • update_short_url (function) lazyc2.py:4879 def update_short_url(short_url)
  • redirect_to_file (function) lazyc2.py:4906 def redirect_to_file(short_url)
  • webserver_report (function) lazyc2.py:4934 def webserver_report(filename) -- Serve nmap HTML report assets from the sessions directory over HTTPS.
  • download_files (function) lazyc2.py:4954 def download_files(filename) -- Serve implant stage files by name, enforcing strict containment.
  • view_yaml (function) lazyc2.py:5006 def view_yaml()
  • run_command (function) lazyc2.py:5100 def run_command() -- Execute one shell command and return a sanitised, JSON-safe result.
  • get_output (function) lazyc2.py:5169 def get_output()
  • run_shellcode (function) lazyc2.py:5196 def run_shellcode()
  • get_results (function) lazyc2.py:5205 def get_results()
  • send_lcommand (function) lazyc2.py:5303 def send_lcommand(ip, port)
  • chatbot (function) lazyc2.py:5336 def chatbot()
  • vuln (function) lazyc2.py:5352 def vuln()
  • taskbot (function) lazyc2.py:5391 def taskbot()
  • search (function) lazyc2.py:5407 def search()
  • script (function) lazyc2.py:5423 def script()
  • redop (function) lazyc2.py:5439 def redop()
  • adversary (function) lazyc2.py:5458 def adversary()
  • generalbot (function) lazyc2.py:5474 def generalbot()
  • csv_to_html (function) lazyc2.py:5490 def csv_to_html()
  • search_results (function) lazyc2.py:5541 def search_results()
  • graph (function) lazyc2.py:5589 def graph()
  • task (function) lazyc2.py:5598 def task(task_id)
  • get_tasks (function) lazyc2.py:5613 def get_tasks()
  • tasks (function) lazyc2.py:5623 def tasks()
  • edit_task (function) lazyc2.py:5652 def edit_task(task_id)
  • cves (function) lazyc2.py:5686 def cves()
  • cve (function) lazyc2.py:5712 def cve(cve_id)
  • edit_cve (function) lazyc2.py:5727 def edit_cve(cve_id)
  • edit_notes (function) lazyc2.py:5761 def edit_notes()
  • get_notes (function) lazyc2.py:5779 def get_notes()
  • view_note (function) lazyc2.py:5789 def view_note()
  • push_notification (function) lazyc2.py:5799 def push_notification()
  • edit_event (function) lazyc2.py:5826 def edit_event(event_name)
  • get_event_config (function) lazyc2.py:5861 def get_event_config()
  • get_event_config_view (function) lazyc2.py:5868 def get_event_config_view()
  • aicmd_view (function) lazyc2.py:5903 def aicmd_view()
  • get_events (function) lazyc2.py:5928 def get_events()
  • list_tools (function) lazyc2.py:5960 def list_tools()
  • create_tool (function) lazyc2.py:5970 def create_tool()
  • view_tool (function) lazyc2.py:5997 def view_tool(toolname)
  • update_tool (function) lazyc2.py:6028 def update_tool(toolname)
  • delete_tool (function) lazyc2.py:6076 def delete_tool(toolname)
  • register (function) lazyc2.py:6111 def register()
  • login (function) lazyc2.py:6170 def login()
  • mfa_setup (function) lazyc2.py:6222 def mfa_setup()
  • mfa_qr (function) lazyc2.py:6296 def mfa_qr(username) -- Serve a locally-generated QR code SVG for MFA setup.
  • mfa_verify (function) lazyc2.py:6318 def mfa_verify()
  • admin_users (function) lazyc2.py:6371 def admin_users()
  • admin_set_role (function) lazyc2.py:6386 def admin_set_role(user_id)
  • admin_reset_mfa (function) lazyc2.py:6408 def admin_reset_mfa(user_id)
  • admin_delete_user (function) lazyc2.py:6420 def admin_delete_user(user_id)
  • admin_tenants (function) lazyc2.py:6438 def admin_tenants()
  • admin_create_tenant (function) lazyc2.py:6459 def admin_create_tenant()
  • admin_switch_tenant (function) lazyc2.py:6479 def admin_switch_tenant(tenant_id)
  • profile (function) lazyc2.py:6494 def profile()
  • logout (function) lazyc2.py:6518 def logout()
  • change_password (function) lazyc2.py:6534 def change_password() -- Force rotation of the initial one-time admin password.
  • aumentar_elo_route (function) lazyc2.py:6600 def aumentar_elo_route(user_id)
  • banners (function) lazyc2.py:6616 def banners()
  • mitre (function) lazyc2.py:6652 def mitre()
  • get_connected_clients (function) lazyc2.py:6697 def get_connected_clients()
  • lazybot (function) lazyc2.py:6708 def lazybot()
  • compliance_dashboard (function) lazyc2.py:6725 def compliance_dashboard()
  • compliance_report (function) lazyc2.py:6747 def compliance_report()
  • compliance_add_evidence (function) lazyc2.py:6777 def compliance_add_evidence()
  • compliance_verify_evidence (function) lazyc2.py:6813 def compliance_verify_evidence()
  • compliance_export (function) lazyc2.py:6827 def compliance_export(format)
  • lazyreport (function) lazyc2.py:6857 def lazyreport()
  • teamserver (function) lazyc2.py:6876 def teamserver()
  • report (function) lazyc2.py:6905 def report()
  • lazyreport_view (function) lazyc2.py:6912 def lazyreport_view()
  • killchain_view (function) lazyc2.py:6918 def killchain_view()
  • api_killchain (function) lazyc2.py:6948 def api_killchain() -- Return the unified kill-chain snapshot consumed by every surface.
  • api_beacon_results (function) lazyc2.py:6979 def api_beacon_results(client_id) -- Return the full ordered command/result history for one beacon.
  • api_loops_start (function) lazyc2.py:7010 def api_loops_start() -- Start one autonomous loop subprocess from the dashboard.
  • api_loops_list (function) lazyc2.py:7059 def api_loops_list() -- List every autonomous loop with refreshed live status.
  • api_loop_log (function) lazyc2.py:7071 def api_loop_log(loop_id) -- Return one chunk of a loop's output log.
  • api_loop_stop (function) lazyc2.py:7094 def api_loop_stop(loop_id) -- Stop one running loop by terminating its process group.
  • connect (function) lazyc2.py:7285 def connect()
  • listener (function) lazyc2.py:7291 def listener()
  • listener_connect (function) lazyc2.py:7298 def listener_connect()
  • listener_disconnect (function) lazyc2.py:7309 def listener_disconnect()
  • pty_input (function) lazyc2.py:7320 def pty_input(data)
  • resize (function) lazyc2.py:7335 def resize(data)
  • pty_connect (function) lazyc2.py:7349 def pty_connect()
  • handle_input (function) lazyc2.py:7381 def handle_input(data)
  • listener_command (function) lazyc2.py:7406 def listener_command(msg)
  • terminal (function) lazyc2.py:7420 def terminal()
  • terminal_connect (function) lazyc2.py:7430 def terminal_connect()
  • terminal_disconnect (function) lazyc2.py:7440 def terminal_disconnect()
  • terminal_input (function) lazyc2.py:7451 def terminal_input(data)
  • terminal_command (function) lazyc2.py:7465 def terminal_command(data)
  • terminal_resize (function) lazyc2.py:7481 def terminal_resize(data)
  • start_reverse_shell (function) lazyc2.py:7489 def start_reverse_shell()
  • start_bridge (function) lazyc2.py:7543 def start_bridge() -- Start a TCP bridge to a specified remote host and port.
  • page_not_found (function) lazyc2.py:7560 def page_not_found(e)
  • internal_server_error (function) lazyc2.py:7568 def internal_server_error(e)
  • get_config (function) lazyc2.py:7577 def get_config() -- Lee el archivo payload.json, lo manipula y lo expone como /config.json.
  • capture_image (function) lazyc2.py:7596 def capture_image()
  • capture_audio (function) lazyc2.py:7622 def capture_audio()
  • surface (function) lazyc2.py:7640 def surface()
  • surface_live (function) lazyc2.py:7646 def surface_live() -- Render the live attack-surface graph page.
  • api_surface_live (function) lazyc2.py:7661 def api_surface_live() -- Return the live attack-surface graph derived from the world model.
  • intel_view (function) lazyc2.py:7683 def intel_view() -- Render the fused sessions intel graph page (ReadMenator engine).
  • intel_bundle_view (function) lazyc2.py:7702 def intel_bundle_view() -- Render the circular/spherical bundle view of the intel graph.
  • attack3d_view (function) lazyc2.py:7717 def attack3d_view() -- Render the C2-centred attack-surface graph (ReadMenator engine).
  • attack_bundle_view (function) lazyc2.py:7736 def attack_bundle_view() -- Render the circular/spherical bundle view of the attack surface.
  • api_intel_graph (function) lazyc2.py:7751 def api_intel_graph() -- Return the fused C2-centred intel graph with precomputed layout.
  • broadcast_view (function) lazyc2.py:7807 def broadcast_view() -- Render the exploration timeline board for one loop task.
  • api_loop_broadcast_stream (function) lazyc2.py:7821 def api_loop_broadcast_stream() -- SSE live tail of one loop task's activity stream.
  • api_loop_broadcast (function) lazyc2.py:7879 def api_loop_broadcast() -- Return the paginated exploration timeline for one loop task.
  • api_guard_audit (function) lazyc2.py:7922 def api_guard_audit() -- Return guard history with pending approvals kept independent.
  • api_chain_approvals (function) lazyc2.py:7968 def api_chain_approvals() -- List confirm-step approval requests from the chain approval gate.
  • api_chain_approvals_decide (function) lazyc2.py:7996 def api_chain_approvals_decide(request_id) -- Approve or deny one pending chain approval request.
  • api_loop_graph (function) lazyc2.py:8037 def api_loop_graph() -- Return one loop task as ForceGraph-ready nodes/links plus context.
  • api_lazy_mentions (function) lazyc2.py:8068 def api_lazy_mentions() -- Search @ mention candidates with scroll pagination.
  • api_intel_bundle (function) lazyc2.py:8104 def api_intel_bundle() -- Return the circular/spherical bundle payload of the intel graph.
  • api_attack_graph (function) lazyc2.py:8137 def api_attack_graph() -- Return the fused C2-centred attack-surface graph.
  • api_attack_bundle (function) lazyc2.py:8189 def api_attack_bundle() -- Return the circular/spherical bundle payload of the attack surface.
  • get_data (function) lazyc2.py:8219 def get_data()
  • upload_zip_file (function) lazyc2.py:8228 def upload_zip_file() -- Handles the file upload, processes the BloodHound ZIP, and prepares data for visualization.
  • list_campaigns (function) lazyc2.py:8286 def list_campaigns()
  • create_campaign (function) lazyc2.py:8299 def create_campaign()
  • lazyphishingai (function) lazyc2.py:8377 def lazyphishingai()
  • track_pixel (function) lazyc2.py:8393 def track_pixel(campaign_id, email) -- Píxel de seguimiento para registrar aperturas.
  • campaign_report (function) lazyc2.py:8415 def campaign_report(campaign_id)
  • orchestrate_campaign (function) lazyc2.py:8497 def orchestrate_campaign(campaign_id)
  • create_multivector_campaign (function) lazyc2.py:8544 def create_multivector_campaign()
  • serve_landing_page (function) lazyc2.py:8696 def serve_landing_page(campaign_id, short_url)
  • health_check (function) lazyc2.py:8721 def health_check() -- Basic health and readiness endpoint.
  • metrics_exposition (function) lazyc2.py:8760 def metrics_exposition() -- Prometheus-compatible metrics endpoint.
  • api_dashboard (function) lazyc2.py:8767 def api_dashboard() -- Aggregated JSON dashboard: beacons, campaign, events, facts summary.
  • api_listeners (function) lazyc2.py:8837 def api_listeners() -- List all configured C2 listeners and their runtime status.
  • api_listeners_create (function) lazyc2.py:8844 def api_listeners_create() -- Create a new listener.
  • api_listeners_start (function) lazyc2.py:8860 def api_listeners_start(listener_id) -- Start an existing listener.
  • api_listeners_stop (function) lazyc2.py:8868 def api_listeners_stop(listener_id) -- Stop a running listener.
  • api_listeners_delete (function) lazyc2.py:8876 def api_listeners_delete(listener_id) -- Remove a listener configuration.

lazyc2/addon_creator.py

Depends on: core/param_registry.py Imported by: lazyc2/blueprints/addons.py, tests/test_addon_creator.py, tests/test_param_registry.py, tests/test_php2shell_addon.py, tests/test_placeholder_coverage.py

lazyc2/app_factory.py

Depends on: core/api_authz.py, lazyc2/blueprints/__init__.py, lazyc2/blueprints/orchestrator.py, lazyc2/extensions/__init__.py, lazyc2/security/services.py, modules/lazy_rbac.py

lazyc2/blueprints/addons.py

Depends on: core/logging.py, lazyc2/addon_creator.py, lazyc2/blueprints/session_auth.py, lazyc2/extensions/decoy.py, lazyc2/security/csrf.py Imported by: lazyc2/blueprints/__init__.py, tests/test_addon_creator.py, tests/test_security_hardening_v5.py

lazyc2/blueprints/api.py

Depends on: core/api_authz.py, core/config.py, core/defaults.py, core/logging.py Imported by: lazyc2/blueprints/__init__.py, lazyc2/blueprints/api_v1.py, lazyc2/blueprints/orchestrator.py, tests/test_core_defaults.py, tests/test_security_hardening_v5.py

lazyc2/blueprints/api_v1.py

Depends on: core/logging.py, core/safe_exec.py, lazyc2/blueprints/api.py, modules/beacon_history.py, modules/db.py Imported by: lazyc2/blueprints/__init__.py, tests/test_api_v1.py

lazyc2/blueprints/auth.py

Depends on: cli/commands/enum.py, core/logging.py, lazyc2/__init__.py, lazyc2/extensions/decoy.py, lazyc2/extensions/users.py, modules/lazy_rbac.py Imported by: lazyc2/blueprints/__init__.py, lazygui/services/teamserver_backend.py, static/js/socket.io-4.0.0.min.js, static/js/socket.io-4.3.2.min.js

lazyc2/blueprints/beacon.py

Depends on: core/logging.py, modules/conditional_hooks.py, modules/credential_reuse.py, modules/state_manager.py Imported by: lazyc2/blueprints/__init__.py

lazyc2/blueprints/operations.py

Depends on: lazyc2/blueprints/session_auth.py, lazyc2/extensions/decoy.py, lazyc2/extensions/storage.py Imported by: lazyc2/blueprints/__init__.py

lazyc2/blueprints/orchestrator.py

Depends on: core/logging.py, lazyc2/blueprints/api.py, modules/__init__.py, modules/killchain.py, modules/loop_triggers.py, modules/orchestrator_config.py, modules/trigger_policy.py, modules/verb_catalog.py, modules/world_model.py Imported by: lazyc2/app_factory.py, tests/test_orchestrator_api.py

lazyc2/blueprints/phishing.py

Depends on: core/logging.py, lazyc2/extensions/short_urls.py, lazyc2/security/validators.py, modules/security_sanitizers.py, utils.py Imported by: lazyc2/blueprints/__init__.py

lazyc2/blueprints/session_auth.py

Imported by: lazyc2/blueprints/addons.py, lazyc2/blueprints/operations.py

  • require_operator_session (function) lazyc2/blueprints/session_auth.py:20 def require_operator_session(blueprint, login_endpoint) -- Register a before_request guard on a blueprint.

lazyc2/extensions/decoy.py

Imported by: lazyc2/blueprints/addons.py, lazyc2/blueprints/auth.py, lazyc2/blueprints/operations.py

  • decoy_response (function) lazyc2/extensions/decoy.py:12 def decoy_response() -- Return a decoy page when the client IP is not the operator host.

lazyc2/extensions/short_urls.py

Depends on: core/logging.py Imported by: lazyc2/blueprints/phishing.py

lazyc2/extensions/storage.py

Depends on: core/logging.py Imported by: lazyc2/blueprints/operations.py

  • configure (function) lazyc2/extensions/storage.py:18 def configure(sessions_dir) -- Set the session directory path.
  • load_tasks (function) lazyc2/extensions/storage.py:31 def load_tasks() -- Load tasks from [sessions/tasks.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/tasks.json).
  • save_tasks (function) lazyc2/extensions/storage.py:45 def save_tasks(tasks) -- Persist tasks to [sessions/tasks.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/tasks.json).
  • load_cves (function) lazyc2/extensions/storage.py:59 def load_cves() -- Load CVEs from [sessions/cves.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/cves.json).
  • save_cves (function) lazyc2/extensions/storage.py:73 def save_cves(cves) -- Persist CVEs to [sessions/cves.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/cves.json).
  • load_note (function) lazyc2/extensions/storage.py:87 def load_note() -- Load the operator note from [sessions/notes.txt](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/notes.txt).
  • save_note (function) lazyc2/extensions/storage.py:107 def save_note(content) -- Persist the operator note to [sessions/notes.txt](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/notes.txt).
  • load_event_config (function) lazyc2/extensions/storage.py:121 def load_event_config() -- Load event configuration from [event_config.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/event_config.json).
  • load_notifications (function) lazyc2/extensions/storage.py:137 def load_notifications() -- Load notifications from [sessions/notifications.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/notifications.json).
  • load_banners (function) lazyc2/extensions/storage.py:154 def load_banners() -- Load banners from [sessions/banners.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/banners.json).
  • load_routes (function) lazyc2/extensions/storage.py:179 def load_routes() -- Load dynamic routes from [sessions/routes_to_templates.json](https://github.com/grisuno/LazyOwn/blob/58d2c970e22d15f3945d89c5917fb18537018cda/sessions/routes_to_templates.json).
  • save_routes (function) lazyc2/extensions/storage.py:194 def save_routes(routes) -- Persist dynamic routes with atomic write and safe permissions.

lazyc2/extensions/users.py

Depends on: lazyc2/__init__.py, modules/lazy_rbac.py Imported by: lazyc2.py, lazyc2/blueprints/auth.py

lazyc2/models.py

Depends on: modules/lazy_rbac.py

lazyc2/security/cli_credentials.py

Depends on: core/logging.py Imported by: lazyc2.py, tests/test_c2_credential_bootstrap.py

  • write_credentials_file (function) lazyc2/security/cli_credentials.py:22 def write_credentials_file(username, password, path) -- Persist the effective boot credentials owner-only.
  • resolve_boot_credentials (function) lazyc2/security/cli_credentials.py:47 def resolve_boot_credentials(user, password, rotate_on_boot, generator, is_insecure) -- Resolve the effective boot credentials.
  • register_cli_user (function) lazyc2/security/cli_credentials.py:80 def register_cli_user(store, username, password, hash_password, create_role) -- Register or update the boot CLI user in an RBAC store.

lazyc2/security/command_allowlist.py

Depends on: cli/commands/enum.py Imported by: lazyc2.py, tests/test_command_allowlist.py, tests/test_command_allowlist_behavior.py

lazyc2/security/cors.py

Imported by: lazyc2.py, tests/test_cors_behavior.py, tests/test_cors_policy.py, tests/test_cors_socketio_regression.py

  • CorsPolicy.__init__ (method) lazyc2/security/cors.py:70 def __init__(self, env, lhost, allowed_origins, c2_port, extra_socketio_ports)
  • CorsPolicy.env (method) lazyc2/security/cors.py:85 def env(self) -- Return the normalized environment tag ("PROD" or "DEV").
  • CorsPolicy.resolve_origins (method) lazyc2/security/cors.py:89 def resolve_origins(self) -- Return the validated allowlist of origins for the current env.
  • CorsPolicy.origins_for_socketio (method) lazyc2/security/cors.py:110 def origins_for_socketio(self) -- Return the allowlist to feed flask_socketio.SocketIO.
  • CorsPolicy.is_allowed (method) lazyc2/security/cors.py:136 def is_allowed(self, origin) -- Return True if origin matches any allowed entry.

lazyc2/security/csrf.py

Imported by: lazyc2.py, lazyc2/blueprints/addons.py, tests/test_csrf_behavior.py, tests/test_csrf_policy.py

  • CSRFPolicy.__init__ (method) lazyc2/security/csrf.py:69 def __init__(self, header, form_field, cookie_name, exempt_paths, secret)
  • CSRFPolicy.header (method) lazyc2/security/csrf.py:85 def header(self) -- Return the HTTP header name carrying the token.
  • CSRFPolicy.cookie_name (method) lazyc2/security/csrf.py:90 def cookie_name(self) -- Return the cookie name that should hold the readable token.
  • CSRFPolicy.issue (method) lazyc2/security/csrf.py:94 def issue(self, session_id) -- Return the token bound to session_id.
  • CSRFPolicy.rotate (method) lazyc2/security/csrf.py:111 def rotate(self, session_id) -- Force a fresh token for session_id.
  • CSRFPolicy.forget (method) lazyc2/security/csrf.py:126 def forget(self, session_id) -- Drop the token bound to session_id (e.g. on logout).
  • CSRFPolicy.validate (method) lazyc2/security/csrf.py:130 def validate(self, session_id, candidate) -- Return True iff candidate matches the stored token.
  • CSRFPolicy.is_exempt (method) lazyc2/security/csrf.py:147 def is_exempt(self, path) -- Return True if path is in the exempt set.
  • CSRFPolicy.extract_token (method) lazyc2/security/csrf.py:163 def extract_token(self, request) -- Return the token from a Flask-shaped request.
  • CSRFPolicy.check_request (method) lazyc2/security/csrf.py:182 def check_request(self, session_id, request) -- Run the full CSRF gate against a request.

lazyc2/security/html_sanitizer.py

Depends on: lazyc2/security/constants.py Imported by: lazyc2.py, tests/test_html_sanitizer.py

  • sanitize_html (function) lazyc2/security/html_sanitizer.py:78 def sanitize_html(raw_html, allowed_tags, allowed_attributes) -- Return a sanitized HTML string safe for render_template.

lazyc2/security/https_redirect.py

Imported by: lazyc2.py, tests/test_https_redirect.py

lazyc2/security/services.py

Depends on: lazyc2/security/constants.py, lazyc2/security/validators.py Imported by: lazyc2.py, lazyc2/app_factory.py, modules/c2_agent.py, tests/test_security_lazyc2.py

lazyc2/security/trusted_proxy.py

Imported by: lazyc2.py, tests/test_trusted_proxy.py

Next: API_p9.md

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally