CursorTokenLogin/search_token.py
2026-04-07 21:22:37 +08:00

26 lines
714 B
Python

import sqlite3
from pathlib import Path
home = Path.home()
db_path = home / "AppData" / "Roaming" / "Cursor" / "User" / "globalStorage" / "state.vscdb"
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# 搜索包含token、auth、account等关键词的键
print("搜索token相关的键:")
cursor.execute("SELECT key FROM ItemTable;")
all_keys = cursor.fetchall()
for key in all_keys:
key_name = key[0].lower()
if any(keyword in key_name for keyword in ['token', 'auth', 'account', 'credential', 'login']):
print(f" {key[0]}")
print("\n搜索cursor相关的键:")
for key in all_keys:
key_name = key[0].lower()
if 'cursor' in key_name:
print(f" {key[0]}")
conn.close()