How harsh-2418/kryptic-vision-hub works
Purpose and Runtime
Kryptic Vision Hub is a Flask-based educational cybersecurity analysis platform. It serves server-rendered HTML, rule-based security analysis, user/account workflows, analytics, audit logging, and generated reports. Launch is through app.py; application settings and secrets originate in config.py.
Application Composition
app.py is the composition root: it initializes Flask and registers route modules as blueprints. Route handlers form the web/API boundary, render templates, enforce session/account access, invoke scanners, and persist or retrieve application data. Shared UI is template/static-asset based, centered on templates/base.html and browser JavaScript under static/js/.
Authentication, Accounts, and Administration
Authentication and registration enter through routes/auth.py. User profile/password/avatar management and UI preferences are isolated in routes/profile.py and routes/settings.py. Administrative control is separated in routes/admin.py, with the documented restricted admin identity. These flows depend on persisted user records and establish the access boundary for dashboard, history, logs, and privileged cleanup operations.
Analysis Modules
Each analysis capability has a route adapter and a standalone rule engine:
• URL/phishing scanning: routes/scanner.py → scanner/phishing_detector.py
• SQL static inspection: routes/sql_routes.py → scanner/sql_analyzer.py
• XSS static inspection: routes/xss_routes.py → scanner/xss_analyzer.py
• WiFi configuration simulation: routes/wifi_routes.py → scanner/wifi_detector.py
• Evil-twin simulation: routes/evil_twin_routes.py → scanner/evil_twin_detector.py
Inputs are submitted from module pages, evaluated server-side without ML or paid threat APIs, then rendered through unified result-oriented views such as templates/analysis_result.html.
Persistence, History, and Audit Boundary
SQLite is the system-of-record layer. Schema initialization and parameterized database access reside in database/db.py; the local database artifact is database/database.db. Scan outcomes feed user history and aggregate metrics; account actions, scans, profile changes, and report exports feed the audit-log surface exposed by routes/logs.py. This creates a clear boundary between stateless analysis engines and durable application state.
Dashboard and Reporting
routes/dashboard.py exposes dashboard data and chart-oriented analytics, rendered in templates/dashboard.html and visualized by static/js/charts.js using Chart.js. It aggregates users, scans, module usage, safety outcomes, and daily activity from persisted records. routes/reports.py generates server-side ReportLab PDF exports; report artifacts are stored under reports/, alongside existing JSON output such as reports/scan_report_2.json.
External Dependencies and Delivery Surface
Material runtime dependencies are Flask/Werkzeug for HTTP and authentication-adjacent utilities, requests for URL-related checks, ReportLab for PDF generation, and Chart.js in the browser. The app is a local Flask service, documented at http://localhost:5000; it uses local SQLite and filesystem report storage rather than cloud infrastructure or external security APIs.
Main entry points: app.py Application composition · db.py Database access and schema · scanner.py URL scan route · sql_routes.py SQL scan route
Components 20
Flask web boundary
- Application composition · Initializes Flask and registers blueprints.
app.py - Account and admin routes · Authentication, profile, settings, and privileged administration.
routes/auth.py - URL scan route
routes/scanner.py - SQL scan route
routes/sql_routes.py - XSS scan route
routes/xss_routes.py - WiFi simulation route
routes/wifi_routes.py - Evil-twin simulation route
routes/evil_twin_routes.py - Dashboard analytics
routes/dashboard.py - Audit-log route
routes/logs.py - Report export route · Generates PDF exports with ReportLab.
routes/reports.py - Server-rendered UI · Shared layout, analysis results, and dashboard charts.
templates/base.html
Rule-based analysis
- Phishing rules
scanner/phishing_detector.py - SQL inspection rules
scanner/sql_analyzer.py - XSS inspection rules
scanner/xss_analyzer.py - WiFi simulation rules
scanner/wifi_detector.py - Evil-twin rules
scanner/evil_twin_detector.py
State and reporting
- Database access and schema · Initializes schema and performs parameterized access.
database/db.py - Application database · Stores users, scans, history, metrics, and audit events.
database/database.db - Report artifacts · Stores generated PDFs and JSON outputs.
Other components
- Settings and secrets
config.py
Connections 28
- Settings and secrets → Application composition: configures
- Application composition → Account and admin routes: registers
- Application composition → URL scan route: registers
- Application composition → SQL scan route: registers
- Application composition → XSS scan route: registers
- Application composition → WiFi simulation route: registers
- Application composition → Evil-twin simulation route: registers
- Application composition → Dashboard analytics: registers
- Application composition → Audit-log route: registers
- Application composition → Report export route: registers
- Account and admin routes → Database access and schema: accounts and access
- URL scan route → Phishing rules: evaluates URL
- SQL scan route → SQL inspection rules: inspects SQL
- XSS scan route → XSS inspection rules: inspects XSS
- WiFi simulation route → WiFi simulation rules: simulates
- Evil-twin simulation route → Evil-twin rules: simulates
- URL scan route → Database access and schema: persists outcomes
- SQL scan route → Database access and schema: persists outcomes
- XSS scan route → Database access and schema: persists outcomes
- WiFi simulation route → Database access and schema: persists outcomes
- Evil-twin simulation route → Database access and schema: persists outcomes
- Dashboard analytics → Database access and schema: aggregates metrics
- Audit-log route → Database access and schema: reads audit events
- Report export route → Database access and schema: reads report data
- Report export route → Report artifacts: writes exports
- Database access and schema → Application database: reads and writes
- Dashboard analytics → Server-rendered UI: renders dashboard
- URL scan route → Server-rendered UI: renders results