Skip to content

Add MITM Domain Fronting module with auto-detect probe and Catppuccin theming#57

Open
saeedtahmtan wants to merge 3 commits into
lilendian0x00:masterfrom
saeedtahmtan:master
Open

Add MITM Domain Fronting module with auto-detect probe and Catppuccin theming#57
saeedtahmtan wants to merge 3 commits into
lilendian0x00:masterfrom
saeedtahmtan:master

Conversation

@saeedtahmtan

Copy link
Copy Markdown
Contributor

MITM Domain Fronting (patterniha method)
Introduces a complete MITM-based domain fronting module that bypasses DPI using TLS MITM decryption with domain fronting.
Backend (pkg/mitmdf/):

  • config.go — Config and GroupConfig types with dynamic group management (add/remove groups via UI), 4 default groups (google, meta, fastly, dns)
  • cert.go — RSA 2048 self-signed CA certificate generation + validation
  • generator.go — Generic Xray JSON config builder: per-group tls-repack-{name} outbounds with routing rules; googlevideo domains route through h11 inbound, all others through h2+http/1.1
  • assets.go — Auto-downloads geosite.dat + geoip.dat from v2fly releases to ~/.xray-knife/assets/ with progress callback
  • mitmdf.go — Service struct wrapping xray-core lifecycle (core.New → instance.Start/Close), sets XRAY_LOCATION_ASSET before boot
    Web backend:
  • web/services.go — MITMDFRunner (ManagedService) with SSE status broadcasts
  • web/service_manager.go — Start/Stop/Status/Cert/Assets delegation
  • web/api_handlers.go — 9 endpoints: start, stop, status, cert generate/check/download/install, assets check/download, probe
    Frontend:
  • types/settings.ts — MITMDFSettings, MITMDFGroupConfig (array-based for dynamic groups)
  • stores/appStore.ts — mitmdf state + actions + localStorage persist with migration for old object-format groups
  • services/api.ts — 9 API methods
  • services/sse.ts — mitmdf_status event handler
  • pages/dashboard/MITMDFTab.tsx — Full UI: status badge, start/stop, asset download banner, certificate management (generate/download/install), port config, dynamic group list with add/remove, extra IR domains, auto-detect probe
  • pages/Dashboard.tsx — Nav item with Shield icon
    Auto-Detect Domain Fronting Probe
    pkg/mitmdf/prober.go — Probes a target domain against multiple CDN front domains in parallel:
  • TCP dial → TLS handshake (SNI = front domain) → HTTP GET with Host: targetDomain
  • Returns success/status code/latency per front domain
  • Editable probe domain list (persisted in localStorage) merged with configured group front domains
  • "Add to Group" button on successful results appends target domain to matching group's extraDomains
    API: POST /api/v1/mitmdf/probe
    Certificate Management
  • GET /api/v1/mitmdf/cert/download — Serves PEM cert as .crt file download
  • POST /api/v1/mitmdf/cert/install — System-wide install: auto-detects distro (Debian update-ca-certificates, Fedora update-ca-trust, Arch trust), copies cert, runs update command, returns success/error with fallback sudo command
    Theme: Catppuccin Color System
    Replaced the entire color palette with Catppuccin accent colors while keeping surfaces neutral:
  • Accents: Blue (primary/ring), Red (destructive), Teal/Mauve/Yellow/Pink (chart colors)
  • Dark mode: Background oklch(0.13 0 0) (near-black), cards 0.16, surfaces 0.22–0.27
  • Light mode: Background pure white (1.0), borders 0.92, secondary 0.97
  • All surface/text colors are achromatic (0 chroma) — zero color tint on backgrounds
  • Replaced all hardcoded Tailwind color classes (bg-green-500, text-blue-400, etc.) with CSS variable equivalents (bg-primary, text-primary, bg-chart-3, etc.) across Dashboard.tsx, MITMDFTab.tsx, and ProxyStatusCard.tsx

All of this contribution is made possible by AI(opencode big pickle) the functionality tested and it is usable and working correctly as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant