Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ARCANGEL0 EVA create surface map

From Leeroopedia
Knowledge Sources
Domains Pentest, Visualization, Knowledge_Graphs
Last Updated 2026-10-29 14:00 GMT

Overview

Concrete tool for generating a self-contained offline HTML attack-surface map from session Intel, with interactive SVG graph, search, zoom, and node details, provided by the Mitsu surface map module.

Description

The create_surface_map function:

  1. Validates session ID: Confirms the session has a valid 32-character hex ID for artifact storage.
  2. Builds the graph via `build_surface_graph` — collecting nodes from Intel records (assets, findings, exploits, observations, accounts, manhunt) and deriving edges from parent relationships, asset references, and CIDR containment.
  3. Renders HTML via `_basic_html` — produces a self-contained HTML file with embedded CSS, JS, and graph data (no external dependencies). The page includes an interactive SVG graph with search, zoom, pan, category filtering, and a node detail panel with evidence.
  4. Saves the file to `session_root/<session_id>/artifacts/attack-surface-map.html` with 0o600 permissions.

Returns a dict with the file path, node count, edge count, transcript node count, and title.

Usage

  • Export command: Called by the `/export` slash command in the session screen.
  • Map command: Called by the `/map` command to generate and display the attack surface.

Code Reference

Source Location

  • Repository: Mitsu
  • File: workspace/surface_map.py

Signature

def create_surface_map(
    session: dict[str, Any],
    session_root: Path,
    extra_nodes: list[dict[str, Any]] | None = None,
    connections: list[dict[str, Any]] | None = None,
) -> dict[str, Any]:

Import

from mitsu.workspace.surface_map import create_surface_map

I/O Contract

Inputs

Name Type Required Description
session dict[str, Any] Yes Full session dict with valid hex ID and intel
session_root Path Yes Directory for artifact storage
extra_nodes None No Optional transcript-derived nodes
connections None No Optional transcript-derived connections

Outputs

Name Type Description
returns dict[str, Any] {path, node_count, edge_count, transcript_node_count, title}

Usage Examples

Generate and Save Attack Surface Map

from pathlib import Path
from mitsu.workspace.surface_map import create_surface_map

result = create_surface_map(
    session=session_record,
    session_root=Path("~/.local/share/mitsu/sessions").expanduser(),
)
print(f"Map saved to: {result['path']}")
print(f"Nodes: {result['node_count']}, Edges: {result['edge_count']}")

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment