Repository navigation
Description
Where we are
dît is a Go library + CLI that classifies page types (login, error, landing, ...), form types (login, registration, search, password recovery, contact, order, ...) and individual field types (username, password, email, ...) with an in-repo CRF implementation (crf/: forward-backward, Viterbi, trainer) and linear classifiers (classifier/), with zero external ML dependencies. It ships train/evaluate/cross-validation tooling, a dit-collect data collector, a pretrained model auto-downloaded from Hugging Face (~93 MB), and an early captcha/ package. Honest caveats: the model is large for a CLI tool, there's no published accuracy comparison against prior art, CLI ergonomics are still minimal (no stdin, no batch, single output format), and three open PRs (#75, #76, #77) literally titled "PR title" need triage.
Landscape
| Project | Strengths | Link |
|---|---|---|
| Formasaurus | The direct prior art: Python form/field classifier (LogReg form types + CRF field types), trained on 1000+ annotated forms — but Python-only, heavy sklearn/sklearn-crfsuite deps, and effectively dormant | https://github.com/scrapinghub/Formasaurus |
| urlscan.io | Renders pages in a real browser, records DOM/network/screenshot, community verdicts — but SaaS, no structural form/field classification, rate-limited API | https://urlscan.io |
| PhishTank | Crowd-sourced phishing URL feed — reactive blocklist, zero structural analysis of unseen pages | https://phishtank.org |
| Playwright/headless scrapers | Can find forms on JS-rendered pages, but classify nothing; users hand-roll selectors | https://playwright.dev |
Formasaurus proved the approach (docs, PyPI) and then stalled. Nobody offers a single-binary, dependency-free form/field/page classifier usable in security pipelines — that is exactly dît's lane.
What "best" means
- Beat the prior art, provably: publish cross-validated accuracy vs Formasaurus on a shared/annotated corpus (target: ≥ its reported form-type accuracy, with per-class F1 in the README).
- Pipeline-native:
cat page.html | dit run -anddit run -l urls.txt --jsonwork, so dît composes with httpx/katana/nuclei-style toolchains (Support reading HTML from stdin #3, Batch mode for multiple URLs #4, Multiple output formats (table, csv, json) #5). - Fast and self-contained: classify a page in <100 ms on commodity hardware after one-time model download, with no Python, no network.
- Detections nobody else does structurally: honeypot fields (Honeypot field detection #10), CAPTCHA presence/type (CAPTCHA detection #11), and phishing-form signals (Phishing form detection #13) as first-class outputs, benchmarked against labeled sets rather than blocklists.
- Model you can retrain in an afternoon: documented
dit trainpath with custom labels (Custom label support for training #9) and a model ≤ 25 MB (quantized/pruned) as the default download.
Phases
Phase 1 — CLI & pipeline ergonomics
- Read HTML from stdin (Support reading HTML from stdin #3)
- Batch mode for multiple URLs (Batch mode for multiple URLs #4)
- Multiple output formats: table, csv, json (Multiple output formats (table, csv, json) #5)
- pre-commit config (.pre-commit conf #26) and triage/rename placeholder PRs PR title #75, PR title #76, feat: add --format flag with table and csv output #77
Phase 2 — Security detections (the differentiator)
- Honeypot field detection (Honeypot field detection #10)
- CAPTCHA detection (CAPTCHA detection #11) — build on the existing
captcha/package - Phishing form detection (Phishing form detection #13)
- Form change monitoring (Form change monitoring #12) — turns dît from a classifier into a monitoring primitive
Phase 3 — Reach & model quality
- Server mode with HTTP API (Server mode with HTTP API #6)
- JavaScript rendering for SPA forms (JavaScript rendering for SPA forms #7)
- Multi-language form support (Multi-language form support #8) — Formasaurus is English-biased; this is an open gap
- Custom label support for training (Custom label support for training #9)
- Published benchmark vs Formasaurus + model-size reduction (claims 1 and 5)
Open questions
- Can the 93 MB model.json be quantized/pruned (or split per-task: page/form/field) without losing accuracy, so
go installusers aren't surprised by the download? - What is the licensing/provenance story for the Hugging Face training data — can we accept community-contributed annotations?
- Should JS rendering (JavaScript rendering for SPA forms #7) live in core (chromedp dependency) or as a separate
dit-rendercompanion to keep the zero-dep promise?
🤖 Filed by Claude Code
Generated by Claude Code
Activity