Skip to content

Commit 5871ff6

Browse files
Ahsaan-Ullahclaude
andcommitted
Add fingerprint collision detector, backup/restore, bulk grid actions and tag filtering
Fingerprint collisions: collision.py finds profiles that present the same fingerprint (identical WebGL, screen, hardware, user-agent) — a linkage risk that lets a site tie accounts together. Exposed as `persona collisions`, GET /api/profiles/collisions, and surfaced on the Health page with a "Shared FP" count and per-row badge (folded into needsAttention). Pure logic, unit-tested. Backup & restore: ProfileStore.backup/restore zip a profile plus its whole browser session (user-data) into one portable file, so a warmed-up account can move between machines. `persona backup` / `persona restore [--new-id]`. `export`/`import` still handle config-only moves. Dashboard: the multi-select bar gains Warm up and Export actions; the filter popover gains a Tag filter and grid tag chips are clickable to filter by them. Tests: +13 (collision grading, backup round-trip incl. session, collisions endpoint + health flag). Full suite 164 passed; dashboard builds clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d46e984 commit 5871ff6

12 files changed

Lines changed: 454 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ Format based on [Keep a Changelog](https://keepachangelog.com/).
55
## [Unreleased]
66

77
### Added
8+
- **Fingerprint collision detector** (`persona collisions`, `collision.py`,
9+
`GET /api/profiles/collisions`): finds profiles that present the *same*
10+
fingerprint — identical WebGL, screen, hardware and user-agent read as one
11+
device wearing two hats, so a site can link the accounts and ban them
12+
together. Pure logic over the stored profiles (no browser), flagged on the
13+
dashboard **Health** page with a "Shared FP" count and a per-row badge, plus a
14+
CLI table. `identical` marks the worst case (same canvas/audio seed too).
15+
- **Backup & restore** (`persona backup` / `persona restore`,
16+
`ProfileStore.backup`/`restore`): zip a profile **and its whole browser
17+
session** (cookies, localStorage — everything under user-data) into one
18+
portable file to archive it or move it to another machine. `restore --new-id`
19+
brings it in as a fresh copy instead of overwriting the original. (Unlike
20+
`export`/`import`, which move only the config.)
21+
- **Bulk grid actions & tag filtering** (dashboard): the multi-select bar now
22+
also **warms up** and **exports** the selected profiles in one go (alongside
23+
the existing launch / edit-all / delete); the filter popover gained a **Tag**
24+
filter, and tags shown on a profile are clickable to filter by them.
825
- **Profile health overview** (`GET /api/profiles/health`, dashboard **Health**
926
page): one row per profile grading it at a glance — coherence (computed
1027
instantly from the stored fingerprint), whether a proxy is set and its country,

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ stays the same manager over all of them.
252252
`schedule run-due`
253253
- [x] Profile health overview — one page grading coherence, proxy, cached trust
254254
and warm-up schedule across every profile, with one-click fix
255+
- [x] Fingerprint collision detector (`persona collisions`, Health page) —
256+
catches profiles that share a fingerprint before a site links the accounts
257+
- [x] Backup & restore (`persona backup` / `restore`) — a profile **and its
258+
session** zipped into one portable file, movable to another machine
259+
- [x] Bulk grid actions (warm up / export the selection) + tag filtering
255260

256261
**Next**
257262

‎dashboard/src/App.jsx‎

Lines changed: 77 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Cpu, MonitorSmartphone, Fingerprint, Wifi, WifiOff, Check, Clipboard,
77
Settings, Boxes, Activity, MapPin, Clock, Camera, Mic, Blocks,
88
RefreshCw, Server, Sparkles, ArrowRight, Star, Circle,
9-
Cookie, Download, Upload,
9+
Cookie, Download, Upload, Flame, Link2,
1010
} from "lucide-react";
1111

1212
/* ================================================================== *
@@ -210,7 +210,7 @@ export default function App() {
210210
const [editor, setEditor] = useState(null);
211211
const [bulk, setBulk] = useState(false);
212212
const [sync, setSync] = useState(false); // "edit all selected" modal
213-
const [filters, setFilters] = useState({ status: "", engine: "", os: "", proxy: "" });
213+
const [filters, setFilters] = useState({ status: "", engine: "", os: "", proxy: "", tag: "" });
214214
const [mode, setMode] = useState("connecting"); // connecting | live | demo
215215
const [engines, setEngines] = useState(null); // {name: installed} from API
216216
const [defaultEngine, setDefaultEngine] = useState(ENGINE_ORDER[0]); // new-profile default
@@ -257,9 +257,15 @@ export default function App() {
257257
(!filters.status || p.status === filters.status) &&
258258
(!filters.engine || (p.engine || "playwright") === filters.engine) &&
259259
(!filters.os || p.os === filters.os) &&
260+
(!filters.tag || (p.tags || []).includes(filters.tag)) &&
260261
(!filters.proxy || (filters.proxy === "with" ? !!p.proxy : !p.proxy))),
261262
[profiles, folder, query, filters]);
262263

264+
// Every distinct tag in use, for the filter popover.
265+
const allTags = useMemo(
266+
() => [...new Set(profiles.flatMap(p => p.tags || []))].sort(),
267+
[profiles]);
268+
263269
// Memoised so a 10k-profile list isn't re-scanned on every render / poll tick.
264270
const { running, proxyCount, coherentCount } = useMemo(() => ({
265271
running: profiles.filter(p => p.status === "running").length,
@@ -383,7 +389,7 @@ export default function App() {
383389
</div>
384390

385391
{view === "profiles" && (
386-
<ProfilesView {...{ filtered, query, setQuery, folder, sel, setSel, toggleSel, allSel, toggleRun, clone, remove, setEditor, setProfiles, setSync, filters, setFilters, live, refresh }} />
392+
<ProfilesView {...{ filtered, query, setQuery, folder, sel, setSel, toggleSel, allSel, toggleRun, clone, remove, setEditor, setProfiles, setSync, filters, setFilters, allTags, live, refresh }} />
387393
)}
388394
{view === "health" && <HealthView profiles={profiles} live={live} refresh={refresh} setEditor={setEditor} />}
389395
{view === "engines" && <EnginesView engines={engines} live={live} />}
@@ -429,11 +435,31 @@ export default function App() {
429435
}
430436

431437
/* ---- Profiles view ----------------------------------------------- */
432-
function ProfilesView({ filtered, query, setQuery, folder, sel, setSel, toggleSel, allSel, toggleRun, clone, remove, setEditor, setProfiles, setSync, filters, setFilters, live, refresh }) {
438+
function ProfilesView({ filtered, query, setQuery, folder, sel, setSel, toggleSel, allSel, toggleRun, clone, remove, setEditor, setProfiles, setSync, filters, setFilters, allTags, live, refresh }) {
433439
const [filterOpen, setFilterOpen] = useState(false);
434440
const activeFilters = Object.values(filters).filter(Boolean).length;
435441
const setFilter = (key, value) => setFilters(f => ({ ...f, [key]: f[key] === value ? "" : value }));
436-
const clearFilters = () => setFilters({ status: "", engine: "", os: "", proxy: "" });
442+
const clearFilters = () => setFilters({ status: "", engine: "", os: "", proxy: "", tag: "" });
443+
444+
// Warm up every selected profile (live only — it opens real headless browsers).
445+
const warmSelected = async () => {
446+
const ids = [...sel];
447+
if (!live) { alert("Warm-up runs against the live engine — start `persona serve` first."); return; }
448+
setSel(new Set());
449+
await Promise.all(ids.map(id => api.warmup(id, 5, "general").catch(() => {})));
450+
await refresh();
451+
};
452+
453+
// Export the selected profiles as one JSON file (config: fingerprint, proxy,
454+
// tags — not the browser session; use `persona backup` for a full session).
455+
const exportSelected = () => {
456+
const chosen = filtered.filter(p => sel.has(p.id));
457+
const blob = new Blob([JSON.stringify(chosen, null, 2)], { type: "application/json" });
458+
const url = URL.createObjectURL(blob);
459+
const a = document.createElement("a");
460+
a.href = url; a.download = `persona-profiles-${chosen.length}.json`; a.click();
461+
URL.revokeObjectURL(url);
462+
};
437463

438464
// Pagination keeps the grid responsive when there are thousands of profiles.
439465
const PAGE = 100;
@@ -468,7 +494,9 @@ function ProfilesView({ filtered, query, setQuery, folder, sel, setSel, toggleSe
468494
<div className="ps-bulkbar">
469495
<span>{sel.size} selected</span>
470496
<button onClick={() => { sel.forEach(toggleRun); setSel(new Set()); }}><Play size={13} /> Launch</button>
497+
<button onClick={warmSelected}><Flame size={13} /> Warm up</button>
471498
<button onClick={() => setSync(true)}><Copy size={13} /> Edit all</button>
499+
<button onClick={exportSelected}><Download size={13} /> Export</button>
472500
<button className="danger" onClick={async () => { const ids = [...sel]; setSel(new Set()); if (live) { for (const id of ids) { try { await api.remove(id); } catch {} } await refresh(); } else { setProfiles(ps => ps.filter(p => !ids.includes(p.id))); } }}><Trash2 size={13} /> Delete</button>
473501
</div>
474502
)}
@@ -493,6 +521,10 @@ function ProfilesView({ filtered, query, setQuery, folder, sel, setSel, toggleSe
493521
options={OS_LIST.map(o => [o, o])} />
494522
<FilterRow label="Proxy" value={filters.proxy} onPick={v => setFilter("proxy", v)}
495523
options={[["with", "With proxy"], ["without", "Direct"]]} />
524+
{allTags.length > 0 && (
525+
<FilterRow label="Tag" value={filters.tag} onPick={v => setFilter("tag", v)}
526+
options={allTags.map(t => [t, t])} />
527+
)}
496528
</div>
497529
</>
498530
)}
@@ -538,7 +570,11 @@ function ProfilesView({ filtered, query, setQuery, folder, sel, setSel, toggleSe
538570
<span className={"ps-status " + p.status} />
539571
<div>
540572
<div className="ps-pname">{p.name}</div>
541-
<div className="ps-tags">{p.tags.map(t => <span key={t} className="ps-tag">{t}</span>)}</div>
573+
<div className="ps-tags">{p.tags.map(t => (
574+
<span key={t} className={"ps-tag clickable" + (filters.tag === t ? " on" : "")}
575+
title={filters.tag === t ? "Clear tag filter" : `Filter by "${t}"`}
576+
onClick={() => setFilter("tag", t)}>{t}</span>
577+
))}</div>
542578
</div>
543579
</div>
544580
</td>
@@ -1331,21 +1367,23 @@ function HealthView({ profiles, live, refresh, setEditor }) {
13311367
// Demo mode: no engine to grade against, so derive coherence/proxy from the
13321368
// sample profiles and be honest that trust and schedules need the engine.
13331369
if (!live) {
1334-
const rows = profiles.map(p => ({ ...p, coherent: coherence(p).length === 0, issues: coherence(p) }));
1370+
const colliding = collidingIds(profiles);
1371+
const rows = profiles.map(p => ({ ...p, coherent: coherence(p).length === 0, issues: coherence(p), collides: colliding.has(p.id) }));
13351372
const coherent = rows.filter(r => r.coherent).length;
13361373
return (
13371374
<div className="ps-scroll">
13381375
<div className="ps-health-summary">
13391376
<HealthChip label="Profiles" value={rows.length} />
13401377
<HealthChip label="Coherent" value={`${coherent}/${rows.length}`} color={T.mint} />
13411378
<HealthChip label="With proxy" value={rows.filter(r => r.proxy).length} color={T.lilac} />
1379+
<HealthChip label="Shared FP" value={colliding.size} color={colliding.size ? T.amber : T.mint} />
13421380
</div>
1343-
<div className="ps-hint"><Activity size={12} /> Start the engine (<code>persona serve</code>) for live trust grades, DNS/proxy status and warm-up schedules. Showing coherence derived from the sample profiles.</div>
1381+
<div className="ps-hint"><Activity size={12} /> Start the engine (<code>persona serve</code>) for live trust grades, DNS/proxy status and warm-up schedules. Showing coherence and fingerprint collisions derived from the sample profiles.</div>
13441382
<table className="ps-table" style={{ marginTop: 12 }}>
13451383
<thead><tr><th>Profile</th><th>Engine</th><th>OS</th><th>Coherence</th><th>Proxy</th></tr></thead>
13461384
<tbody>{rows.map((r, i) => (
1347-
<tr key={r.id || i}>
1348-
<td>{r.name}</td>
1385+
<tr key={r.id || i} className={r.collides ? "ps-attention" : ""}>
1386+
<td>{r.name}{r.collides && <SharedTag />}</td>
13491387
<td className="ps-mono dim">{r.engine || "—"}</td>
13501388
<td><span className="ps-os">{r.os}</span></td>
13511389
<td>{r.coherent ? <span className="ps-check ok" style={{ padding: 0, background: "none" }}><Check size={12} /> coherent</span>
@@ -1374,6 +1412,7 @@ function HealthView({ profiles, live, refresh, setEditor }) {
13741412
<HealthChip label="Coherent" value={`${s.coherent ?? 0}/${s.total ?? 0}`} color={T.mint} />
13751413
<HealthChip label="With proxy" value={`${s.withProxy ?? 0}/${s.total ?? 0}`} color={T.lilac} />
13761414
<HealthChip label="Scheduled" value={s.scheduled ?? 0} color={T.violet} />
1415+
<HealthChip label="Shared FP" value={s.colliding ?? 0} color={s.colliding ? T.amber : T.mint} />
13771416
<HealthChip label="Needs attention" value={s.needsAttention ?? 0} color={s.needsAttention ? T.amber : T.mint} />
13781417
<div style={{ flex: 1 }} />
13791418
<button className="ps-btn ghost sm" onClick={load}><RefreshCw size={13} /> Refresh</button>
@@ -1395,6 +1434,7 @@ function HealthView({ profiles, live, refresh, setEditor }) {
13951434
<td>
13961435
<button className="ps-linkish" onClick={() => setEditor(profiles.find(p => p.id === r.id) || null)}>{r.name}</button>
13971436
{r.status === "running" && <span className="ps-runtag">live</span>}
1437+
{r.collides && <SharedTag />}
13981438
</td>
13991439
<td className="ps-mono dim">{r.engine}</td>
14001440
<td>{r.coherent
@@ -1423,7 +1463,7 @@ function HealthView({ profiles, live, refresh, setEditor }) {
14231463
</tbody>
14241464
</table>
14251465
)}
1426-
<div className="ps-hint"><Activity size={12} /> Coherence and proxy are read from each profile instantly; the <b style={{ color: T.text }}>trust grade is the last one measured</b> (a live check opens a real browser). Use <ShieldCheck size={11} /> to grade a profile and <Sparkles size={11} /> to auto-adjust it to grade A. Rows needing attention (incoherent, or grade C/D) are highlighted.</div>
1466+
<div className="ps-hint"><Activity size={12} /> Coherence and proxy are read from each profile instantly; the <b style={{ color: T.text }}>trust grade is the last one measured</b> (a live check opens a real browser). Use <ShieldCheck size={11} /> to grade a profile and <Sparkles size={11} /> to auto-adjust it to grade A. Rows needing attention (incoherent, grade C/D, or a <Link2 size={11} /> shared fingerprint) are highlighted — regenerate one side of a shared pair so the accounts can't be linked.</div>
14271467
</div>
14281468
);
14291469
}
@@ -1437,6 +1477,28 @@ function HealthChip({ label, value, color }) {
14371477
);
14381478
}
14391479

1480+
// Small "shared FP" flag for a profile that isn't fingerprint-unique.
1481+
function SharedTag() {
1482+
return (
1483+
<span className="ps-shared" title="Shares a fingerprint with another profile — a linkage risk">
1484+
<Link2 size={10} /> shared FP
1485+
</span>
1486+
);
1487+
}
1488+
1489+
// Demo-mode fingerprint collision: which profiles look like the same device.
1490+
// Mirrors engine/collision.py's signature over the fields the sample data has.
1491+
function fpSignature(p) {
1492+
return [p.os, p.userAgent, p.screen, p.cores, p.memory, p.webglRenderer].join("|");
1493+
}
1494+
function collidingIds(profiles) {
1495+
const bySig = {};
1496+
for (const p of profiles) (bySig[fpSignature(p)] ||= []).push(p.id);
1497+
const out = new Set();
1498+
for (const ids of Object.values(bySig)) if (ids.length > 1) ids.forEach(id => out.add(id));
1499+
return out;
1500+
}
1501+
14401502
function ProxiesView({ profiles, live, refresh }) {
14411503
const [pool, setPool] = useState([]);
14421504
const [importOpen, setImportOpen] = useState(false);
@@ -1702,6 +1764,10 @@ a { color: inherit; }
17021764
.ps-status.stopped { background: ${T.grey}; }
17031765
.ps-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
17041766
.ps-tag { font-size: 10px; color: ${T.muted}; background: ${T.surface}; border: 1px solid ${T.line}; padding: 1px 6px; border-radius: 5px; }
1767+
.ps-tag.clickable { cursor: pointer; transition: border-color .15s, color .15s; }
1768+
.ps-tag.clickable:hover { color: ${T.text}; border-color: ${T.violet}; }
1769+
.ps-tag.on { color: ${T.bg}; background: ${T.violet}; border-color: ${T.violet}; }
1770+
.ps-shared { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: ${T.amber}; background: ${T.amberDim || "rgba(240,180,80,.14)"}; padding: 1px 6px; border-radius: 5px; vertical-align: middle; }
17051771
.ps-env { display: flex; align-items: center; gap: 8px; }
17061772
.ps-os { font-size: 11px; font-weight: 600; color: ${T.lilac}; background: ${T.violetDim}; padding: 2px 8px; border-radius: 6px; }
17071773
.ps-engine-chip { font-size: 11px; font-weight: 500; color: ${T.muted}; background: ${T.surface}; border: 1px solid ${T.line}; padding: 3px 9px; border-radius: 6px; }

‎dashboard/src/api.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ export const api = {
7171
deleteSchedule: (id) => req("DELETE", `/api/schedules/${id}`),
7272
// Health overview: coherence, proxy, cached trust grade and schedule per profile.
7373
health: () => req("GET", "/api/profiles/health"),
74+
// Fingerprint collisions: which profiles look like the same device.
75+
collisions: () => req("GET", "/api/profiles/collisions"),
7476
};

‎engine/README.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,24 @@ persona default-engine cloak # set the engine new profiles use (CloakBrowser)
3434
persona launch acct-01
3535
persona export acct-01 acct-01.json
3636
persona import acct-01.json
37+
persona backup acct-01 acct-01.zip # profile + whole session, one portable file
38+
persona restore acct-01.zip # bring it back (add --new-id to clone it)
39+
persona collisions # any two profiles sharing a fingerprint?
3740
persona import-from gologin-export.json # migrate from another anti-detect tool
3841
persona serve # run the HTTP API the dashboard talks to
3942
```
4043

44+
`export`/`import` move a profile's *config* (a JSON file). `backup`/`restore`
45+
move the whole identity — the config **and** its browser session (cookies,
46+
localStorage) — zipped together, so a warmed-up account survives a move to
47+
another machine. Treat a backup as sensitive: the archive holds the proxy
48+
password in plaintext.
49+
50+
`collisions` catches an easy self-inflicted wound: two profiles that render the
51+
*same* fingerprint (same WebGL, screen, hardware, user-agent) look like one
52+
device to a site and can be linked, so a ban on one can take the others with it.
53+
Regenerate one side of each pair (`persona regen <name>`).
54+
4155
### Migrating from GoLogin / AdsPower / Multilogin
4256

4357
```bash
@@ -254,6 +268,7 @@ store.save(profile)
254268
| `crypto.py` | Encrypt-at-rest for secrets (optional `cryptography` backend) |
255269
| `importers.py` | Tolerant import from GoLogin / AdsPower / Multilogin exports |
256270
| `probe.py` | Proxy/DNS/leak/TLS test, the trust report, and the auto-aligner (`align`) |
271+
| `collision.py` | Finds profiles that share a fingerprint (`persona collisions`) |
257272
| `bulk.py` | Multi-profile synchroniser + bulk generator (`generate_profiles`) |
258273
| `proxypool.py` | Parse pasted proxy lists (any layout) + health-check them |
259274
| `warmup.py` | Human-paced browsing (per-vertical presets) that gives a fresh profile a past |

0 commit comments

Comments
 (0)