How morhadotsan/http_intercept works
http_intercept is a self-hosted HTTP security-header scanner. The user submits a URL in the browser; PHP validates it, calls the Flask analyzer, and stores the scan in SQLite. The analyzer fetches the target response, evaluates ten header/security rules, and grades the results. The UI also supports browsing scan history and comparing two scans. Rule implementations are grouped because their individual modules are independent checks. The README documents this architecture; sampled files show the scan, scoring, persistence, history, and comparison paths.
Main entry points: main.js UI controller · scan.php Scan API · app.py Flask scanner · db.php Database access
Components 14
Web application
- Scan UI
web/index.php - UI controller
web/public/main.js - Scan API
web/api/scan.php - History API
web/api/history.php - Compare API
web/api/compare.php - URL validation
web/lib/sanitize.php - Analyzer bridge
web/lib/analyzer_client.php
Scan analyzer
- Flask scanner
analyzer/app.py - Security rules
analyzer/rules - Score and grade
analyzer/scoring.py
Persistence
- Database access
web/lib/db.php - Scan records
web/lib/db.php
Other components
- Browser user
- Target website
Connections 17
- Browser user → Scan UI: uses
README.md - Scan UI → UI controller: loads
web/index.php - UI controller → Scan API: submits scan
web/public/main.js - UI controller → History API: loads history
web/public/main.js - UI controller → Compare API: requests comparison
web/public/main.js - Scan API → URL validation: validates URL
web/api/scan.php - Scan API → Analyzer bridge: requests scan
web/api/scan.php - Analyzer bridge → Flask scanner: POSTs scan
web/lib/analyzer_client.php - Flask scanner → Target website: fetches response
analyzer/app.py - Flask scanner → Security rules: evaluates headers
analyzer/app.py - Flask scanner → Score and grade: scores results
analyzer/app.py - Scan API → Database access: persists scan
web/api/scan.php - Database access → Scan records: creates schema
web/lib/db.php - History API → Database access: queries history
web/api/history.php - History API → URL validation: validates URL
web/api/history.php - Compare API → Database access: loads scans
web/api/compare.php - Compare API → URL validation: cleans IDs
web/api/compare.php